Configure and operate Mise for deterministic developer environments. Use when installing runtime/tool versions, defining reusable tasks, managing layered environment variables, migrating from asdf/nvm/pyenv, or debugging mise.toml behavior in CI and local shells. Keywords: mise, mise.toml, tool versions, tasks, env, asdf migration, setup automation, dev environment.
Overall
score
99%
Does it follow best practices?
Validation for skill structure
Mise manages environment variables through the [env] section in mise.toml, providing automatic loading when entering project directories.
[env]
NODE_ENV = "development"
DEBUG = "true"
API_URL = "http://localhost:3000"
DATABASE_URL = "postgresql://localhost/myapp_dev"[env]
APP_NAME = "My Application"
VERSION = "1.0.0"[env]
PORT = "3000"
MAX_CONNECTIONS = "100"
TIMEOUT_MS = "30000"[env]
ENABLE_CACHE = "true"
DEBUG_MODE = "false"
PRODUCTION = "false"[env]
PRIVATE_KEY = """
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA...
-----END RSA PRIVATE KEY-----
"""Use template syntax to reference other variables and built-in values:
[env]
PROJECT_ROOT = "{{ config_root }}"
DATA_DIR = "{{ config_root }}/data"
LOG_FILE = "{{ config_root }}/logs/app.log"{{ config_root }}: Directory containing mise.toml{{ cwd }}: Current working directory[env]
API_URL = "http://localhost:3000"
WEB_URL = "http://localhost:8080"
CALLBACK_URL = "{{ env.API_URL }}/callback"[env]
_.path = [
"{{ config_root }}/bin",
"{{ config_root }}/scripts",
"{{ config_root }}/node_modules/.bin"
]Paths are prepended in the order listed:
[env]
_.path = [
"./bin", # Highest priority
"./scripts",
"$HOME/.local/bin" # Lowest priority
][env]
_.file = ".env"[env]
_.file = [
".env",
".env.local",
".env.{{ env.NODE_ENV }}"
]Files are loaded in order; later files override earlier ones.
# .env.development
DATABASE_URL=postgresql://localhost/myapp_dev
DEBUG=true
# .env.production
DATABASE_URL=postgresql://prod-server/myapp
DEBUG=false[env]
NODE_ENV = "development"
_.file = ".env.{{ env.NODE_ENV }}"[tools]
python = "3.11"
[env]
VIRTUAL_ENV = "{{ config_root }}/.venv"
_.path = ["{{ config_root }}/.venv/bin"][tools]
node = "20"
[env]
NODE_ENV = "development"
NODE_OPTIONS = "--max-old-space-size=4096"
_.path = ["{{ config_root }}/node_modules/.bin"][tools]
go = "1.21"
[env]
GOPATH = "{{ config_root }}/.go"
GOBIN = "{{ config_root }}/.go/bin"
_.path = ["{{ config_root }}/.go/bin"][tools]
rust = "stable"
[env]
CARGO_HOME = "{{ config_root }}/.cargo"
RUSTUP_HOME = "{{ config_root }}/.rustup"
_.path = ["{{ config_root }}/.cargo/bin"]# mise.toml
[env]
PROJECT_NAME = "my-app"
API_URL = "http://localhost:3000"# ~/.config/mise/config.toml
[env]
EDITOR = "code"
BROWSER = "firefox"# mise.local.toml (git-ignored)
[env]
DATABASE_URL = "postgresql://localhost/myapp_johndoe"
DEBUG = "true"Priority: mise.local.toml > mise.toml > global config
# mise.toml (committed)
[env]
NODE_ENV = "development"
_.file = [".env", ".env.local"]
# .env (committed)
API_URL=http://localhost:3000
PORT=3000
# .env.local (git-ignored)
API_SECRET=super-secret-key
DATABASE_PASSWORD=secret123.env.local
mise.local.toml
*.secretAutomatically set by Mise:
MISE_CONFIG_ROOT: Directory containing mise.tomlMISE_PROJECT_ROOT: Project root directoryMISE_DATA_DIR: Mise data directory (~/.local/share/mise)MISE_CACHE_DIR: Mise cache directoryMISE_INSTALL_PATH: Installation path for tools[env]
APP_ROOT = "{{ env.MISE_PROJECT_ROOT }}"
CACHE_DIR = "{{ env.MISE_CACHE_DIR }}/my-app"[env]
DB_HOST = "localhost"
DB_PORT = "5432"
DB_NAME = "myapp_dev"
DB_USER = "postgres"
DATABASE_URL = "postgresql://{{ env.DB_USER }}@{{ env.DB_HOST }}:{{ env.DB_PORT }}/{{ env.DB_NAME }}"[env]
API_HOST = "localhost"
API_PORT = "3000"
API_PROTOCOL = "http"
API_URL = "{{ env.API_PROTOCOL }}://{{ env.API_HOST }}:{{ env.API_PORT }}"[env]
FEATURE_NEW_UI = "true"
FEATURE_BETA_API = "false"
FEATURE_ANALYTICS = "true"DATABASE_URL not DB_URL{{ config_root }} for paths.env.development, .env.production.env.example, ignore .env.local[env]
API_SECRET = "my-secret-key-123" # DON'T DO THIS# mise.toml
[env]
_.file = [".env", ".env.local"]
# .env.local (git-ignored)
API_SECRET=my-secret-key-123[env]
DATA_DIR = "/Users/john/projects/myapp/data"[env]
DATA_DIR = "{{ config_root }}/data"# In every project's mise.toml
[env]
EDITOR = "code"
BROWSER = "firefox"# ~/.config/mise/config.toml
[env]
EDITOR = "code"
BROWSER = "firefox"