Scripting & Automation
The CLI is built for both interactive use and automation. Three flags control output behavior across all commands.
JSON output
Section titled “JSON output”Every command that prints a table also supports JSON:
ancla workspaces list --json[ { "name": "My Workspace", "slug": "my-ws", "member_count": 3, "project_count": 2 }]The long form works too:
ancla workspaces list --output jsonPipe JSON into jq for extraction:
ancla services list my-ws/my-project/production --json | jq '.[].slug'Quiet mode
Section titled “Quiet mode”Suppress spinners, progress messages, and confirmations:
ancla services deploy my-ws/my-project/production/my-service --quietShort form:
ancla services deploy my-ws/my-project/production/my-service -qIn quiet mode, the CLI prints only essential output: IDs, final status, and errors. Combine with --json for fully machine-parseable output:
ancla services deploy my-ws/my-project/production/my-service -q --jsonFollowing long-running operations
Section titled “Following long-running operations”Build and deploy commands accept --follow (or -f) to stream output until the operation completes:
ancla services deploy my-ws/my-project/production/my-service --followancla builds create my-ws/my-project/production/my-service --followancla deploys log <deploy-id> --followancla logs -fWithout --follow, these commands print the current state and exit.
Skipping confirmation prompts
Section titled “Skipping confirmation prompts”Destructive commands (down, cache flush, config delete) prompt for confirmation in interactive use. Skip the prompt with --yes:
ancla down --yesancla cache flush --yesCI/CD example
Section titled “CI/CD example”A GitHub Actions step that deploys and waits for completion:
- name: Deploy to Ancla env: ANCLA_API_KEY: ${{ secrets.ANCLA_API_KEY }} run: | ancla services deploy my-ws/my-project/production/my-service --follow --quietThe ANCLA_API_KEY env var is picked up automatically. No config file or login step needed.
Exit codes
Section titled “Exit codes”The CLI exits with code 0 on success and non-zero on failure. Deploy failures, auth errors, and invalid arguments all produce non-zero exits, so set -e in shell scripts works as expected.