CI / CD Integration
The prokodo CLI is designed to run headlessly in any CI environment.
Key principles
- All user-facing prompts are suppressed when
stdinis not a TTY --jsonemits structured output tostdout; logs go tostderr--no-color(orNO_COLOR=1) removes ANSI codes that pollute CI logs- Exit codes are strict:
0= pass,1= fail,2= setup error - Credentials are read from the
PROKODO_API_KEYenvironment variable — no credentials file needed
GitHub Actions
Minimal example
name: Verify
on:
push:
branches: [main, develop]
pull_request:
jobs:
prokodo-verify:
name: prokodo verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install prokodo CLI
run: npm install -g prokodo
- name: Verify
run: prokodo verify --json --no-color
env:
PROKODO_API_KEY: ${{ secrets.PROKODO_API_KEY }}
With health check + tagging
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install prokodo CLI
run: npm install -g prokodo
- name: Environment health check
run: prokodo doctor --json --no-color
env:
PROKODO_API_KEY: ${{ secrets.PROKODO_API_KEY }}
- name: Verify
run: |
prokodo verify \
--ref ${{ github.sha }} \
--timeout 600 \
--json \
--no-color
env:
PROKODO_API_KEY: ${{ secrets.PROKODO_API_KEY }}
Capture result as a step output
- name: Verify
id: verify
run: |
RESULT=$(prokodo verify --json --no-color 2>/dev/null)
echo "result=$RESULT" >> "$GITHUB_OUTPUT"
env:
PROKODO_API_KEY: ${{ secrets.PROKODO_API_KEY }}
- name: Report
if: always()
run: echo '${{ steps.verify.outputs.result }}' | jq .
Adding the secret
In your GitHub repository:
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
PROKODO_API_KEY - Value: your API key from the prokodo marketplace
GitLab CI
prokodo-verify:
image: node:22
stage: test
script:
- npm install -g prokodo
- prokodo doctor --json --no-color
- prokodo verify --ref "$CI_COMMIT_SHA" --json --no-color
variables:
PROKODO_API_KEY: $PROKODO_API_KEY # set in GitLab CI/CD variables
CircleCI
jobs:
prokodo-verify:
docker:
- image: cimg/node:22.0
steps:
- checkout
- run:
name: Install prokodo CLI
command: npm install -g prokodo
- run:
name: Verify
command: prokodo verify --ref $CIRCLE_SHA1 --json --no-color
environment:
PROKODO_API_KEY: $PROKODO_API_KEY
Best practices
| Recommendation | Reason |
|---|---|
Use PROKODO_API_KEY env var | Never commit credentials; secrets are per-environment |
Pass --json | Structured output is easier to parse in subsequent steps |
Pass --no-color or set NO_COLOR=1 | Prevents ANSI escape codes in CI logs |
Pass --ref ${{ github.sha }} | Tags runs with commit SHA for traceability in the dashboard |
Run doctor before verify | Surfaces environment problems early with clear messages |
Local development vs CI
| Scenario | Auth method | Extra flags |
|---|---|---|
| Developer laptop | prokodo auth login → credentials file | — |
| CI pipeline | PROKODO_API_KEY secret | --json, --no-color |
You never need auth login in CI. The env var is read automatically with the same priority as the credentials file.