Admin verbs
kraft admin runs this machine's Kraft server. Bare kraft is the same as kraft admin start.
kraft admin start --port 9000
kraft admin start --detach
kraft admin stop
kraft admin restart -y
kraft admin health
kraft admin doctor
kraft admin reindex --repo <path>
kraft admin reload
kraft admin update --restart -y
kraft admin install-service
kraft admin uninstall-service
kraft admin templates lint
kraft admin templates lint --dir PATH
kraft admin templates show ID
kraft admin templates show ID --resolved
kraft admin templates library
kraft admin templates library ID
kraft admin harnesses
kraft admin harnesses ID
kraft admin init --repo
kraft admin mcp
kraft admin permission-hook cursor --fail-closed
| Command | Effect |
|---|---|
admin start | Runs the server in the foreground; the same as bare kraft. See Start the server. |
admin stop | Sends SIGTERM to the server. See Stop the server. |
admin restart | Stops, then starts again the same way it was running. See Restart the server. |
admin health | Prints the server's state and exits 1 when it is degraded, with the reasons on stdout. See What health prints. |
admin doctor | Runs every check in one pass. Exits 1 if any fails. See What doctor checks. |
admin reindex | Rescans documents into the search index. --repo limits it to one repo. |
admin reload | Rereads the library, the chains, policy.yaml and intake.yaml from disk, with no restart. See Reload the configuration. |
admin update | Installs the newest release. See Update Kraft. |
admin install-service, admin uninstall-service | Register or remove Kraft as an OS service (a launchd agent on macOS, a systemd user unit on Linux) that restarts if it exits. Stop a running server first. |
admin templates lint | Checks every chain in the library and exits 1 on any error. See Lint the templates. |
admin templates show ID | One chain as written. --resolved expands its library components. See Show a chain. |
admin templates library [ID] | Every library component, its kind and the chains using it. With an ID, one component. See Show a chain. |
admin harnesses [ID] | Every harness profile in harnesses.yaml, its provider, and the library tasks and chains selecting it (a chain's own harness: on a task included), then the agent profiles. With an ID, one harness profile in detail. |
admin init [--repo] | Registers the MCP server and skills with an agent. --repo installs into this repo, not your user config. See Use Kraft from your agent. |
admin mcp | Serves the MCP tools over stdio. |
admin permission-hook HARNESS | What a Cursor or Codex worker's pre-tool hook runs. You do not run it by hand. --fail-closed denies rather than giving no opinion when Kraft cannot answer. See Permission gate. |
Run the server
Start the server
| Flag | What it does |
|---|---|
--host, --port | Override KRAFT_HOST and KRAFT_PORT, which override access.yaml. |
--detach, -d | Forks the server into its own session and returns once it is up. |
Kraft refuses to start when:
- the address is not loopback and no password is set;
- a server is already running against the same run directory.
The foreground server stops on Ctrl-C. Use kraft admin stop for one you started elsewhere.
The flags are not saved: other commands still dial the host and port in KRAFT_HOST and KRAFT_PORT, or in access.yaml. When --host or --port differs from that value, start prints the KRAFT_HOST=H or KRAFT_PORT=N line they need. A wildcard --host such as 0.0.0.0 needs none.
With --detach, if the server exits instead, start prints the error (such as RuntimeError: database schema vN is newer than code vM), the end of that start's output, and the path of server.log.
Stop the server
kraft admin stop sends SIGTERM to the process in run/kraft.pid, once it has checked that the process is this Kraft server. Stopping ends every running agent. When Kraft starts again, each of those items stops with a reattach: failure and shows as failed; it does not resume by itself. Pause running items first (see A restart ends running agents).
- A pidfile naming any other process is stale:
stopremoves it, says so, and signals nothing. - It lists the active items first, without asking. A server that does not list them within 2 seconds is stopped anyway.
- A repo's setup command that is running is ended too, with everything it started, so it never runs beside the next server's own run of it. A server that is killed (SIGKILL) cannot end it.
Restart the server
kraft admin restart stops the server, then starts it again the way it was running: through the service manager if one is installed, back into the background if it was detached.
Like stop, restart ends any running agent: pause running items first, and retry any item it stopped. It lists the active items first and, in a terminal, asks before going on. -y skips the question.
| When | Then |
|---|---|
| The server runs attached to a terminal | It is stopped, with a note that only that terminal can bring it back, and restart exits 1, since no server is running after it. |
| You answer no | It exits 1 and says nothing was restarted. |
| No server is running | It starts nothing: it says so and exits 1. Start one with kraft admin start. |
Update and reload
Update Kraft
kraft admin update installs the newest release with uv, keeping the vector extra and the Python it runs on, or runs brew upgrade if you installed with Homebrew. On a pipx or pip install, or a source checkout, it installs nothing and prints the command that updates that install.
It warns when another install of kraft sits ahead of this one on PATH, since MCP servers and hooks run the first one.
| Flag | What it does |
|---|---|
--force | Installs even when current. |
--restart | Also restarts a running server, which ends any running agent, as restart does. It lists the active items and asks before installing anything; answering no exits 1. |
--channel CHANNEL | Takes releases from that channel. See Channels. |
-y | Accepts the template migration without asking, and skips --restart's question. |
A Kraft home from 0.x holds a registry.yaml and no library.yaml: the server starts degraded and refuses new work until you run kraft admin update. See Migrating a home from 0.x for what the update changes.
Channels
--channel takes one of four values:
--channel | Takes |
|---|---|
stable | Final releases only. It is how an rc or beta install goes back to finals. |
rc | Release candidates and finals. |
beta | Betas, release candidates and finals. |
alpha | Anything. |
Without --channel, the install follows the channel of the release it is:
| Install | Follows |
|---|---|
| A release candidate | rc |
| A beta | beta |
| An alpha | alpha |
| A final release | stable, which never takes a pre-release |
Homebrew installs only track stable.
Reload the configuration
kraft admin reload rereads the library, the chains, policy.yaml and intake.yaml. A policy.yaml or intake.yaml that does not load is refused and the running one is kept. Reload names it and exits 1, as it does for a chain that does not resolve.
What health prints
kraft admin health prints the server's state as key value lines, and exits 1 unless status is ok. The line after version and the lines after embeddings appear only when they apply:
installednames the installed version withrestart pending, after an update the server has not restarted for. It is not degraded.invalid template,invalid policyandinvalid intakename each file that does not load, with the reason.index error,reattachedandorphaned sessionsreport the search index and the agent sessions found at startup.
status ok
version 2.0.0
bind 127.0.0.1
documents 214
repos scanned 3
last scan 4m ago
embeddings available
--json prints the GET /api/health answer.
What doctor checks
kraft admin doctor runs every check in one pass, one line per check, and exits 1 if any fails. --json prints the rows. kraft admin health checks only the server.
Each line starts with ok, warn, FAIL or skip, then the check's name and what it found. A row about one repository carries its name, such as setup my-repo. The last line counts them.
ok server http://127.0.0.1:8765
ok health ok
...
ok restart the server (pid 4242) runs the installed version (2.0.0)
ok config /Users/you/.kraft/config
ok access.yaml parses
...
ok spa bundle /usr/lib/kraft/_bundled/web
...
ok repo app /Users/you/code/app
ok forge app github · gh
ok worktrees /Users/you/.kraft/run/worktrees
all 24 checks passed
The excerpt cuts the rows marked .... The count is for a running server, the shipped chains with claude on PATH, and one connected repo, app, with its commands declared. It grows with each connected repo and each harness profile the chains select. With no repo connected, a repos none connected row stands in for the repo rows.
Doctor failures lists every row with its fix.
Inspect templates and harnesses
Lint the templates
kraft admin templates lint checks every chain in the library, including that harnesses.yaml can launch each agent task (a task's profile: naming an agent profile with no model for its harness's provider is an error). It exits 1 on any error, printing each as file:line:column: message.
--dir PATH checks that directory in-process, with no server and no $KRAFT_HOME.
Show a chain
kraft admin templates show ID asks the running server. A chain file you just added shows only after admin reload, and --resolved expands the version the server last loaded.
kraft admin templates library ID takes a component id such as tasks.implementer, or a unique bare name. A bare name two sections share is refused with each full id. It prints the component's definition, its users and its lint issues.
Related
- Doctor failures: the fix for each row
admin doctorcan print. - Run Kraft as a service:
install-service, and keeping the server up across restarts. - Restart Kraft without ending running agents: what
stopandrestartdo to a running agent, and how to avoid it. - Upgrade Kraft: when to run
admin update, and how to pin a version.