AgentKit
ReferenceCLI commands

CLI commands

ak watch

Watch a GitHub repository and auto-respond to issues

ak watch

Watch a GitHub repository and auto-respond to issues

Synopsis

What it does: 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.

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

What changes on disk: Reads/writes ~/.agentkit/watch/<repo-slug>/state.json (atomic write). In daemon mode, writes a PID file alongside state.json.

Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)

Exit codes: 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)

Options

  -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

SEE ALSO

  • 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