Back to Mise

`mise set`

docs/cli/set.md

2026.9.23.3 KB
Original Source
<!-- @generated by usage-cli from usage spec -->

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 encryption

    Defaults to ~/.config/mise/age.txt if it exists

  • --age-recipient <RECIPIENT> — [experimental] Age recipient (x25519 public key) for encryption

    Can be used multiple times. Requires --age-encrypt.

  • --age-ssh-recipient <PATH_OR_PUBKEY> — [experimental] SSH recipient (public key or path) for age encryption

    Can be used multiple times. Requires --age-encrypt.

  • --file <FILE> — The TOML file to update

    Can be a file path or directory. If a directory is provided, will create/use mise.toml in that directory. Defaults to MISE_DEFAULT_CONFIG_FILENAME environment variable, or mise.toml. Use MISE_GLOBAL_CONFIG_FILE to 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=production

Read NODE_ENV; example output: production.

mise set NODE_ENV

Create or modify mise.staging.toml.

mise set -E staging NODE_ENV=staging

List keys, values, and source files.

mise set

Prompt for PASSWORD with hidden input.

mise set --prompt PASSWORD

Read a multiline value from stdin.

cat private.key | mise set --stdin MY_KEY

Store a multiline value from a pipeline.

printf "line1\nline2" | mise set --stdin MY_KEY

Encrypt the value with age (experimental).

mise set --age-encrypt API_KEY=secret

Prompt with hidden input and encrypt with age (experimental).

mise set --age-encrypt --prompt API_KEY
<!-- generated reference navigation -->