Scripts and agents

Exit codes and JSON output for running the Volcano CLI from scripts, CI, and coding agents.

Exit codes

Every command exits with one of these codes, so a script or agent can tell failures apart without parsing the error text.

CodeMeaningWhat to do
0Success
1Any other failureRead the error on stderr
2No credential is set, the API answered HTTP 401, or it refused the --device-code codeRun volcano login, or volcano signup for a new account
3No project is selectedRun volcano connect . to create a project for this directory, or volcano use <project>
4The API answered HTTP 404, or no project or other cloud resource matched the name or IDCheck the name or ID
5The API answered HTTP 403, or the command needs an account tokenCheck the credential's access and the plan's limits

volcano sandboxes exec and volcano sandboxes shell return the guest process's exit code instead, and 124 on timeout. See sandboxes.md.

Choose the project per command

volcano cloud commands take --project <name-or-id> to run against a project for that one command, without changing the active project. A script or agent can check several projects in a row without volcano use between them:

for project in app-staging app-production; do
  volcano cloud lavaflow status --project "$project" --json
done

A project --project does not find exits 4. See connect.md for how the CLI picks a project otherwise.

JSON output

Commands that support --json print machine-readable JSON on stdout. These include:

  • volcano projects list and volcano projects get
  • volcano connect
  • volcano cloud access-tokens create, get, list, and usage
  • volcano cloud domains list and volcano cloud domains verify
  • volcano durable approvals …
  • volcano functions invoke
  • volcano projects keys service create
  • volcano sandboxes …

Run volcano <command> --help to check whether a command has --json.

volcano projects list --json | jq -r '.data[].name'

On this page