Arkveil
CLI

Configuration

Config file, environment variables, exit codes, and networking behavior for the Arkveil CLI.

Settings are resolved with this precedence: flags > environment variables > config file > defaults.

Config file

Location: ~/.config/arkveil/config.json (or $XDG_CONFIG_HOME/arkveil/config.json, or the directory passed via --config-dir). Unknown keys are rejected.

{
  "baseUrl": "https://arkveil.example.com",
  "authBaseUrl": "https://auth.example.com/api/auth",
  "clientId": "arkveil-cli",
  "workspaceId": "00000000-0000-0000-0000-000000000000",
  "deviceCodePath": "/device/code",
  "deviceTokenPath": "/device/token",
  "timeoutMs": 30000,
  "retries": 2
}

Environment variables

VariablePurposeDefault
ARKVEIL_BASE_URLAPI base URLhttps://api.arkveil.com
ARKVEIL_AUTH_BASE_URLAuth service mount point<base-url>/api/auth
ARKVEIL_CLIENT_IDOAuth device-flow client idarkveil-cli
ARKVEIL_SCOPEOptional OAuth scopeunset
ARKVEIL_TOKENBearer token overrideunset
ARKVEIL_WORKSPACE_IDWorkspace idunset
ARKVEIL_TIMEOUTRequest timeout (ms)30000
ARKVEIL_RETRIESRetry attempts2
ARKVEIL_CONFIG_DIRConfig/credentials directory~/.config/arkveil
NO_COLORDisable color outputunset

Networking

  • Every request is bounded by the configured timeout.
  • Idempotent requests (GET, PUT, DELETE) are retried with exponential backoff on 429, 502, 503, 504, and network errors, honoring Retry-After when present.
  • POST and PATCH requests are never retried.
  • Every request carries an x-request-id, visible with --verbose.
  • List commands are not paginated — they return the complete collection.

Exit codes

CodeMeaning
0Success
1Generic/unexpected error
2Usage error
3Auth required or rejected
4Not found (404)
5Network failure or timeout
6API error response
7Invalid local config
8Test run failed (assertion mismatch)
9Test run errored (couldn't run at all)
130Cancelled at an interactive prompt

8 and 9 are designed as CI gates for arkveil tests run / run-all; when a batch contains both failures and errors, 9 takes precedence. Errors print a one-line message plus an actionable hint — never a raw stack trace; pass --verbose to see the underlying cause.

JSON output for scripting

Any command accepts --json to emit the raw API payload (or a small status object for delete/login) as JSON on stdout, with spinners, color, and status text suppressed:

arkveil tags list --json | jq '.[].slug'
arkveil eval explain -a orders:read --user '{"role":"admin"}' --json | jq .granted

In --json mode, errors go to stderr as a structured object, and the process exit code still reflects the failure category:

{ "error": { "message": "...", "hint": "...", "exitCode": 6 } }

Destructive commands (delete, admin reset-demo) always prompt for confirmation interactively, and refuse to run non-interactively unless --yes is passed — this applies even with --json.

JSON payload flags

Flags that accept a JSON payload (--data, --request-schema, --projection, --fixtures, --spec, and similar) accept three forms:

--data '{"a":1}'        # inline JSON
--data @payload.json     # from a file
--data -                 # from stdin
echo '{"a":1}' | arkveil schemas set user --data -

On this page