AgentKit
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 daemon

Flags

FlagDescription
-h, --helphelp for watch
--jsonEmit machine-readable JSON (implies --no-interactive)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
-y, --yesAssume yes for all prompts

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
1runtime error (state I/O, gh failure)
2invalid flags or arguments
3rate limit exceeded (non-zero only in scripted one-shot mode)
  • ak — AgentKit CLI
  • ak watch dry-run — Preview what ak watch start would post without actually posting
  • ak watch start — Start watching a repository for new issues
  • ak watch status — Show current watch state (all repos, or a specific one)
  • ak watch stop — Stop a running watch daemon for the given repository

On this page