Skip to main content

How to automate landbase-cli in scripts and CI

This guide shows you how to use landbase-cli in shell scripts and CI pipelines — handling exit codes, passing credentials without interaction, and building robust automations.

Pass credentials without a browser

In scripts and CI, you cannot open a browser for OAuth. Use an API key instead:
Or pass it inline for a single command:
In CI (GitHub Actions, GitLab CI, etc.), store the key as a secret and inject it as an environment variable:

Handle exit codes

landbase-cli uses standard exit codes for machine-readable error handling:
See exit codes reference for the full definition of each code.

Capture errors from stderr

Errors are written to stderr as JSON. Capture them separately from stdout:

Retry on transient errors

Network errors (exit code 4) are often transient. Add a retry loop:

Disable the update check

In CI, suppress the daily version-available nag:
Or pass --no-update-check to individual commands.

Disable telemetry

To opt out of anonymous usage telemetry:

Full CI pipeline example