Skip to content

Automation & git

ka ships the pieces for unattended runs and git-heavy workflows: a ready GitHub Actions workflow, cron scheduling, prompt recipes, and isolated worktrees. See the CLI reference for the full flag grammar.

Terminal window
ka action init [--force]

Writes ka’s vendored GitHub workflow into the repository. The workflow:

  • triggers on manual dispatch and on PRs labeled ka
  • checks out at a SHA-pinned action version
  • installs a release binary with sha256 verification
  • runs ka in readonly mode and posts its result as a PR comment

It only needs KA_MODEL and the provider KA_*_API_KEY secrets; nothing else is exposed. --force overwrites an existing workflow file.

Terminal window
ka schedule add # print the crontab line(s) to add
ka schedule list # show current ka schedule entries
ka schedule remove # print the removal

Entries are ordinary crontab lines marked with a # ka-schedule comment. By default the commands print the lines; --install writes them into your crontab directly.

Terminal window
ka recipe triage --var branch=main
ka recipe nightly --dry-run

A recipe is a strict TOML file in .ka/recipes/ with vars and steps; each step is one prompt, and the recipe runs as sequential prompts inside a single session. --var K=V supplies variables, --dry-run prints the prompts without sending them.

Terminal window
ka worktree add
ka worktree list
ka worktree remove [--delete-branch]

Gives each agent task its own git worktree, so concurrent runs never touch the same checkout. Removal can also delete the branch the worktree was on.

  • /pr opens the pull-request flow with review and fix presets.
  • /git opens a staging panel.
  • [git] commit_role has a role write the commit subject from the staged diff plus the turn; if it cannot, the fallback fires silently.
  • [git] trailers adds configured trailers to commits.
Mechanism Effect
--max-budget-usd $ Asks to stop past a spend ceiling
--max-cost $ / --max-time SECS Hard caps; ka run exits with code 3 when crossed
--mode dont_ask Never block on a permission question
[permissions] prompt_policy = "deny" Deny (rather than ask) when a rule does not allow an action

Combine these with the headless interface for scripts, and read the safety model before pointing ka at shared state.