Skip to content

mise

mise (mise-en-place) is a polyglot tool manager, environment manager, and task runner. You can use it to install the varlock CLI itself, and to wire varlock into the commands you run during development.

mise can install and version-manage the varlock CLI alongside the rest of your toolchain.

The github backend installs varlock’s prebuilt, self-contained binary directly from our GitHub releases. It needs no runtime (no Node or Bun) and mise verifies the download’s checksum and build attestations automatically.

mise.toml
[tools]
"github:dmno-dev/varlock" = "latest"
Terminal window
mise install
varlock --version

Or try it without a config file:

Terminal window
mise exec github:dmno-dev/varlock@latest -- varlock --version

mise tasks are a great place to run your project’s commands. Whether you need to mention varlock in the task depends on whether the command already loads it.

When varlock is already wired into the command

Section titled “When varlock is already wired into the command”

Often it is. A package.json script may already call varlock run, or your app may use a framework/runtime integration (Next.js, Vite, Astro, Node, etc.) that loads and validates env on startup. In that case the mise task just runs the command as-is — nothing varlock-specific belongs here:

mise.toml
[tasks.dev]
run = "npm run dev" # e.g. "dev": "varlock run -- next dev", or the app uses an integration
Terminal window
mise run dev

When the command doesn’t load varlock on its own

Section titled “When the command doesn’t load varlock on its own”

For a raw binary, a shell script, or a one-off command that isn’t already varlock-aware, wrap it with varlock run so it gets a resolved, validated environment with redacted output — scoped to that one subprocess, never your shell:

mise.toml
[tools]
"github:dmno-dev/varlock" = "latest" # makes `varlock` available to the task
[tasks.migrate]
run = "varlock run -- ./scripts/migrate.sh"
[tasks.psql]
run = "varlock run -- psql"

Declaring varlock in [tools] lets mise install it and put it on PATH before the task runs. If varlock is instead a dependency of your JS project, call the project-local version through your package manager and drop it from [tools] — e.g. run = "npx varlock run -- ./scripts/migrate.sh" or run = "bun run varlock run -- ./scripts/migrate.sh".

Loading env vars into your shell (advanced)

Section titled “Loading env vars into your shell (advanced)”

Sometimes you genuinely want a value available to any command you type in the terminal — typically non-secret config like NODE_ENV or a public base URL. You can do this without a plugin using mise’s env._.source, which captures variables exported by a script.

Create a small script that emits varlock’s resolved env in shell format:

.mise/load-env.sh
varlock load --format shell --compact

Then source it from your config:

mise.toml
[env]
_.source = "./.mise/load-env.sh"

varlock load --format shell outputs export KEY='value' lines; --compact skips undefined optional values.

If you just want a fast failure when a project’s environment is missing or invalid — without injecting anything into your shell — use a hook instead of [env]:

mise.toml
[hooks]
enter = "varlock load > /dev/null"

varlock load exits non-zero on a validation error, so you’ll see the problem as soon as you cd in. Run varlock load directly to see the full colorized error output.