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 api stop

Stop the running API server daemon

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.

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

Usage

ak api stop [flags]

Examples

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

Flags

FlagDescription
-h, --helphelp for stop
--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)
  • ak api — Run a local API + proxy server for AgentKit

On this page