diff --git a/.cargo/config.toml b/.cargo/config.toml index 5a69aef4e2..95ea9fad7f 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,4 +1,5 @@ #paths = ["../vfox.rs"] +#paths = ["../usage/lib"] [env] RUST_TEST_THREADS = '1' diff --git a/Cargo.lock b/Cargo.lock index 4cf1305765..75e32dc57b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -353,9 +353,9 @@ checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "block-buffer" @@ -566,9 +566,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95dca1b68188a08ca6af9d96a6576150f598824bdb528c1190460c2940a0b48" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -576,9 +576,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab52925392148efd3f7562f2136a81ffb778076bcc85727c6e020d6dd57cf15" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -595,7 +595,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -606,9 +606,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clap_mangen" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbfe6ac42a2438d0968beba18e3c35cacf16b0c25310bc22b1f5f3cffff09f4" +checksum = "724842fa9b144f9b89b3f3d371a89f3455eea660361d13a554f68f8ae5d6c13a" dependencies = [ "clap", "roff", @@ -647,7 +647,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -699,7 +699,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -892,7 +892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -928,7 +928,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -952,7 +952,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -963,7 +963,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1027,7 +1027,7 @@ checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1040,7 +1040,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1095,7 +1095,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1287,7 +1287,7 @@ dependencies = [ "pest_derive", "regex", "strum", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1509,7 +1509,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -1916,7 +1916,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.95", + "syn 2.0.96", "unic-langid", ] @@ -1930,7 +1930,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2071,7 +2071,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2126,7 +2126,7 @@ dependencies = [ "autocfg", "impl-tools-lib", "proc-macro-error2", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2138,7 +2138,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2313,13 +2313,14 @@ dependencies = [ [[package]] name = "kdl" -version = "4.7.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a18038fbecda667e7ea2101bdd02af754da5e17ca2887a7649b8f3fa809d8b8" +checksum = "6d63de1aa3d632a8dd61da7cddfc499e9f88e6265d85bd84002419c3cdd3dc8f" dependencies = [ "miette", - "nom", + "num", "thiserror 1.0.69", + "winnow", ] [[package]] @@ -2342,7 +2343,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2577,7 +2578,7 @@ checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2712,7 +2713,7 @@ dependencies = [ "tera", "terminal_size", "test-log", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "toml 0.8.19", "toml_edit", @@ -2773,7 +2774,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -2835,12 +2836,76 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2910,7 +2975,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3069,7 +3134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 2.0.10", + "thiserror 2.0.11", "ucd-trie", ] @@ -3093,7 +3158,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3172,7 +3237,7 @@ checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3306,7 +3371,7 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -3340,7 +3405,7 @@ dependencies = [ "rustc-hash 2.1.0", "rustls", "socket2", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -3359,7 +3424,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.10", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -3661,7 +3726,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.95", + "syn 2.0.96", "walkdir", ] @@ -3717,9 +3782,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "once_cell", "ring", @@ -3969,7 +4034,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4052,7 +4117,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4090,7 +4155,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4304,7 +4369,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4326,9 +4391,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -4352,7 +4417,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4517,7 +4582,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4537,11 +4602,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.10", + "thiserror-impl 2.0.11", ] [[package]] @@ -4552,18 +4617,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] name = "thiserror-impl" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4658,7 +4723,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4783,7 +4848,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -4884,7 +4949,7 @@ dependencies = [ "serial_test", "strum", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "url", "which 7.0.1", "xz2", @@ -5032,14 +5097,14 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "usage-lib" -version = "1.7.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab923f719b3048bd1cd2fb738fca978ed2a60756ce15cdad639fc40645adad9c" +checksum = "af82e9e433b8f3ab2471b1f3041774ab9a1299c855f4cf2448e2370a333d7356" dependencies = [ "clap", "heck 0.5.0", "indexmap 2.7.0", - "itertools 0.13.0", + "itertools 0.14.0", "kdl", "log", "miette", @@ -5049,7 +5114,7 @@ dependencies = [ "shell-words", "strum", "tera", - "thiserror 2.0.10", + "thiserror 2.0.11", "versions", "xx", ] @@ -5117,7 +5182,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "url", "xx", @@ -5190,7 +5255,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-shared", ] @@ -5225,7 +5290,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5365,7 +5430,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5376,7 +5441,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5568,9 +5633,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.22" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] @@ -5634,7 +5699,7 @@ dependencies = [ "reqwest", "sha2", "tar", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "xz2", "zip", @@ -5675,7 +5740,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -5697,7 +5762,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5717,7 +5782,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", "synstructure", ] @@ -5738,7 +5803,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5760,7 +5825,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.95", + "syn 2.0.96", ] [[package]] @@ -5785,7 +5850,7 @@ dependencies = [ "pbkdf2", "rand", "sha1", - "thiserror 2.0.10", + "thiserror 2.0.11", "time", "zeroize", "zopfli", diff --git a/Cargo.toml b/Cargo.toml index 8aefafd6c6..0419c8db60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -138,8 +138,7 @@ toml = { version = "0.8", features = ["parse"] } toml_edit = { version = "0.22", features = ["parse"] } ubi = { version = "0.3", default-features = false } url = "2" -# usage-lib = { path = "../usage/lib", features = ["clap", "docs"] } -usage-lib = { version = "1", features = ["clap", "docs"] } +usage-lib = { version = "2", features = ["clap", "docs"] } versions = { version = "6", features = ["serde"] } # vfox = { path = "../vfox.rs" } vfox = { version = "1", default-features = false } diff --git a/completions/mise.bash b/completions/mise.bash index 17905b1c0f..a357998ce6 100644 --- a/completions/mise.bash +++ b/completions/mise.bash @@ -22,5 +22,9 @@ _mise() { return 0 } -shopt -u hostcomplete && complete -o nospace -o bashdefault -o nosort -F _mise mise +if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then + shopt -u hostcomplete && complete -o nospace -o bashdefault -o nosort -F _mise mise +else + shopt -u hostcomplete && complete -o nospace -o bashdefault -F _mise mise +fi # vim: noet ci pi sts=0 sw=4 ts=4 ft=sh diff --git a/completions/mise.fish b/completions/mise.fish index 77959c3b6a..6e9ced7aab 100644 --- a/completions/mise.fish +++ b/completions/mise.fish @@ -9,4 +9,9 @@ end if ! set -q _usage_spec_mise_2025_1_3 set -g _usage_spec_mise_2025_1_3 (mise usage | string collect) end -complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_1_3" -- (commandline -cop) (commandline -t))' +set -l tokens +if commandline -x >/dev/null 2>&1 + complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_1_3" -- (commandline -xpc) (commandline -t))' +else + complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_1_3" -- (commandline -opc) (commandline -t))' +end diff --git a/e2e/tasks/test_task_deps b/e2e/tasks/test_task_deps index 2d377d7d6e..40359231e1 100644 --- a/e2e/tasks/test_task_deps +++ b/e2e/tasks/test_task_deps @@ -47,8 +47,8 @@ Source: ~/workdir/mise.toml Depends on: hello:* Usage Spec: - name "hello:all" - bin "hello:all"' + name hello:all + bin hello:all' echo '' >mise.toml diff --git a/e2e/tasks/test_task_info b/e2e/tasks/test_task_info index ef2d58957f..5fbc8f510c 100644 --- a/e2e/tasks/test_task_info +++ b/e2e/tasks/test_task_info @@ -7,8 +7,8 @@ Source: ~/workdir/mise-tasks/build.sh File: ~/workdir/mise-tasks/build.sh Usage Spec: - name "build" - bin "build"' + name build + bin build' assert_contains "mise task info build.sh --json" '"name": "build"' diff --git a/e2e/tasks/test_task_usage b/e2e/tasks/test_task_usage index 44c4555bb5..50f8a680fd 100644 --- a/e2e/tasks/test_task_usage +++ b/e2e/tasks/test_task_usage @@ -10,7 +10,7 @@ assert_json_partial_array "mise task ls --json" "name,description,source" "[ \"source\": \"$PWD/mise-tasks/test.sh\" } ]" -assert "mise task ls --usage" 'cmd "test" help="sh"' +assert "mise task ls --usage" 'cmd test help=sh' assert "mise task add --file test --description no-sh" assert "mise task ls" "test no-sh @@ -45,5 +45,5 @@ assert_json_partial_array "mise task ls --json" "name,description,source" "$( EOF )" -assert "mise task ls --usage" 'cmd "test" help="no-sh" -cmd "test.sh" help="sh"' +assert "mise task ls --usage" 'cmd test help=no-sh +cmd test.sh help=sh' diff --git a/mise.lock b/mise.lock index 272c12ab10..ca16b702eb 100644 --- a/mise.lock +++ b/mise.lock @@ -41,7 +41,7 @@ version = "0.2.3" backend = "cargo:toml-cli" [tools."cargo:usage-cli"] -version = "1.7.4" +version = "2.0.0" backend = "cargo:usage-cli" [tools.cosign] diff --git a/mise.usage.kdl b/mise.usage.kdl index 8fe5170f00..a410862b52 100644 --- a/mise.usage.kdl +++ b/mise.usage.kdl @@ -1,1878 +1,989 @@ min_usage_version "1.3" -name "mise" -bin "mise" +name mise +bin mise about "The front-end to your dev env" -long_about r" -mise is a tool for managing runtime versions. https://github.com/jdx/mise - -It's a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc. -that works for any language. It's also great for managing linters/tools like -jq and shellcheck. - -It is inspired by asdf and uses asdf's plugin ecosystem under the hood: -https://asdf-vm.com/" +long_about "\nmise is a tool for managing runtime versions. https://github.com/jdx/mise\n\nIt's a replacement for tools like nvm, nodenv, rbenv, rvm, chruby, pyenv, etc.\nthat works for any language. It's also great for managing linters/tools like\njq and shellcheck.\n\nIt is inspired by asdf and uses asdf's plugin ecosystem under the hood:\nhttps://asdf-vm.com/" usage "Usage: mise [OPTIONS] [TASK] [COMMAND]" -flag "-C --cd" help="Change directory before running command" global=true { - arg "" +flag "-C --cd" help="Change directory before running command" global=#true { + arg } -flag "-c --continue-on-error" help="Continue running tasks even if one fails" hide=true -flag "-n --dry-run" help="Dry run, don't actually do anything" hide=true -flag "-E --env" help="Set the environment for loading `mise..toml`" var=true global=true { - arg "" +flag "-c --continue-on-error" help="Continue running tasks even if one fails" hide=#true +flag "-n --dry-run" help="Dry run, don't actually do anything" hide=#true +flag "-E --env" help="Set the environment for loading `mise..toml`" var=#true global=#true { + arg } -flag "-f --force" help="Force the operation" hide=true -flag "-i --interleave" help="Set the log output verbosity" hide=true -flag "-j --jobs" help="How many jobs to run in parallel [default: 8]" global=true { - arg "" +flag "-f --force" help="Force the operation" hide=#true +flag "-i --interleave" help="Set the log output verbosity" hide=#true +flag "-j --jobs" help="How many jobs to run in parallel [default: 8]" global=#true { + arg } -flag "-p --prefix" hide=true -flag "--output" { - arg "" +flag "-p --prefix" hide=#true +flag --output { + arg } -flag "-P --profile" help="Set the profile (environment)" var=true hide=true global=true { - arg "" +flag "-P --profile" help="Set the profile (environment)" var=#true hide=#true global=#true { + arg } -flag "-s --shell" hide=true { - arg "" +flag "-s --shell" hide=#true { + arg } -flag "-t --tool" help="Tool(s) to run in addition to what is in mise.toml files e.g.: node@20 python@3.10" var=true hide=true { - arg "" +flag "-t --tool" help="Tool(s) to run in addition to what is in mise.toml files e.g.: node@20 python@3.10" var=#true hide=#true { + arg } -flag "--raw" help="Read/write directly to stdin/stdout/stderr instead of by line" global=true -flag "--timings" help="Shows elapsed time after each task completes" hide=true { +flag --raw help="Read/write directly to stdin/stdout/stderr instead of by line" global=#true +flag --timings help="Shows elapsed time after each task completes" hide=#true { long_help "Shows elapsed time after each task completes\n\nDefault to always show with `MISE_TASK_TIMINGS=1`" } -flag "--no-config" help="Do not load any config files" { +flag --no-config help="Do not load any config files" { long_help "Do not load any config files\n\nCan also use `MISE_NO_CONFIG=1`" } -flag "--no-timings" help="Hides elapsed time after each task completes" hide=true { +flag --no-timings help="Hides elapsed time after each task completes" hide=#true { long_help "Hides elapsed time after each task completes\n\nDefault to always hide with `MISE_TASK_TIMINGS=0`" } -flag "-V --version" hide=true -flag "-y --yes" help="Answer yes to all confirmation prompts" global=true -flag "--debug" help="Sets log level to debug" hide=true global=true -flag "--log-level" hide=true global=true { - arg "" { - choices "trace" "debug" "info" "warning" "error" - } -} -flag "-q --quiet" help="Suppress non-error messages" global=true -flag "--silent" help="Suppress all task output and mise non-error messages" global=true -flag "--trace" help="Sets log level to trace" hide=true global=true -flag "-v --verbose" help="Show extra output (use -vv for even more)" var=true global=true count=true -arg "[TASK]" help="Task to run" help_long="Task to run.\n\nShorthand for `mise task run `." required=false -arg "[TASK_ARGS]..." help="Task arguments" required=false var=true hide=true -arg "[-- TASK_ARGS_LAST]..." required=false var=true hide=true -cmd "activate" help="Initializes mise in the current shell session" { - long_help r#"Initializes mise in the current shell session - -This should go into your shell's rc file or login shell. -Otherwise, it will only take effect in the current session. -(e.g. ~/.zshrc, ~/.zprofile, ~/.zshenv, ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.config/fish/config.fish) - -Typically, this can be added with something like the following: - - echo 'eval "$(mise activate zsh)"' >> ~/.zshrc - -However, this requires that "mise" is in your PATH. If it is not, you need to -specify the full path like this: - - echo 'eval "$(/path/to/mise activate zsh)"' >> ~/.zshrc - -Customize status output with `status` settings."# - after_long_help r#"Examples: - - $ eval "$(mise activate bash)" - $ eval "$(mise activate zsh)" - $ mise activate fish | source - $ execx($(mise activate xonsh)) -"# - flag "-s --shell" help="Shell type to generate the script for" hide=true { - arg "" { - choices "bash" "elvish" "fish" "nu" "xonsh" "zsh" "pwsh" +flag "-V --version" hide=#true +flag "-y --yes" help="Answer yes to all confirmation prompts" global=#true +flag --debug help="Sets log level to debug" hide=#true global=#true +flag --log-level hide=#true global=#true { + arg { + choices trace debug info warning error + } +} +flag "-q --quiet" help="Suppress non-error messages" global=#true +flag --silent help="Suppress all task output and mise non-error messages" global=#true +flag --trace help="Sets log level to trace" hide=#true global=#true +flag "-v --verbose" help="Show extra output (use -vv for even more)" var=#true global=#true count=#true +arg "[TASK]" help="Task to run" help_long="Task to run.\n\nShorthand for `mise task run `." required=#false +arg "[TASK_ARGS]..." help="Task arguments" required=#false var=#true hide=#true +arg "[-- TASK_ARGS_LAST]..." required=#false var=#true hide=#true +cmd activate help="Initializes mise in the current shell session" { + long_help "Initializes mise in the current shell session\n\nThis should go into your shell's rc file or login shell.\nOtherwise, it will only take effect in the current session.\n(e.g. ~/.zshrc, ~/.zprofile, ~/.zshenv, ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.config/fish/config.fish)\n\nTypically, this can be added with something like the following:\n\n echo 'eval \"$(mise activate zsh)\"' >> ~/.zshrc\n\nHowever, this requires that \"mise\" is in your PATH. If it is not, you need to\nspecify the full path like this:\n\n echo 'eval \"$(/path/to/mise activate zsh)\"' >> ~/.zshrc\n\nCustomize status output with `status` settings." + after_long_help "Examples:\n\n $ eval \"$(mise activate bash)\"\n $ eval \"$(mise activate zsh)\"\n $ mise activate fish | source\n $ execx($(mise activate xonsh))\n" + flag "-s --shell" help="Shell type to generate the script for" hide=#true { + arg { + choices bash elvish fish nu xonsh zsh pwsh } } - flag "--status" help="Show \"mise: @\" message when changing directories" hide=true - flag "--shims" help="Use shims instead of modifying PATH\nEffectively the same as:" { + flag --status help="Show \"mise: @\" message when changing directories" hide=#true + flag --shims help="Use shims instead of modifying PATH\nEffectively the same as:" { long_help "Use shims instead of modifying PATH\nEffectively the same as:\n\n PATH=\"$HOME/.local/share/mise/shims:$PATH\"\n\n`mise activate --shims` does not support all the features of `mise activate`.\nSee https://mise.jdx.dev/dev-tools/shims.html#shims-vs-path for more information" } flag "-q --quiet" help="Suppress non-error messages" - flag "--no-hook-env" help="Do not automatically call hook-env" { + flag --no-hook-env help="Do not automatically call hook-env" { long_help "Do not automatically call hook-env\n\nThis can be helpful for debugging mise. If you run `eval \"$(mise activate --no-hook-env)\"`, then you can call `mise hook-env` manually which will output the env vars to stdout without actually modifying the environment. That way you can do things like `mise hook-env --trace` to get more information or just see the values that hook-env is outputting." } - arg "[SHELL_TYPE]" help="Shell type to generate the script for" required=false { - choices "bash" "elvish" "fish" "nu" "xonsh" "zsh" "pwsh" + arg "[SHELL_TYPE]" help="Shell type to generate the script for" required=#false { + choices bash elvish fish nu xonsh zsh pwsh } } -cmd "alias" help="Manage aliases" { - alias "a" - alias "aliases" hide=true +cmd alias help="Manage aliases" { + alias a + alias aliases hide=#true flag "-p --plugin" help="filter aliases by plugin" { - arg "" - } - flag "--no-header" help="Don't show table header" - cmd "get" help="Show an alias for a plugin" { - long_help r"Show an alias for a plugin - -This is the contents of an alias. entry in ~/.config/mise/config.toml" - after_long_help r"Examples: - - $ mise alias get node lts-hydrogen - 20.0.0 -" - arg "" help="The plugin to show the alias for" - arg "" help="The alias to show" - } - cmd "ls" help="List aliases\nShows the aliases that can be specified.\nThese can come from user config or from plugins in `bin/list-aliases`." { - alias "list" - long_help r#"List aliases -Shows the aliases that can be specified. -These can come from user config or from plugins in `bin/list-aliases`. - -For user config, aliases are defined like the following in `~/.config/mise/config.toml`: - - [alias.node.versions] - lts = "22.0.0""# - after_long_help r"Examples: - - $ mise aliases - node lts-jod 22 -" - flag "--no-header" help="Don't show table header" - arg "[TOOL]" help="Show aliases for " required=false - } - cmd "set" help="Add/update an alias for a plugin" { - alias "add" "create" - long_help r"Add/update an alias for a plugin - -This modifies the contents of ~/.config/mise/config.toml" - after_long_help r"Examples: - - $ mise alias set node lts-jod 22.0.0 -" - arg "" help="The plugin to set the alias for" - arg "" help="The alias to set" - arg "" help="The value to set the alias to" - } - cmd "unset" help="Clears an alias for a plugin" { - alias "rm" "remove" "delete" "del" - long_help r"Clears an alias for a plugin - -This modifies the contents of ~/.config/mise/config.toml" - after_long_help r"Examples: - - $ mise alias unset node lts-jod -" - arg "" help="The plugin to remove the alias from" - arg "" help="The alias to remove" - } -} -cmd "asdf" hide=true help="[internal] simulates asdf for plugins that call \"asdf\" internally" { - arg "[ARGS]..." help="all arguments" required=false double_dash="automatic" var=true -} -cmd "backends" help="Manage backends" { - alias "b" - alias "backend" "backend-list" hide=true - cmd "ls" help="List built-in backends" { - alias "list" - after_long_help r"Examples: - - $ mise backends ls - aqua - asdf - cargo - core - dotnet - gem - go - npm - pipx - spm - ubi - vfox -" - } -} -cmd "bin-paths" help="List all the active runtime bin paths" { - arg "[TOOL@VERSION]..." help="Tool(s) to look up\ne.g.: ruby@3" required=false var=true -} -cmd "cache" help="Manage the mise cache" { - long_help r"Manage the mise cache - -Run `mise cache` with no args to view the current cache directory." - cmd "clear" help="Deletes all cache files in mise" { - alias "c" - alias "clean" hide=true - flag "--outdate" help="Mark all cache files as old" hide=true - arg "[PLUGIN]..." help="Plugin(s) to clear cache for e.g.: node, python" required=false var=true - } - cmd "prune" help="Removes stale mise cache files" { - alias "p" - long_help r"Removes stale mise cache files - -By default, this command will remove files that have not been accessed in 30 days. -Change this with the MISE_CACHE_PRUNE_AGE environment variable." - flag "--dry-run" help="Just show what would be pruned" - flag "-v --verbose" help="Show pruned files" var=true count=true - arg "[PLUGIN]..." help="Plugin(s) to clear cache for e.g.: node, python" required=false var=true - } -} -cmd "completion" help="Generate shell completions" { - alias "complete" "completions" hide=true - after_long_help r"Examples: - - $ mise completion bash > /etc/bash_completion.d/mise - $ mise completion zsh > /usr/local/share/zsh/site-functions/_mise - $ mise completion fish > ~/.config/fish/completions/mise.fish -" - flag "-s --shell" help="Shell type to generate completions for" hide=true { - arg "" { - choices "bash" "fish" "zsh" + arg + } + flag --no-header help="Don't show table header" + cmd get help="Show an alias for a plugin" { + long_help "Show an alias for a plugin\n\nThis is the contents of an alias. entry in ~/.config/mise/config.toml" + after_long_help "Examples:\n\n $ mise alias get node lts-hydrogen\n 20.0.0\n" + arg help="The plugin to show the alias for" + arg help="The alias to show" + } + cmd ls help="List aliases\nShows the aliases that can be specified.\nThese can come from user config or from plugins in `bin/list-aliases`." { + alias list + long_help "List aliases\nShows the aliases that can be specified.\nThese can come from user config or from plugins in `bin/list-aliases`.\n\nFor user config, aliases are defined like the following in `~/.config/mise/config.toml`:\n\n [alias.node.versions]\n lts = \"22.0.0\"" + after_long_help "Examples:\n\n $ mise aliases\n node lts-jod 22\n" + flag --no-header help="Don't show table header" + arg "[TOOL]" help="Show aliases for " required=#false + } + cmd set help="Add/update an alias for a plugin" { + alias add create + long_help "Add/update an alias for a plugin\n\nThis modifies the contents of ~/.config/mise/config.toml" + after_long_help "Examples:\n\n $ mise alias set node lts-jod 22.0.0\n" + arg help="The plugin to set the alias for" + arg help="The alias to set" + arg help="The value to set the alias to" + } + cmd unset help="Clears an alias for a plugin" { + alias rm remove delete del + long_help "Clears an alias for a plugin\n\nThis modifies the contents of ~/.config/mise/config.toml" + after_long_help "Examples:\n\n $ mise alias unset node lts-jod\n" + arg help="The plugin to remove the alias from" + arg help="The alias to remove" + } +} +cmd asdf hide=#true help="[internal] simulates asdf for plugins that call \"asdf\" internally" { + arg "[ARGS]..." help="all arguments" required=#false double_dash=automatic var=#true +} +cmd backends help="Manage backends" { + alias b + alias backend backend-list hide=#true + cmd ls help="List built-in backends" { + alias list + after_long_help "Examples:\n\n $ mise backends ls\n aqua\n asdf\n cargo\n core\n dotnet\n gem\n go\n npm\n pipx\n spm\n ubi\n vfox\n" + } +} +cmd bin-paths help="List all the active runtime bin paths" { + arg "[TOOL@VERSION]..." help="Tool(s) to look up\ne.g.: ruby@3" required=#false var=#true +} +cmd cache help="Manage the mise cache" { + long_help "Manage the mise cache\n\nRun `mise cache` with no args to view the current cache directory." + cmd clear help="Deletes all cache files in mise" { + alias c + alias clean hide=#true + flag --outdate help="Mark all cache files as old" hide=#true + arg "[PLUGIN]..." help="Plugin(s) to clear cache for e.g.: node, python" required=#false var=#true + } + cmd prune help="Removes stale mise cache files" { + alias p + long_help "Removes stale mise cache files\n\nBy default, this command will remove files that have not been accessed in 30 days.\nChange this with the MISE_CACHE_PRUNE_AGE environment variable." + flag --dry-run help="Just show what would be pruned" + flag "-v --verbose" help="Show pruned files" var=#true count=#true + arg "[PLUGIN]..." help="Plugin(s) to clear cache for e.g.: node, python" required=#false var=#true + } +} +cmd completion help="Generate shell completions" { + alias complete completions hide=#true + after_long_help "Examples:\n\n $ mise completion bash > /etc/bash_completion.d/mise\n $ mise completion zsh > /usr/local/share/zsh/site-functions/_mise\n $ mise completion fish > ~/.config/fish/completions/mise.fish\n" + flag "-s --shell" help="Shell type to generate completions for" hide=#true { + arg { + choices bash fish zsh } } - flag "--usage" help="Always use usage for completions.\nCurrently, usage is the default for fish and bash but not zsh since it has a few quirks\nto work out first." hide=true { + flag --usage help="Always use usage for completions.\nCurrently, usage is the default for fish and bash but not zsh since it has a few quirks\nto work out first." hide=#true { long_help "Always use usage for completions.\nCurrently, usage is the default for fish and bash but not zsh since it has a few quirks\nto work out first.\n\nThis requires the `usage` CLI to be installed.\nhttps://usage.jdx.dev" } - flag "--include-bash-completion-lib" help="Include the bash completion library in the bash completion script" { + flag --include-bash-completion-lib help="Include the bash completion library in the bash completion script" { long_help "Include the bash completion library in the bash completion script\n\nThis is required for completions to work in bash, but it is not included by default\nyou may source it separately or enable this flag to include it in the script." } - arg "[SHELL]" help="Shell type to generate completions for" required=false { - choices "bash" "fish" "zsh" + arg "[SHELL]" help="Shell type to generate completions for" required=#false { + choices bash fish zsh } } -cmd "config" help="Manage config files" { - alias "cfg" - alias "toml" hide=true - flag "--no-header" help="Do not print table header" +cmd config help="Manage config files" { + alias cfg + alias toml hide=#true + flag --no-header help="Do not print table header" flag "-J --json" help="Output in JSON format" - cmd "generate" help="[experimental] Generate a mise.toml file" { - alias "g" - after_long_help r"Examples: - - $ mise cf generate > mise.toml - $ mise cf generate --output=mise.toml -" + cmd generate help="[experimental] Generate a mise.toml file" { + alias g + after_long_help "Examples:\n\n $ mise cf generate > mise.toml\n $ mise cf generate --output=mise.toml\n" flag "-t --tool-versions" help="Path to a .tool-versions file to import tools from" { - arg "" + arg } flag "-o --output" help="Output to file instead of stdout" { - arg "" + arg } } - cmd "get" help="Display the value of a setting in a mise.toml file" { - after_long_help r"Examples: - - $ mise toml get tools.python - 3.12 -" + cmd get help="Display the value of a setting in a mise.toml file" { + after_long_help "Examples:\n\n $ mise toml get tools.python\n 3.12\n" flag "-f --file" help="The path to the mise.toml file to edit" { long_help "The path to the mise.toml file to edit\n\nIf not provided, the nearest mise.toml file will be used" - arg "" + arg } - arg "[KEY]" help="The path of the config to display" required=false + arg "[KEY]" help="The path of the config to display" required=#false } - cmd "ls" help="List config files currently in use" { - alias "list" - after_long_help r"Examples: - - $ mise config ls - Path Tools - ~/.config/mise/config.toml pitchfork - ~/src/mise/mise.toml actionlint, bun, cargo-binstall, cargo:cargo-edit, cargo:cargo-insta -" - flag "--no-header" help="Do not print table header" + cmd ls help="List config files currently in use" { + alias list + after_long_help "Examples:\n\n $ mise config ls\n Path Tools\n ~/.config/mise/config.toml pitchfork\n ~/src/mise/mise.toml actionlint, bun, cargo-binstall, cargo:cargo-edit, cargo:cargo-insta\n" + flag --no-header help="Do not print table header" flag "-J --json" help="Output in JSON format" } - cmd "set" help="Set the value of a setting in a mise.toml file" { - after_long_help r"Examples: - - $ mise config set tools.python 3.12 - $ mise config set settings.always_keep_download true - $ mise config set env.TEST_ENV_VAR ABC - $ mise config set settings.disable_tools --type list node,rust - - # Type for `settings` is inferred - $ mise config set settings.jobs 4 -" + cmd set help="Set the value of a setting in a mise.toml file" { + after_long_help "Examples:\n\n $ mise config set tools.python 3.12\n $ mise config set settings.always_keep_download true\n $ mise config set env.TEST_ENV_VAR ABC\n $ mise config set settings.disable_tools --type list node,rust\n\n # Type for `settings` is inferred\n $ mise config set settings.jobs 4\n" flag "-f --file" help="The path to the mise.toml file to edit" { long_help "The path to the mise.toml file to edit\n\nIf not provided, the nearest mise.toml file will be used" - arg "" + arg } flag "-t --type" { - arg "" { - choices "infer" "string" "integer" "float" "bool" "list" + arg { + choices infer string integer float bool list } } - arg "" help="The path of the config to display" - arg "" help="The value to set the key to" + arg help="The path of the config to display" + arg help="The value to set the key to" } } -cmd "current" hide=true help="Shows current active and installed runtime versions" { - long_help r"Shows current active and installed runtime versions - -This is similar to `mise ls --current`, but this only shows the runtime -and/or version. It's designed to fit into scripts more easily." - after_long_help r"Examples: - - # outputs `.tool-versions` compatible format - $ mise current - python 3.11.0 3.10.0 - shfmt 3.6.0 - shellcheck 0.9.0 - node 20.0.0 - - $ mise current node - 20.0.0 - - # can output multiple versions - $ mise current python - 3.11.0 3.10.0 -" - arg "[PLUGIN]" help="Plugin to show versions of e.g.: ruby, node, cargo:eza, npm:prettier, etc" required=false -} -cmd "deactivate" help="Disable mise for current shell session" { - long_help r"Disable mise for current shell session - -This can be used to temporarily disable mise in a shell session." - after_long_help r"Examples: - - $ mise deactivate -" +cmd current hide=#true help="Shows current active and installed runtime versions" { + long_help "Shows current active and installed runtime versions\n\nThis is similar to `mise ls --current`, but this only shows the runtime\nand/or version. It's designed to fit into scripts more easily." + after_long_help "Examples:\n\n # outputs `.tool-versions` compatible format\n $ mise current\n python 3.11.0 3.10.0\n shfmt 3.6.0\n shellcheck 0.9.0\n node 20.0.0\n\n $ mise current node\n 20.0.0\n\n # can output multiple versions\n $ mise current python\n 3.11.0 3.10.0\n" + arg "[PLUGIN]" help="Plugin to show versions of e.g.: ruby, node, cargo:eza, npm:prettier, etc" required=#false } -cmd "direnv" hide=true help="Output direnv function to use mise inside direnv" { - long_help r"Output direnv function to use mise inside direnv - -See https://mise.jdx.dev/direnv.html for more information - -Because this generates the idiomatic files based on currently installed plugins, -you should run this command after installing new plugins. Otherwise -direnv may not know to update environment variables when idiomatic file versions change." - cmd "envrc" hide=true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume." - cmd "exec" hide=true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume." - cmd "activate" hide=true help="Output direnv function to use mise inside direnv" { - long_help r"Output direnv function to use mise inside direnv - -See https://mise.jdx.dev/direnv.html for more information - -Because this generates the idiomatic files based on currently installed plugins, -you should run this command after installing new plugins. Otherwise -direnv may not know to update environment variables when idiomatic file versions change." - after_long_help r"Examples: - - $ mise direnv activate > ~/.config/direnv/lib/use_mise.sh - $ echo 'use mise' > .envrc - $ direnv allow -" +cmd deactivate help="Disable mise for current shell session" { + long_help "Disable mise for current shell session\n\nThis can be used to temporarily disable mise in a shell session." + after_long_help "Examples:\n\n $ mise deactivate\n" +} +cmd direnv hide=#true help="Output direnv function to use mise inside direnv" { + long_help "Output direnv function to use mise inside direnv\n\nSee https://mise.jdx.dev/direnv.html for more information\n\nBecause this generates the idiomatic files based on currently installed plugins,\nyou should run this command after installing new plugins. Otherwise\ndirenv may not know to update environment variables when idiomatic file versions change." + cmd envrc hide=#true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume." + cmd exec hide=#true help="[internal] This is an internal command that writes an envrc file\nfor direnv to consume." + cmd activate hide=#true help="Output direnv function to use mise inside direnv" { + long_help "Output direnv function to use mise inside direnv\n\nSee https://mise.jdx.dev/direnv.html for more information\n\nBecause this generates the idiomatic files based on currently installed plugins,\nyou should run this command after installing new plugins. Otherwise\ndirenv may not know to update environment variables when idiomatic file versions change." + after_long_help "Examples:\n\n $ mise direnv activate > ~/.config/direnv/lib/use_mise.sh\n $ echo 'use mise' > .envrc\n $ direnv allow\n" } } -cmd "doctor" help="Check mise installation for possible problems" { - alias "dr" - after_long_help r"Examples: - - $ mise doctor - [WARN] plugin node is not installed -" +cmd doctor help="Check mise installation for possible problems" { + alias dr + after_long_help "Examples:\n\n $ mise doctor\n [WARN] plugin node is not installed\n" flag "-J --json" - cmd "path" help="Print the current PATH entries mise is providing" { - alias "paths" hide=true - after_long_help r"Examples: - - Get the current PATH entries mise is providing - $ mise path - /home/user/.local/share/mise/installs/node/24.0.0/bin - /home/user/.local/share/mise/installs/rust/1.90.0/bin - /home/user/.local/share/mise/installs/python/3.10.0/bin -" + cmd path help="Print the current PATH entries mise is providing" { + alias paths hide=#true + after_long_help "Examples:\n\n Get the current PATH entries mise is providing\n $ mise path\n /home/user/.local/share/mise/installs/node/24.0.0/bin\n /home/user/.local/share/mise/installs/rust/1.90.0/bin\n /home/user/.local/share/mise/installs/python/3.10.0/bin\n" flag "-f --full" help="Print all entries including those not provided by mise" } } -cmd "en" help="[experimental] starts a new shell with the mise environment built from the current configuration" { - long_help r"[experimental] starts a new shell with the mise environment built from the current configuration - -This is an alternative to `mise activate` that allows you to explicitly start a mise session. -It will have the tools and environment variables in the configs loaded. -Note that changing directories will not update the mise environment." - after_long_help r#"Examples: - - $ mise en . - $ node -v - v20.0.0 - - Skip loading bashrc: - $ mise en -s "bash --norc" - - Skip loading zshrc: - $ mise en -s "zsh -f" -"# +cmd en help="[experimental] starts a new shell with the mise environment built from the current configuration" { + long_help "[experimental] starts a new shell with the mise environment built from the current configuration\n\nThis is an alternative to `mise activate` that allows you to explicitly start a mise session.\nIt will have the tools and environment variables in the configs loaded.\nNote that changing directories will not update the mise environment." + after_long_help "Examples:\n\n $ mise en .\n $ node -v\n v20.0.0\n\n Skip loading bashrc:\n $ mise en -s \"bash --norc\"\n\n Skip loading zshrc:\n $ mise en -s \"zsh -f\"\n" flag "-s --shell" help="Shell to start" { long_help "Shell to start\n\nDefaults to $SHELL" - arg "" + arg } - arg "[DIR]" help="Directory to start the shell in" required=false default="." + arg "[DIR]" help="Directory to start the shell in" required=#false default=. } -cmd "env" help="Exports env vars to activate mise a single time" { - alias "e" - long_help r"Exports env vars to activate mise a single time - -Use this if you don't want to permanently install mise. It's not necessary to -use this if you have `mise activate` in your shell rc file." - after_long_help r#"Examples: - - $ eval "$(mise env -s bash)" - $ eval "$(mise env -s zsh)" - $ mise env -s fish | source - $ execx($(mise env -s xonsh)) -"# +cmd env help="Exports env vars to activate mise a single time" { + alias e + long_help "Exports env vars to activate mise a single time\n\nUse this if you don't want to permanently install mise. It's not necessary to\nuse this if you have `mise activate` in your shell rc file." + after_long_help "Examples:\n\n $ eval \"$(mise env -s bash)\"\n $ eval \"$(mise env -s zsh)\"\n $ mise env -s fish | source\n $ execx($(mise env -s xonsh))\n" flag "-J --json" help="Output in JSON format" - flag "--json-extended" help="Output in JSON format with additional information (source, tool)" + flag --json-extended help="Output in JSON format with additional information (source, tool)" flag "-D --dotenv" help="Output in dotenv format" flag "-s --shell" help="Shell type to generate environment variables for" { - arg "" { - choices "bash" "elvish" "fish" "nu" "xonsh" "zsh" "pwsh" + arg { + choices bash elvish fish nu xonsh zsh pwsh } } - arg "[TOOL@VERSION]..." help="Tool(s) to use" required=false var=true + arg "[TOOL@VERSION]..." help="Tool(s) to use" required=#false var=#true } -cmd "exec" help="Execute a command with tool(s) set" { - alias "x" - long_help r#"Execute a command with tool(s) set - -use this to avoid modifying the shell session or running ad-hoc commands with mise tools set. - -Tools will be loaded from mise.toml, though they can be overridden with args -Note that only the plugin specified will be overridden, so if a `mise.toml` file -includes "node 20" but you run `mise exec python@3.11`; it will still load node@20. - -The "--" separates runtimes from the commands to pass along to the subprocess."# - after_long_help r#"Examples: - - $ mise exec node@20 -- node ./app.js # launch app.js using node-20.x - $ mise x node@20 -- node ./app.js # shorter alias - - # Specify command as a string: - $ mise exec node@20 python@3.11 --command "node -v && python -V" - - # Run a command in a different directory: - $ mise x -C /path/to/project node@20 -- node ./app.js -"# +cmd exec help="Execute a command with tool(s) set" { + alias x + long_help "Execute a command with tool(s) set\n\nuse this to avoid modifying the shell session or running ad-hoc commands with mise tools set.\n\nTools will be loaded from mise.toml, though they can be overridden with args\nNote that only the plugin specified will be overridden, so if a `mise.toml` file\nincludes \"node 20\" but you run `mise exec python@3.11`; it will still load node@20.\n\nThe \"--\" separates runtimes from the commands to pass along to the subprocess." + after_long_help "Examples:\n\n $ mise exec node@20 -- node ./app.js # launch app.js using node-20.x\n $ mise x node@20 -- node ./app.js # shorter alias\n\n # Specify command as a string:\n $ mise exec node@20 python@3.11 --command \"node -v && python -V\"\n\n # Run a command in a different directory:\n $ mise x -C /path/to/project node@20 -- node ./app.js\n" flag "-c --command" help="Command string to execute" { - arg "" + arg } flag "-j --jobs" help="Number of jobs to run in parallel\n[default: 4]" { - arg "" + arg } - flag "--raw" help="Directly pipe stdin/stdout/stderr from plugin to user Sets --jobs=1" - arg "[TOOL@VERSION]..." help="Tool(s) to start e.g.: node@20 python@3.10" required=false var=true - arg "[-- COMMAND]..." help="Command string to execute (same as --command)" required=false var=true + flag --raw help="Directly pipe stdin/stdout/stderr from plugin to user Sets --jobs=1" + arg "[TOOL@VERSION]..." help="Tool(s) to start e.g.: node@20 python@3.10" required=#false var=#true + arg "[-- COMMAND]..." help="Command string to execute (same as --command)" required=#false var=#true } -cmd "fmt" help="Formats mise.toml" { - long_help r"Formats mise.toml - -Sorts keys and cleans up whitespace in mise.toml" - after_long_help r"Examples: - - $ mise fmt -" +cmd fmt help="Formats mise.toml" { + long_help "Formats mise.toml\n\nSorts keys and cleans up whitespace in mise.toml" + after_long_help "Examples:\n\n $ mise fmt\n" flag "-a --all" help="Format all files from the current directory" } -cmd "generate" subcommand_required=true help="[experimental] Generate files for various tools/services" { - alias "gen" - alias "g" hide=true - cmd "bootstrap" help="[experimental] Generate a script to download+execute mise" { - long_help r"[experimental] Generate a script to download+execute mise - -This is designed to be used in a project where contributors may not have mise installed." - after_long_help r"Examples: - - $ mise generate bootstrap >./bin/mise - $ chmod +x ./bin/mise - $ ./bin/mise install – automatically downloads mise to .mise if not already installed -" +cmd generate subcommand_required=#true help="[experimental] Generate files for various tools/services" { + alias gen + alias g hide=#true + cmd bootstrap help="[experimental] Generate a script to download+execute mise" { + long_help "[experimental] Generate a script to download+execute mise\n\nThis is designed to be used in a project where contributors may not have mise installed." + after_long_help "Examples:\n\n $ mise generate bootstrap >./bin/mise\n $ chmod +x ./bin/mise\n $ ./bin/mise install – automatically downloads mise to .mise if not already installed\n" flag "-l --localize" help="Sandboxes mise internal directories like MISE_DATA_DIR and MISE_CACHE_DIR into a `.mise` directory in the project" { long_help "Sandboxes mise internal directories like MISE_DATA_DIR and MISE_CACHE_DIR into a `.mise` directory in the project\n\nThis is necessary if users may use a different version of mise outside the project." } - flag "--localized-dir" help="Directory to put localized data into" { - arg "" + flag --localized-dir help="Directory to put localized data into" { + arg } flag "-V --version" help="Specify mise version to fetch" { - arg "" + arg } flag "-w --write" help="instead of outputting the script to stdout, write to a file and make it executable" { - arg "" + arg } } - cmd "config" help="[experimental] Generate a mise.toml file" { - alias "g" - after_long_help r"Examples: - - $ mise cf generate > mise.toml - $ mise cf generate --output=mise.toml -" + cmd config help="[experimental] Generate a mise.toml file" { + alias g + after_long_help "Examples:\n\n $ mise cf generate > mise.toml\n $ mise cf generate --output=mise.toml\n" flag "-t --tool-versions" help="Path to a .tool-versions file to import tools from" { - arg "" + arg } flag "-o --output" help="Output to file instead of stdout" { - arg "" + arg } } - cmd "git-pre-commit" help="[experimental] Generate a git pre-commit hook" { - alias "pre-commit" - long_help r"[experimental] Generate a git pre-commit hook - -This command generates a git pre-commit hook that runs a mise task like `mise run pre-commit` -when you commit changes to your repository. - -Staged files are passed to the task as `STAGED`." - after_long_help r#"Examples: - - $ mise generate git-pre-commit --write --task=pre-commit - $ git commit -m "feat: add new feature" # runs `mise run pre-commit` -"# - flag "--hook" help="Which hook to generate (saves to .git/hooks/$hook)" { - arg "" + cmd git-pre-commit help="[experimental] Generate a git pre-commit hook" { + alias pre-commit + long_help "[experimental] Generate a git pre-commit hook\n\nThis command generates a git pre-commit hook that runs a mise task like `mise run pre-commit`\nwhen you commit changes to your repository.\n\nStaged files are passed to the task as `STAGED`." + after_long_help "Examples:\n\n $ mise generate git-pre-commit --write --task=pre-commit\n $ git commit -m \"feat: add new feature\" # runs `mise run pre-commit`\n" + flag --hook help="Which hook to generate (saves to .git/hooks/$hook)" { + arg } flag "-t --task" help="The task to run when the pre-commit hook is triggered" { - arg "" + arg } flag "-w --write" help="write to .git/hooks/pre-commit and make it executable" } - cmd "github-action" help="[experimental] Generate a GitHub Action workflow file" { - long_help r"[experimental] Generate a GitHub Action workflow file - -This command generates a GitHub Action workflow file that runs a mise task like `mise run ci` -when you push changes to your repository." - after_long_help r#"Examples: - - $ mise generate github-action --write --task=ci - $ git commit -m "feat: add new feature" - $ git push # runs `mise run ci` on GitHub -"# - flag "--name" help="the name of the workflow to generate" { - arg "" + cmd github-action help="[experimental] Generate a GitHub Action workflow file" { + long_help "[experimental] Generate a GitHub Action workflow file\n\nThis command generates a GitHub Action workflow file that runs a mise task like `mise run ci`\nwhen you push changes to your repository." + after_long_help "Examples:\n\n $ mise generate github-action --write --task=ci\n $ git commit -m \"feat: add new feature\"\n $ git push # runs `mise run ci` on GitHub\n" + flag --name help="the name of the workflow to generate" { + arg } flag "-t --task" help="The task to run when the workflow is triggered" { - arg "" + arg } flag "-w --write" help="write to .github/workflows/$name.yml" } - cmd "task-docs" help="Generate documentation for tasks in a project" { - after_long_help r"Examples: - - $ mise generate task-docs -" + cmd task-docs help="Generate documentation for tasks in a project" { + after_long_help "Examples:\n\n $ mise generate task-docs\n" flag "-I --index" help="write only an index of tasks, intended for use with `--multi`" flag "-i --inject" help="inserts the documentation into an existing file" { long_help "inserts the documentation into an existing file\n\nThis will look for a special comment, , and replace it with the generated documentation.\nIt will replace everything between the comment and the next comment, so it can be\nrun multiple times on the same file to update the documentation." } flag "-m --multi" help="render each task as a separate document, requires `--output` to be a directory" flag "-o --output" help="writes the generated docs to a file/directory" { - arg "" + arg } flag "-r --root" help="root directory to search for tasks" { - arg "" + arg } flag "-s --style" { - arg "