ReferenceCLI commands
BetaYou are reading docs for the beta channel (
2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →CLI commands
ak watch
Watch a GitHub repository and auto-respond to issues
Monitor a GitHub repository for new issues matching filter rules and automatically generate AI responses via ak run. State is persisted at ~/.agentkit/watch/<repo>/state.json so restarts never produce duplicate responses.
Who it's for: Power devs running automated triage workflows. Requires gh CLI authenticated.
When to use it: Use ak watch start to begin. ak watch dry-run to preview before going live.
What changes on disk: Reads/writes ~/.agentkit/watch/<repo-slug>/state.json (atomic write). In daemon mode, writes a PID file alongside state.json.
Examples
ak watch start owner/repo # one-shot, 10 resp/hr ceiling
ak watch start owner/repo --daemon # background daemon
ak watch start owner/repo --label needs-response --max-per-hour 5
ak watch dry-run owner/repo # preview, post nothing
ak watch status # show all active watches
ak watch stop owner/repo # stop a running daemonFlags
| Flag | Description |
|---|---|
-h, --help | help for watch |
--json | Emit machine-readable JSON (implies --no-interactive) |
--no-interactive | Disable interactive prompts (CI-safe) |
-q, --quiet | Suppress non-error output on stderr |
-V, --verbose | Extra diagnostic output on stderr (loses to --quiet) |
-y, --yes | Assume yes for all prompts |
Output modes
| Mode | Behavior |
|---|---|
pretty | default on TTY (colors, ASCII markers) |
plain | auto when stdout piped or --no-interactive |
json | --json (single-object envelope, NDJSON-safe) |
Exit codes
| Code | Meaning |
|---|---|
0 | success |
1 | runtime error |
2 | invalid flags |
3 | user-cancel (SIGINT, prompt-cancel) |
1 | runtime error (state I/O, gh failure) |
2 | invalid flags or arguments |
3 | rate limit exceeded (non-zero only in scripted one-shot mode) |
Related commands
ak— AgentKit CLIak watch dry-run— Preview whatak watch startwould post without actually postingak watch start— Start watching a repository for new issuesak watch status— Show current watch state (all repos, or a specific one)ak watch stop— Stop a running watch daemon for the given repository