mise set
- Usage:
mise set [FLAGS] [ENV_VAR]… - Aliases:
ev,env-vars - Effect: modifies state
- Source code:
src/cli/set.rs
Set environment variables in mise.toml
By default, this command selects the nearest configuration directory and modifies its lowest-precedence TOML file, creating mise.toml here if none exists. If multiple config files exist (e.g., both mise.toml and mise.local.toml), the lowest precedence file (mise.toml) will be used. See https://mise.jdx.dev/configuration.html#target-file-for-write-operations
Use -E <env> to create/modify environment-specific config files like mise.<env>.toml.
Arguments
[ENV_VAR]…— Environment variable(s) to set e.g.: NODE_ENV=production
Flags
-E --env <ENV>— Create/modify an environment-specific config file like .mise.<env>.toml-g --global— Set the environment variable in the global config file--age-encrypt— [experimental] Encrypt the value with age before storing--age-key-file <PATH>— [experimental] Age identity file for encryptionDefaults to ~/.config/mise/age.txt if it exists
--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 path or directory. If a directory is provided, will create/use mise.toml in that directory. Defaults to
MISE_DEFAULT_CONFIG_FILENAMEenvironment variable, ormise.toml. UseMISE_GLOBAL_CONFIG_FILEto choose a different global config path.Aliases:
--path--no-redact— Show raw values instead of redacting secrets--prompt— Prompt for environment variable values--stdin— Read the value from stdin (for multiline input)When using --stdin, provide a single key without a value. The value will be read from stdin until EOF.
-h --help— Print help
Examples
mise set NODE_ENV=productionRead NODE_ENV; example output: production.
mise set NODE_ENVCreate or modify mise.staging.toml.
mise set -E staging NODE_ENV=stagingList keys, values, and source files.
mise setPrompt for PASSWORD with hidden input.
mise set --prompt PASSWORDRead a multiline value from stdin.
cat private.key | mise set --stdin MY_KEYStore a multiline value from a pipeline.
printf "line1\nline2" | mise set --stdin MY_KEYEncrypt the value with age (experimental).
mise set --age-encrypt API_KEY=secretPrompt with hidden input and encrypt with age (experimental).
mise set --age-encrypt --prompt API_KEY