Global options

These options work with every apivault command. Put them before the command name, as in apivault --json keys list.

Project

-p, --project <id> runs a single command against another project, ahead of the directory's link. It accepts a project ID or slug. The APIVAULT_PROJECT environment variable does the same for every command in a shell. See project linking for the full order.

ProjectShell
apivault --project my-other-app keys list
APIVAULT_PROJECT=my-other-app apivault keys list

JSON output

--json prints machine-readable JSON to stdout instead of styled text, for scripts, pipelines and tools like jq. Success messages and formatting are switched off, and errors are printed to stdout too, as an object with an error key — for example {"error": "message"} — so a script can always parse what it gets back. In the interactive shell on these docs, formatted JSON output has a copy button for copying the payload to your clipboard.

JSON outputJSON
# Extract just the IDs of all keys
apivault --json keys list | jq '.[] | .id'

# Decrypt a specific key and output raw text
apivault --json keys get <id> --reveal | jq -r .rawKey

# Export an environment programmatically
apivault --json env export --env Production

Timeout

--timeout <seconds> sets how long apivault login waits for you to approve the connection in your browser. The default is 300.

TimeoutShell
apivault --timeout 600 login

Help

-h, --help lists the commands, or the subcommands and options of the command it follows.

HelpShell
apivault --help
apivault keys --help
apivault keys add --help

Version

-V, --version prints the installed version.

VersionShell
apivault --version

Environment variables

VariableEffect
APIVAULT_TOKENAuthenticate as a service token instead of the signed-in device. See CI/CD & service tokens.
APIVAULT_PROJECTProject to use, ahead of the directory's link
APIVAULT_KEYCustom vault key for projects in custom encryption mode
NO_COLORAny value turns colored output off
FORCE_COLOR=0Turns colored output off

Color is also off whenever output is not a terminal, such as when it is piped to another command or written to a file.

Local files

The CLI keeps its own data in ~/.apivault/:

FilePurpose
token.jsonAuth token from login (removed by logout)
config.jsonGlobal defaults for run, the fallback project, and an optional stored vault key

A linked directory also has its own .apivault.json — see the local project file.

Exit codes

CodeMeaning
0The command succeeded
1The command failed — an API or network error, a missing value, or an unknown command
The child's codeapivault run exits with the code of the command it ran
128 + signalapivault run was stopped by a signal, e.g. 130 for Ctrl+C