Skip to content
Documentation
Open the panel

Command lineAutomation

In a CI pipeline

kcloud runs in any CI pipeline that has Node.js. A token in place of a sign-in, JSON output and exit codes let a pipeline hand work to agents and act on the answer.

Create a token for the pipeline on the Access tokens page of the panel or with kcloud tokens create ci-pipeline --expires-in 90, and store it as a secret of the pipeline. kcloud reads it from the variable KIKIMORA_CLOUD_TOKEN and writes nothing to disk. KIKIMORA_CLOUD_URL names another address of the platform, and KIKIMORA_CLOUD_ORG the organization.

In GitHub Actions, add the secret KIKIMORA_CLOUD_TOKEN to the repository and a step with env: KIKIMORA_CLOUD_TOKEN: ${{ secrets.KIKIMORA_CLOUD_TOKEN }} and run: npx --yes @kikimoradev/kcloud agents tasks add sandbox/release-notes --title "Release ${{ github.ref_name }}" --description "Write the release notes of ${{ github.ref_name }}." --yes --json.

In GitLab CI, store KIKIMORA_CLOUD_TOKEN as a masked variable in the CI/CD settings of the project. A job with image: node:24 then needs only script: npx --yes @kikimoradev/kcloud agents tasks add sandbox/release-notes --title "Release $CI_COMMIT_TAG" --description "Write the release notes of $CI_COMMIT_TAG." --yes --json. The same works in Jenkins, Buildkite or a plain cron job: all it needs is the variable with the token.

1

Step 1: Hand a task to an agent

--yes makes the command ask nothing, and --json prints the created task as JSON, from which the pipeline reads, for instance, its id.

$ kcloud agents tasks add sandbox/release-notes --title "Release 2.4.0" --description "Write the release notes of 2.4.0." --yes --json

Output

{
  "id": "manual-m7k2q9xa-1",
  "title": "Release 2.4.0",
  "description": "Write the release notes of 2.4.0.",
  "status": "pending",
  "attempt": 0,
  "maxAttempts": null,
  "costUsd": null,
  "durationMs": null,
  "error": null,
  "createdAt": "2026-03-14T09:30:00.000Z",
  "startedAt": null,
  "finishedAt": null
}
2

Step 2: Read the output as JSON

Each command takes --json and then prints what the API answers, without tables or decoration. The output is easy to process, for instance with jq.

$ kcloud projects list --json

Output

[
  {
    "id": "0195a3c4-7e21-7b6d-9f40-3c81a4d2e600",
    "organizationId": "0195a3c4-7e21-7b6d-9f40-3c81a4d2e601",
    "name": "Sandbox",
    "slug": "sandbox",
    "description": "",
    "color": "#6366f1",
    "logoHash": null,
    "dockerAllowed": true,
    "memberCount": 1,
    "createdAt": "2026-03-14T09:30:00.000Z",
    "updatedAt": "2026-03-14T09:30:00.000Z"
  }
]

The exit code tells the pipeline what happened: 0 is success, 1 a refusal of the platform, 64 a usage error such as a missing option, 70 something unexpected, and 130 a cancelled question. A refusal on stderr names the error code of the API in parentheses, such as agent.busy, so the pipeline can act on it.

Matches the panel at cloud.kikimora.dev.