mise set
- Usage:
mise set [FLAGS] [ENV_VAR]… - Aliases:
ev,env-vars - Effect: modifies state
- Source code:
src/cli/set.rs
Set, show, or list environment variables in mise.toml
mise set KEY=VALUE writes to the lowest-precedence TOML file in the nearest config directory (mise.toml rather than mise.local.toml), creating mise.toml in the current directory if there is none. Run in your home directory, it writes to the global config. mise set KEY prints one value, and mise set lists every variable with its source file. Use --global, --file, or -E <env> to write elsewhere. See https://mise.jdx.dev/configuration.html#target-file-for-write-operations
Arguments
[ENV_VAR]…— Environment variables to set, such as NODE_ENV=production
Flags
-E --env <ENV>— Write to mise.<ENV>.toml in the current directory, or to .mise.<ENV>.toml if that exists-g --global— Set the environment variable in the global config file--override— Set the environment variable in the global override file,config.override.tomlThe override file outranks all project config. With
--env, writesconfig.<ENV>.override.tomlinstead. See https://mise.jdx.dev/configuration.html#override-file--age-encrypt— [experimental] Encrypt the value with age before storing--age-key-file <PATH>— [experimental] Age identity file whose public keys to encrypt toWithout --age-recipient, --age-ssh-recipient, or --age-key-file, mise encrypts to the identities in the
age.key_filesetting (or ~/.config/mise/age.txt if it exists) and to ~/.ssh/id_ed25519 and ~/.ssh/id_rsa when they exist.--age-recipient <RECIPIENT>— [experimental] Age recipient (x25519 public key) for encryptionCan be used multiple times. Requires --age-encrypt.
--age-ssh-recipient <PATH_OR_PUBKEY>— [experimental] SSH recipient (public key or path) for age encryptionCan be used multiple times. Requires --age-encrypt.
--file <FILE>— The TOML file to updateCan be a file or a directory. For a directory, mise uses the config file already in it, or creates one named by MISE_DEFAULT_CONFIG_FILENAME (default
mise.toml): https://mise.jdx.dev/configuration/settings.html#default_config_filename To move the global config file, set MISE_GLOBAL_CONFIG_FILE: https://mise.jdx.dev/configuration/settings.html#global_config_fileAliases:
--path--no-redact— Show raw values instead of redacting secrets--prompt— Prompt for environment variable values (input is masked only with --age-encrypt)--stdin— Read the value from stdin, for multiline inputPass a single key without a value; the value is read from stdin until EOF.
-h --help— Print help
Examples
Set NODE_ENV in mise.toml
mise set NODE_ENV=productionShow one variable's value
mise set NODE_ENV
productionList variables, their values, and their source files
mise setWrite the variable to mise.staging.toml
mise set -E staging NODE_ENV=stagingPrompt for the value; input is visible unless you add --age-encrypt
mise set --prompt PASSWORDRead a multiline value from stdin
cat private.key | mise set --stdin MY_KEYPrompt with hidden input and store the value encrypted with age (experimental)
mise set --age-encrypt --prompt API_KEY