Run the CLI in CI/CD
Use this guide when you want to run the shipped chainabit commands from a non-interactive job.
Install the CLI
npm install -g chainabitProvide Credentials Safely
For CI jobs, prefer a time-bounded developer token or an already-issued access token instead of typing passwords into the command line.
Option 1: Reuse an Existing Token
export CHAINABIT_TOKEN="$CHAINABIT_TOKEN"
chainabit auth status --jsonOption 2: Log In with a Developer Token
chainabit auth login \
--token-env CHAINABIT_DEVELOPER_TOKENThe CLI first tries direct bearer authentication with the raw cbt_live_... token. If the target server has not been upgraded yet, it falls back to the legacy exchange endpoint automatically.
Verify the Workspace Context
Use --json so the pipeline can parse structured output.
chainabit auth status --json
chainabit workspace current --jsonExpected auth status shape:
{
"authenticated": true,
"email": "you@example.com",
"sub": "user_123",
"exp": "2026-03-28T12:00:00.000Z"
}Run Real Commands
Once authenticated, you can inspect workspace state, connectors, and AI metadata from the job:
chainabit chain list --json
chainabit connectors list --json
chainabit ai models --jsonExample connector catalog entry:
[
{
"key": "slack",
"displayName": "Slack",
"category": "communication",
"authType": "oauth2",
"supportedFeatures": ["tool_discovery", "health_check"],
"isActive": true
}
]Example GitHub Actions Workflow
name: Chainabit check
on: [push]
jobs:
verify:
runs-on: ubuntu-latest
env:
CHAINABIT_BASE_URL: https://api.chainabit.com/api/v1
CHAINABIT_WORKSPACE_ID: ${{ secrets.CHAINABIT_WORKSPACE_ID }}
CHAINABIT_DEVELOPER_TOKEN: ${{ secrets.CHAINABIT_DEVELOPER_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: npm install -g chainabit
- run: chainabit auth login --token-env CHAINABIT_DEVELOPER_TOKEN
- run: chainabit auth status --json
- run: chainabit workspace current --json
- run: chainabit connectors list --json
- run: chainabit ai models --jsonCreating the Token
Create the CI token from a trusted interactive session:
chainabit auth keys create "github-actions" --ttl 90 --scope execution:runAdd --scope wallet:read if the job needs wallet visibility, or --account <account-uuid> if the token must stay bound to one account.
When to Use Another Page
- Use CLI Command Reference for the full command surface.
- Use CLI Configuration for local config files and environment variables.
- Use Connectors CLI Reference when the job manages connector instances or credentials.