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.
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.
# 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.
apivault --timeout 600 login
Help
-h, --help lists the commands, or the subcommands and options of the command it follows.
apivault --help apivault keys --help apivault keys add --help
Version
-V, --version prints the installed version.
apivault --version
Environment variables
| Variable | Effect |
|---|---|
APIVAULT_TOKEN | Authenticate as a service token instead of the signed-in device. See CI/CD & service tokens. |
APIVAULT_PROJECT | Project to use, ahead of the directory's link |
APIVAULT_KEY | Custom vault key for projects in custom encryption mode |
NO_COLOR | Any value turns colored output off |
FORCE_COLOR=0 | Turns 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/:
| File | Purpose |
|---|---|
token.json | Auth token from login (removed by logout) |
config.json | Global 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
| Code | Meaning |
|---|---|
0 | The command succeeded |
1 | The command failed — an API or network error, a missing value, or an unknown command |
| The child's code | apivault run exits with the code of the command it ran |
128 + signal | apivault run was stopped by a signal, e.g. 130 for Ctrl+C |