AgentKit
ReferenceCLI commands

CLI commands

ak api stop

Stop the running API server daemon

ak api stop

Stop the running API server daemon

Synopsis

What it does: Send SIGTERM to the running AgentKit API server process. Reads the PID from ~/.agentkit/api-state.json. Succeeds (exit 0) if the server is not running - idempotent and safe to call from scripts.

Who it's for: Both: power devs scripting lifecycle control and non-technical users via the dashboard.

When to use it: When you want to stop the local API server started with ak api start. Also useful in CI teardown after a test run that required the API server.

Examples: ak api stop # stop the running server ak api stop --json # emit stop confirmation as JSON

What changes on disk: Removes ~/.agentkit/api-state.json after a successful stop.

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)

ak api stop [flags]

Options

  -h, --help             help for stop
      --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 api - Run a local API + proxy server for AgentKit

On this page