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 addon validate PATH
kraft admin addon collection add SOURCE [--ref REF] [--auto-update]
kraft admin addon collection list
kraft admin addon collection update [NAME]
kraft admin addon collection auto-update NAME on|off
kraft admin addon collection remove NAME
kraft admin addon install ADDON@COLLECTION [--as ALIAS] [--auto-update] [--re-install] [-y]
kraft admin addon update [ADDON@COLLECTION ...] [-y | --check]
kraft admin addon auto-update ADDON@COLLECTION on|off
kraft admin addon enable ADDON@COLLECTION
kraft admin addon disable ADDON@COLLECTION
kraft admin addon uninstall ADDON@COLLECTION
kraft admin addon list
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 addon validate PATH | Checks a collection or a single add-on directory and installs nothing. Exits 1 on any problem. See Check an add-on. |
admin addon collection add SOURCE | Adds a collection from owner/repo (GitHub), a git URL or a directory. Installs nothing. See Install and update add-ons. |
admin addon collection list | Each collection, its source and the add-ons it published when last fetched. No network. |
admin addon collection update [NAME] | Fetches the newest catalogue. Installed add-ons do not change. |
admin addon collection auto-update NAME on|off | Sets whether every add-on installed from the collection updates itself. |
admin addon collection remove NAME | Forgets a collection. Refused while one of its add-ons is installed. |
admin addon install ADDON@COLLECTION | Installs an add-on after showing its review. --re-install takes the newest commit of an installed one. |
admin addon update [ADDON@COLLECTION ...] | Updates the named add-ons, or all of them, each after its review. --check changes nothing. |
admin addon auto-update ADDON@COLLECTION on|off | Sets one add-on's auto-update. Refused when its collection already auto-updates. |
admin addon enable|disable ADDON@COLLECTION | Loads an installed add-on, or keeps it installed and not loaded. |
admin addon uninstall ADDON@COLLECTION | Removes an add-on. Refused while your own config still references its namespace. |
admin addon list | Every installed add-on: namespace, version and commit, with its auto-update setting, why it is not loaded, and a pending alias, ref or collection URL change. |
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.
Before it installs a release of another major version, it lists each loaded Kraft add-on whose requires.kraft that release does not meet, and asks Install it anyway? [y/N]. Those add-ons stop loading until each publishes a version for the new major. Answering no, or running with no terminal, installs nothing and exits 1.
| 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, skips --restart's question, and installs a major release that leaves add-ons out. |
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.
It also rereads addons.yaml and addons.lock, and restores in the background any add-on store the lock names and this machine lacks. An add-on file that does not read is refused, and the server keeps the add-ons it has. See What loads.
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.storageshows worktree usage againststorage.worktrees.limit, and appears only when a limit is set.heldmakes the statusdegraded, so the command exits 1. Withauto_cleanupset, the line also says how many finished items ended too recently to clean up.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. With storage.worktrees.limit set, a storage row says how much the worktrees use of the limit: ok under the quota, warn over it, and over the limit a failing health row. 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 25 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.
Install and update add-ons
Add a collection and install from it
kraft admin addon collection add SOURCE records a collection in addons.yaml under the name its collection.json declares. owner/repo is written as its full GitHub URL. kraft admin addon install ADDON@COLLECTION then fetches the add-on, checks it against this instance, and prints a review: what can change how far a run reaches first, then the rest. Nothing is installed until you accept it. -y accepts without asking; with no terminal and no -y the install is declined.
--as ALIAS installs the add-on under another namespace. --re-install takes the commit the collection's ref names now, even when the add-on's version has not changed.
Update add-ons
kraft admin addon update reviews every installed add-on that has an update, one at a time: its version changed (its files, for a directory collection), or you changed its alias, ref or collection URL by hand. An add-on that fails a check is reported and the others go on. A change that would break one of your own chains, a default_chain in repos.yaml or an intake.yaml schedule is refused and names the reference.
--check prints the reviews and changes nothing. It exits 0 when every add-on is current, 1 when an update is waiting, 2 when an update would be refused and 3 when it could not check, so a scheduled job can tell them apart.
An add-on set to auto-update is checked after each server start and once a day while the server runs. kraft admin addon list marks it auto-update (collection) or auto-update (addon); its last outcome is on the add-on updates row of kraft admin doctor and in GET /api/health. See Auto-update.
Remove an add-on
kraft admin addon uninstall and disable are refused while your library, a chain, repos.yaml, intake.yaml, policy.yaml or harnesses.yaml still names the add-on's namespace. The refusal lists each reference.
A worker cannot run the verbs that change add-ons.
Check an add-on
Validate a collection or an add-on
kraft admin addon validate PATH checks a collection or a single add-on directory and installs nothing. PATH is a directory holding .kraft/collection.json, or one holding .kraft/addon.json.
It checks each add-on's files against the size and content limits, both manifests, the Kraft version the add-on requires, and that every chain the add-on ships resolves.
When the config directory holds a library.yaml, it also checks the add-on as an install into that instance: its requires.harnesses and requires.profiles, its namespace, and your own chains. With none, it prints a skipped: line naming those checks.
It prints one line per add-on with its version and digest, then each problem with its file, then warnings: a manifest key Kraft does not read, and a file that looks like part of the add-on layout and is not.
It exits 0 when every add-on passes and 1 otherwise, so a collection's CI can run it on every push; Run validate in CI shows a job. --json prints the report as an object with addons, problems, warnings and skipped.
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. - Share chains with add-ons: publish a collection and install an add-on from it.
- Add-ons and collections: the manifests,
addons.yaml, the lock, and when an add-on loads or updates.