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
| Variable | Use | Default |
|---|---|---|
| MOVITERA_TOKEN | Inline PAT. Overrides the saved token. | - |
| MOVITERA_TEAM | Default team id for the invocation. | - |
| MOVITERA_CONFIG_DIR | Base directory for token and config. | ~/.config |
Understand precedence
| Value | Precedence |
|---|---|
| Team | --team > MOVITERA_TEAM > config.json > interactive picker |
| Token | MOVITERA_TOKEN > system keyring > file fallback |
| Credential | --credential > interactive picker |
Exit codes
| Code | When it happens |
|---|---|
| 0 | Command completed successfully. |
| 1 | Local error: missing token, team, credential, invalid usage, or write failure. |
| 2 | The Movitera API returned a handled error. |
| n | movitera run propagates the child process exit code on Windows; on macOS/Linux the process is replaced. |