surface

GitHub Actions.

Configure a bounded GitHub integration, understand comment triggers and runner authority, and distinguish a dry run from remote comments, pushes, and PRs.

Written for
Repository maintainers configuring a Code automation.
You need
Any plan and a developer API key; A disposable Linux X64 or ARM64 runner with repository checkout; A Kaitoi developer key with cli:code scope and appropriate GitHub permissions

For setup and updates, see Install and update. Check kaitoi --version and use kaitoi code --help to confirm available commands. Older builds may interpret unsupported code acp or code serve commands as model prompts.

The GitHub integration can answer questions, review pull requests, and prepare requested fixes. It invokes kaitoi code github run on the runner. This guide describes the checked-in action contract; it does not assume a published Marketplace action or invent a reusable release reference.

Wire the runner to the command

The public source export places the composite action at kaitoi-code-action/action.yml. Its intended release reference is kaitoi-labs/kaitoi-code/kaitoi-code-action@v1; that public reference is not available yet. The workflow below is a release-preparation template, not a working public install until the Action reference and a compatible CLI release are published.

The command reads GITHUB_EVENT_NAME, GITHUB_EVENT_PATH, GITHUB_WORKSPACE, GITHUB_TOKEN, and the Kaitoi account token. Store credentials as repository or organization secrets. Configure checkout and GitHub token permissions for the specific behavior you want: reading a PR, posting a response, and pushing a fix have different needs.

Choose the action inputs

Input Default or requirement
kaitoi-api-token Required developer key with cli:code.
github-token Runner's github.token.
cli-version latest; pin the intended release when repeatability matters.
trigger /kaitoi.
review-on-open false.
provider, model Optional selection.
max-credits 200; checked between model steps.
allowed-associations OWNER,MEMBER,COLLABORATOR.
allow-commands false; enabling grants fix command authority on the runner.

The action supports Linux X64 and ARM64 runners and verifies downloaded archive and AppImage checksums before execution. Review the action's current input names and your event/token setup together when adopting it.

Understand which event starts which task

Authorized GitHub events select a question, review, or fix path.

A qualifying trigger on a pull request requests review; a non-fix request on an issue asks a question. A fix request can produce a branch and commit, then push and open or update a pull request when authorized. Event and author checks happen before work. Dry run removes remote writes but still runs the model and can create a local fix branch and commit.

A /kaitoi line on a PR asks for a review; /kaitoi fix ... requests a fix. The trigger must begin a line, with at most three leading spaces. Matching is case-insensitive and ignores fenced code and quoted replies. A non-fix issue request asks a question.

When automatic review is enabled, opened, synchronize, and ready-for-review events can trigger it; draft PRs are skipped. Manual workflow_dispatch requires a prompt. Author associations are checked. pull_request_target is explicitly refused; it is not a supported shortcut for making secrets available to a PR.

Review write and cost authority

Fixes may create a branch and commit, push, and open a pull request. A same-repo PR fix can update that PR's branch. Pushes to the default branch are refused; GitHub branch protection governs other branches. Grant only the remote write permissions you intend.

--dry-run suppresses remote comments, reviews, pushes, and PR writes, but it still runs the model and can create a local fix branch and commit. --allow-commands is authority to execute fix commands on the disposable runner. Neither option is a free simulation. The credit bound is checked between model steps; the current step may take the total beyond it. Review the logs, diff, checks, and returned result before integrating a fix.

Workflow template for the release

Create KAITOI_API_TOKEN as a repository secret containing a developer key with cli:code from Settings → Developer. This is available on every plan. For fix PRs, enable GitHub's repository setting that allows Actions to create pull requests. Review the permissions before enabling write behavior.

name: Kaitoi Code
on:
  issue_comment:
    types: [created]
  issues:
    types: [opened, labeled]
  pull_request:
    types: [opened, synchronize, ready_for_review]
permissions:
  contents: write
  issues: write
  pull-requests: write
jobs:
  kaitoi:
    if: github.event_name != 'issue_comment' || contains(github.event.comment.body, '/kaitoi')
    runs-on: ubuntu-latest
    timeout-minutes: 30
    concurrency:
      group: kaitoi-${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}
      cancel-in-progress: false
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: kaitoi-labs/kaitoi-code/kaitoi-code-action@v1
        with:
          cli-version: 'latest'
          kaitoi-api-token: ${{ secrets.KAITOI_API_TOKEN }}
          review-on-open: 'true'
          max-credits: '200'

Before enabling this template, verify that the Action reference exists and that the CLI release the runner installs lists github in kaitoi code --help. Check the release selected by cli-version (latest or a published release you pin). For local checks, install that same release first; you can also check directly on the runner.

Issue label kaitoi requests an answer; kaitoi-fix requests a fix. Fork PRs receive no work through this integration. Answers and reviews use Plan mode. Fix branches use kaitoi/issue-<number>-<run> or kaitoi/pr-<number>-<run>. Use a disposable Linux runner and inspect its logs and changes before merging.

Last reviewed against Kaitoi on 26 October 2026. View this page as Markdown

Type at least two characters.