Skip to main content

CI / CD Integration

The prokodo CLI is designed to run headlessly in any CI environment.

Key principles

  • All user-facing prompts are suppressed when stdin is not a TTY
  • --json emits structured output to stdout; logs go to stderr
  • --no-color (or NO_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_KEY environment 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:

  1. Go to Settings → Secrets and variables → Actions
  2. Click New repository secret
  3. Name: PROKODO_API_KEY
  4. 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

RecommendationReason
Use PROKODO_API_KEY env varNever commit credentials; secrets are per-environment
Pass --jsonStructured output is easier to parse in subsequent steps
Pass --no-color or set NO_COLOR=1Prevents ANSI escape codes in CI logs
Pass --ref ${{ github.sha }}Tags runs with commit SHA for traceability in the dashboard
Run doctor before verifySurfaces environment problems early with clear messages

Local development vs CI

ScenarioAuth methodExtra flags
Developer laptopprokodo auth login → credentials file
CI pipelinePROKODO_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.