CI/CD & Agents
Run the sevk CLI from pipelines and subprocess-spawning agents. Pass --json (or --quiet) to get JSON output for parsing.
Environment Variables
Skip sevk login entirely; the CLI reads everything it needs from the environment.
SEVK_API_KEY=sevk_full_xxxxxxxx # requiredSEVK_BASE_URL=https://api.sevk.io # optional, for a custom API serverSEVK_PROFILE=production # optional, pick a saved profile
GitHub Actions
name: notify-deployon:push:branches: [main]jobs:notify:runs-on: ubuntu-lateststeps:- uses: actions/checkout@v4- run: npm install -g sevk-cli- name: Email the teamenv:SEVK_API_KEY: ${{ secrets.SEVK_API_KEY }}run: |sevk emails send \--from "[email protected]" \--to "[email protected]" \--subject "Deploy ${{ github.sha }}" \--text "Ref ${{ github.ref }} is live."
GitLab CI
notify:stage: deployimage: node:20variables:SEVK_API_KEY: $SEVK_API_KEYscript:- npm install -g sevk-cli- |sevk emails send \--from "[email protected]" \--to "[email protected]" \--subject "Pipeline $CI_PIPELINE_ID done" \--text "Commit $CI_COMMIT_SHORT_SHA passed."
Docker
Drop the CLI into any image with npm or bun. The binary is small enough to add to distroless-style images.
FROM node:20-alpineRUN npm install -g sevk-cliENV SEVK_API_KEY=""ENTRYPOINT ["sevk"]
AI Agents
When an agent spawns the CLI as a subprocess, pass --json (or --quiet) to emit JSON to stdout. The contract it gives you:
# Required flags must all be present (no prompts)# stdout : JSON# stderr : human-readable progress lines (can be ignored)# exit 0 : success# exit 1 : error - stderr is JSON with { error: { message } }# (API errors also carry statusCode, code, and fields when present)sevk emails send --json \--from "[email protected]" \--to "[email protected]" \--subject "Report" \--text "Your report is ready."# => {"id":"b8c9d0e1-2345-4f01-2345-789012345f01"}sevk emails send --json --from "" --to "" --subject "" --text ""# exit 1# => {"error":{"message":"Missing required fields: --from, --to, --subject"}}
Pipe into jq to extract ids, or parse the JSON directly in whatever runtime is orchestrating the agent.