mise-en-place Snippets
# Install mise and bash shell integrationcurl https://mise.run/bash | sh# Installs mise and adds activation to ~/.bashrcDev Tools, Runtimes
Section titled “Dev Tools, Runtimes”# Install and use a tool in current path with mise use program_name and specific versionmise use node@24## will install the latest version of node-24 and## create/update the mise.toml config file in the local directory## Anytime you're in that directory, that version of node will be used
# List installsmise lsmise list
# Install lazyvim distribution requirements (assume curl and git are aleady installed) and run itmise use neovim lazygit tree-sitter fzf ripgrep fdmise activatenvim
# Install a tool from GitHubmise use github:hashicorp/vagrant
# Install a tool globally (-g)mise use -g github:nickgerace/gfold
# mise x or exec can be used for one-off commands using specific toolsmise x python@3.12 -- ./myscript.py## if you want to run a script with python3.12
# Install a tool and run one command with the toolmise use dotnet@8mise x -- dotnet --version
# Generate the lockfilemise lock
# Install tools using locked versionsmise install
# Update tools and lockfilemise upgrademise.toml
Section titled “mise.toml”Regular and other backends like pipx, cargo, and go
[tools]terraform = "1.9"terramate = "0.9"pre-commit = "3"awscli = "2"github:nickgerace/gfold"pipx:detect-secrets" = "1.4""cargo:eza" = "latest""go:github.com/containerscrew/tftools" = "0.9.0"Environments
Section titled “Environments”# Set environment variablesmise set NODE_ENV=development
# Unset environment variablesmise unset NODE_ENV
# Run command with environment variablesmise exec -- echo $NODE_ENV
# Show environment variablesmise env
# Show only redacted environment variablesmise env --redactedmise.toml
Section titled “mise.toml”Set environment variables, whether they are required and run tasks with them
Redact environment variables with redact = true
[env]NODE_ENV = 'production'SECRET = { value = "my_secret", redact = true }_.file = { path = ".env.json", redact = true }
---
redactions = ["SECRET_*", "*_TOKEN", "PASSWORD"][env]SECRET_KEY = "sensitive_value"API_TOKEN = "token_123"PASSWORD = "my_password"
---
API_KEY = { required = true }DATABASE_URL = { required = "Set DATABASE_URL to your PostgreSQL connection string (e.g., postgres://user:pass@localhost/dbname)",}
[tasks.print]run = "echo $MY_VAR"env = { _.file = '/path/to/file.env', "MY_VAR" = "my variable" }# Run a tasks from selection listmise run
# Run a task when the source changesmise watch build
# Extra arguments will be passed to the task, for example, if we want to run in release modemise run build --release
# Job controlmise run --jobs 8 test # Use 8 parallel jobsmise run -j 1 test # Force sequential execution
# List tasksmise tasks ls
# Clear remote tasks cachemise cache clearmise.toml
Section titled “mise.toml”Set or reference files for tasks.
[tasks.build]description = "Build the CLI"alias = 'b'run = "cargo build"[tasks."lint:eslint"] # using a ":" means we need to add quotesrun = "eslint ."[tasks."lint:prettier"]run = "prettier --check ."[tasks.lint]depends = ["lint:*"]wait_for = ["render"] # does not add as a dependency, but if it is already running, wait for it to finish
[tasks.python_task]run = '''#!/usr/bin/env pythonfor i in range(10): print(i)'''
[tasks."tf.apply"]alias = "tfa"description = "`terraform apply` with pre-generated plan file (terraform plan should be generated in advance)"run = """#!/usr/bin/env bash
cmd="terraform apply tfplan $@"read -p "$cmd\n\nAre you sure? (Y/n) " choice[ "$choice" = "n" ] || ($cmd; tput bel)"""
# Specific shell to run in[tasks.lintb]shell = 'bash -c'run = "cargo clippy"
# Set dependencies of tasks with =depends=[tasks.run]depends = ['build']
[tasks.azlogin]run = [ 'az config set core.login_experience_v2=off', 'az login', 'az account set --subscription "$TF_VAR_subscription_id"',]
# Specify an alternate command to run on Windows by using the =run_windows key=[tasks.test]run = 'cargo test'run_windows = 'cargo test --features windows'
# Set directory with =dir=# MISE_ORIGINAL_CWD is set to the original working directory and will be passed to the task[tasks.test-in-dir]run = 'cargo test'dir = "{{cwd}}"
# Specify a file to run as a task[tasks.release]description = 'Cut a new release'file = 'scripts/release.sh' # execute an external script
# Remote tasks[tasks.build]file = "https://example.com/build.sh"-
mise-tasks/plan
Make sure
planfile is executable withchmod +x planand run withmise run planTerminal window #MISE description="Login to Azure, Format and Validate Terraform files and Plan"# Login to Azureaz loginaz account set --subscription "$(ARM_SUBSCRIPTION_ID)"# Format and validate Terraform filesterraform fmtterraform validate## Plan Terraform deployment and output planterraform plan -out=tfplan