enveigh docs

CLI reference

Every enveigh command: run programs with secrets injected, render .env files, manage environments, and start task sessions.

The enveigh CLI does not open the vault. It asks the running, unlocked app over a local broker socket. Only the app touches the Keychain, so one approval policy and one audit log cover every tool.

Install

The app installs the CLI for you. Open Settings > Agents > Install the enveigh CLI, or use the onboarding step. It links enveigh into /usr/local/bin or ~/.local/bin.

On the Mac, run enveigh with no arguments to print usage. On Linux in a terminal, it opens the terminal UI instead.

If a command prints one of these messages, the broker is not reachable:

SystemMessageFix
MacOpen the enveigh app and unlock it, then retry.Open the app and unlock it.
LinuxEnveigh service is not running. Start enveigh serve, then retry.Run enveigh serve, or run plain enveigh.

An unknown command prints unknown command 'name'. Try: list, secrets, env, render, get, run, import, new, rm, add.

Commands at a glance

CommandWhat it does
enveigh listList environments.
enveigh secretsList secret names.
enveigh run --env <environment> -- <command...>Run a command with the environment injected.
enveigh env <environment>Print the rendered .env.
enveigh render <environment> --out <path> [--force]Write the rendered .env to a file.
enveigh get <secret>Print one value.
enveigh import <directory>Vault the keys in a project's .env files.
enveigh new, enveigh add, enveigh rmCreate an environment, add a secret to it, delete it.
enveigh capture [name] --env <environment>Vault the key on the clipboard; --check only reports what is there.
enveigh session start|list|endManage task sessions.
enveigh tuiOpen the terminal UI.
enveigh mcpStart the MCP server on standard input and output.
enveigh setup, serve, unlock, lockLinux service commands.

Read commands

enveigh list

Lists your environments, one per line.

$ enveigh list
api · staging
api · production
web

enveigh secrets

Lists secret names only. It never prints values.

$ enveigh secrets
ANTHROPIC_API_KEY
DATABASE_URL
STRIPE_SECRET_KEY

Commands that return values

enveigh run --env <environment> -- <command...>

Runs a command with the environment's secrets set as environment variables. The values exist only inside the child process. enveigh does not echo them, write them to disk, or put them in your shell history.

enveigh run --env web -- npm test
enveigh run --env web -- npm run dev        # dev servers work: output streams until you stop it
enveigh run --env "api · production" -- ./migrate.sh
  • Everything after -- is the command, unchanged.
  • Output streams live. enveigh does not buffer or redact it in your terminal. This is the right path for dev servers and watch tasks. See Builds & dev servers.
  • enveigh removes credential-shaped variables from your shell before it injects the vault's values, so a stray export OPENAI_API_KEY=… in your profile cannot ride along. SSH_AUTH_SOCK is kept so ssh-agent and git over SSH keep working.
  • The child's exit code becomes the exit code of enveigh run.
  • The command fails if the environment has missing values. The message names them.
  • Add --session <id> to use a task session.

enveigh env <environment>

Prints the rendered .env, with real values, to standard output. Prefer run, because a rendered file is plaintext again.

enveigh env web > .env.local        # only if a tool needs the file

enveigh render <environment> --out <path> [--force]

Writes the rendered .env to a file with owner-only permissions. It refuses a path inside a Git repository unless Git ignores the path. --force overrides that check and replaces an existing file.

enveigh render web --out .env.local

enveigh get <secret>

Prints one secret's value.

DATABASE_URL=$(enveigh get DATABASE_URL) some-tool …

Commands that change the vault

The app asks you to confirm each of these.

enveigh import <directory>

Scans the folder's .env files inside the app and vaults the credential-shaped keys into that folder's environment. Only key names print. Keys that are already vaulted are skipped, so enveigh import . after you edit a .env adds only the new ones.

enveigh import .

enveigh new, enveigh add, enveigh rm

enveigh new web --dir ~/code/web                # create an empty environment
enveigh add STRIPE_SECRET_KEY --env web         # add an existing secret to it
enveigh rm web                                  # delete the environment, keep its secrets

enveigh capture

The key you just copied goes straight from the clipboard into the vault. The app reads the clipboard, asks you once with a masked preview, and the value never appears in the terminal or its history.

enveigh capture --check                         # what is on the clipboard: kind, suggested name, sk-l…
enveigh capture STRIPE_SECRET_KEY --env web     # save it under that name, bound into web
enveigh capture --env web                       # same, using the suggested name

enveigh session

A task session lets a long build or agent run need one approval instead of many.

enveigh session start --env web --hours 12
enveigh session list
enveigh session end <id>
enveigh run --env web --session <id> -- npm run build

--hours takes a number from 1 to 24. The default is 12 on the Mac. A session ends when it expires, when you end it, or when the vault locks.

Approval prompts

env, render, get, and run return values, so they follow the approval policy in Settings > General > Agent approval:

PolicyWhat happens on a CLI request
Touch ID per requestA prompt every time.
Touch ID once per environment (default)One prompt per environment per session.
Unlocked = allowed (least strict)No prompt while the app is unlocked.

The policy is sealed inside the vault. A program running as you cannot change it. Choosing a policy that asks less often needs Touch ID or your Mac password. If the saved policy is missing or damaged, enveigh asks on every request. After you restore a backup, agents ask on every request until you choose a policy again.

The prompt names the requesting process chain, for example enveigh ← zsh ← Terminal. The kernel reports this chain, so a process cannot claim to be another. enveigh writes every value access to the Audit log before it releases the value.

Linux commands

On Linux, plain enveigh does setup, starts the service, and unlocks. These commands do the steps one at a time:

CommandWhat it does
enveigh setup [fingerprint]Choose the GPG key for enveigh's password store.
enveigh serveRun the service in the foreground.
enveigh unlockUnlock your GPG key in pinentry. enveigh never receives the passphrase.
enveigh lockLock the vault. This ends all task sessions and pending approvals.

Commands that already received values keep them after a lock. On the Mac, setup, serve, unlock, and lock tell you to use the desktop app.

Exit codes and scripting

  • 0 means success. run passes on the child's exit code.
  • Errors print to standard error and exit with 1, so set -e scripts stop.
  • list and secrets print plain lines that work with grep and xargs.
enveigh run --env production -- sh -c 'npm run build && npm run deploy'

On this page