Per-configuration environment with mise
Give one configuration its own environment: an AWS profile, a kubeconfig path, a pinned tool, a
Python virtualenv. With mise installed where the engine runs, each round’s
providers launch with what mise env adds in the configuration directory, as terraform would in a
shell with mise active there.
How it works
Section titled “How it works”- mise on the engine’s host. The engine uses the mise on its own
PATH.turf-mcp-server engine statusshows which one, oroff. - Applied over the engine’s environment and the variables the server sent. The configuration’s mise environment is laid over the engine’s own and the variables the server sends by name, for that configuration’s providers only. mise itself is evaluated over the engine’s environment alone, so a mise template cannot read a variable the server sent. Provider arguments in HCL still override all of it.
mise.tomlis committed. Tool versions, a Python venv, an[env]table: what every machine needs to plan this configuration.mise.local.tomlis per machine. Keep it out of git. It is the place for this configuration’s credential settings on this machine.- Settings, not secrets. An
AWS_PROFILEor aKUBECONFIGpath that is this configuration’s own belongs here. One that is yours across configurations goes in your agent’s entry for Turf: see Send a variable to providers. A secret’s value belongs in the profile or credential store it names, not in a committed file. - Trust first. A directory you have not run
mise truston fails the plan in mise’s words. - The engine installs nothing. A tool
mise installhas not installed is missing, and the provider says so. Setup is yours. - Providers only. mise never supplies variables, the state backend or state encryption: the MCP server reads those, not the engine.
To turn it off, set TURF_MISE=off in the engine’s environment, then restart the engine.
- An engine the server started: put it in the
envof Turf’s entry in each agent that has one, reconnect the agent, then runturf-mcp-server engine stop(npx -y @turfbuild/turf-mcp-server engine stopwith the npx install). The next call starts the engine with mise off. - The
turfservice: put it in~/.homebrew/services/turf.env, thenbrew services restart turf.
A worked example
Section titled “A worked example”A configuration that deploys to a staging account and runs a Python smoke test after each release. The account and the cluster differ per machine; the Python version and the venv do not.
infra/staging/ main.tf smoke.tf scripts/smoke.py requirements.txt mise.toml committed mise.local.toml this machine only, not in gitThe committed file pins Python and keeps a venv in .venv, which mise puts on PATH:
[tools]python = "3.13"
[env]_.python.venv = { path = ".venv", create = true }The local file names this machine’s account and cluster:
[env]AWS_PROFILE = "staging-admin"KUBECONFIG = "/Users/you/.kube/staging.yaml"The smoke test is a provider action, local_command from the local provider. It runs in the
engine with this directory’s mise environment, so python is the venv’s and the script sees
AWS_PROFILE and KUBECONFIG. The aws provider reads the same AWS_PROFILE. main.tf requires
hashicorp/local beside hashicorp/aws.
# Runs scripts/smoke.py after every release, in the engine, with the# directory's mise environment (the venv's python, mise.local.toml's [env]).action "local_command" "smoke" { config { command = "python" arguments = ["scripts/smoke.py"] }}
resource "terraform_data" "release" { input = var.release lifecycle { action_trigger { events = [after_create, after_update] actions = [action.local_command.smoke] } }}scripts/smoke.py resolves from the configuration directory, the provider’s working directory.
Set the directory up once, on the engine’s host:
cd infra/stagingmise trust # or the plan fails in mise's wordsmise install # the tools mise.toml pinsmise exec -- pip install -r requirements.txt # the script's packages, into the venvThen ask your agent to deploy it as usual. Change mise.local.toml on another machine to point the
same configuration at another account.
Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.
© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub