Non-interactive use
The CLI runs headless, without prompts or a saved session, so you can use it in a continuous integration pipeline or any script. You supply the token, tenant, and endpoint up front, and the CLI never has to ask. This is the counterpart to interactive use: the same commands, with every value passed as a flag instead of prompted for.
Authenticate with a token
In a pipeline, sign in by passing the token and tenant directly:
revenexx login --token <token> --tenant <slug>
The token is a gateway API key, created in Cockpit. Give it the permissions the commands you run will need.
login saves the key but not the tenant, so set REVENEXX_TENANT (below) or pass --tenant on every later command.
Or use environment variables
Instead of flags, set the credentials in the environment. The CLI picks them up automatically for every command:
export REVENEXX_API_KEY=<token>
export REVENEXX_TENANT=<slug>
export REVENEXX_API_URL=https://api.revenexx.com/v1
revenexx products list --json
Environment variables take precedence over config files, with one exception: a tenant set with revenexx tenants use wins over REVENEXX_TENANT. On a runner that keeps its home directory between jobs, pass --tenant explicitly (CLI 0.5.0 or later). For the full precedence rules, see credential resolution.
Skip prompts
Delete commands ask for confirmation, but only on an interactive terminal. In a pipeline there is no TTY, so they run without asking. --force skips the question on a terminal too:
revenexx products delete --id <id> --force
Don't switch tenants with tenants use in a pipeline. It saves the slug in ~/.revenexx/tenant, and on a runner that keeps its home directory that file overrides REVENEXX_TENANT for every later job. It can also save a mistyped slug: --force keeps a slug the gateway rejects, and without a credential nothing is checked at all. Set REVENEXX_TENANT, or pass --tenant on each command, instead. Without a slug, tenants use never prompts in a pipeline: it prints the list and exits 1.
Machine-readable output
For output you can parse, add --json:
revenexx orders list --json
The CLI also renders JSON Lines, CSV, YAML, and Markdown, projects fields with --fields, exits with a meaningful code on failure, and reads request bodies from a file or stdin. See Scripting & output for the full automation surface.
Example: GitHub Actions
Store the token as a repository secret, then run the CLI in a step:
- name: Deploy App
env:
REVENEXX_API_KEY: ${{ secrets.REVENEXX_API_KEY }}
REVENEXX_TENANT: acme
REVENEXX_API_URL: https://api.revenexx.com/v1
run: |
npm install -g @revenexx/cli
revenexx deploy app --no-install
deploy app registers the App if it does not exist yet, uploads the code, waits
for the build, then publishes and installs it. --no-install stops short of
installing, which is usually what you want in CI for an App that is already
installed on the target tenant.
What's next
- Review the available commands.
- Look up flags and exit codes in the global commands reference.