GUIDEGuide

Automate with the CLI

The CLI separates data on stdout from prompts and messages on stderr, accepts configuration through environment variables, and uses predictable exit codes.

Use stdout for data

bash
$ movitera secrets pull -c myapp-prod > .env
$ CODE=$(movitera totp <credential-id>)

Tables, dotenv, and TOTP codes go to stdout. Hints, errors, prompts, and success messages go to stderr.

Configure with environment variables

VariableUseDefault
MOVITERA_TOKENInline PAT. Overrides the saved token.-
MOVITERA_TEAMDefault team id for the invocation.-
MOVITERA_CONFIG_DIRBase directory for token and config.~/.config

Understand precedence

ValuePrecedence
Team--team > MOVITERA_TEAM > config.json > interactive picker
TokenMOVITERA_TOKEN > system keyring > file fallback
Credential--credential > interactive picker

Exit codes

CodeWhen it happens
0Command completed successfully.
1Local error: missing token, team, credential, invalid usage, or write failure.
2The Movitera API returned a handled error.
nmovitera run propagates the child process exit code on Windows; on macOS/Linux the process is replaced.

Next