KilnDocs
Developer tools

CLI reference

Every kiln command, generated from the CLI's help text.

The kiln CLI validates and applies factory definitions locally and talks to a Kiln server for everything else.

Set KILN_URL (default http://localhost:4000) and KILN_TOKEN, or put { "url": "...", "token": "..." } in ~/.kiln/config.json. In this repository run it as pnpm kiln <command>; paths resolve from the directory you ran pnpm in.

kiln — self-hostable software factories

Factory Architect (your favorite coding agent writes your factory)
  kiln architect [dir] [--agent claude,cursor,copilot,all] [--force] [--print]   Install the instructions (.kiln/architect.md + agent wrappers)
  kiln scan [dir] [--json]                                            Profile a repo: stack, commands, CI, MCP servers to connect
  kiln bench from-prs --repo owner/name [--limit 20] [--dir kiln]     Backtest suite from recent merged pull requests

Definitions (local)
  kiln init [dir] [--template sdlc|single-repo|po-feature|incident]   Scaffold a definition tree
  kiln validate [path]                                                Schema and reference checks; exit 1 on errors
  kiln diff [path] [--against applied|<path>] [--factory <id>]        What an apply would change
  kiln import <src> [out]                                             Convert a v1alpha1 tree to kiln/v1
  kiln schema <kind>                                                  JSON Schema for a file kind

Factory (needs KILN_URL and KILN_TOKEN)
  kiln apply [path] [--dry-run] [--canary 10%] [--factory <id>]       Apply atomically, or as a canary
  kiln connect <owner/repo> [--dir <path>] [--ref main]               Store a factory in a GitHub config repo
  kiln factories                                                      List factories
  kiln send "<task>" --factory <id> [--body <text>]                   Create a work item
  kiln pull <task>                                                    Take a task to a local worktree
  kiln handback <task> [message]                                      Return it to the factory
  kiln dispatch "<prompt>" --factory <id> [--ticket linear:ENG-1] [--mode plan|orchestrate]   Send a prompt to the foreman
  kiln tasks --factory <id> [--stage IMPLEMENT] [--q <text>]          List tasks
  kiln tasks get|cancel|outputs <task> --factory <id>                 One task: details, cancel it, its outputs
  kiln runs [--factory <id>] [--state FAILED] [--source SLACK] [--mine]   List runs
  kiln runs get|timeline|transcript <run>                             One run
  kiln runs followup <run> <message> | interrupt <run> | cancel <run>   Talk to or stop a run
  kiln upload <file...> [--factory <id>]                              Upload attachments; prints their keys
  kiln create-factory --name <n> --repo owner/name [--repo …] [--slack] [--tracker linear|jira] [--preset quality|efficient] [--dry-run]
  kiln files validate [path]                                          Validate a tree with the server's parser (no token needed)
  kiln inbox [--all]                                                  Decisions waiting on you
  kiln decide <gate> approve|reject|answer [text]                     Decide a gate
  kiln replay <run> [--with <sha>]                                    Replay a run, optionally under another definition
  kiln steer <run> <message>                                          Steer a running agent
  kiln bench run <suite> --factory <id>                               Run a benchmark suite
  kiln metrics --factory <id> [--since <iso>]                         Factory metrics
  kiln token create --name <n> --subject <email> --grants read:*,send:webapp

Self-hosted worker (connects out to KILN_URL with a token that has the worker scope)
  kiln worker --worker-id <id> [--api-key <key>] [--backend docker|kubernetes]
              [--max-concurrent-tasks N] [--one-shot] [--idle-on-complete 45m]
              [-v HOST:CONTAINER[:ro]]… [-e KEY[=VALUE]]… [--config-file worker.yaml]
              [--no-cleanup] [--metrics-port 9464] [--log-level info]

Exit codes

  • 0 success.
  • 1 validation errors (printed as file:line: message), API errors (error <status>: <message>) or bad arguments.
Edit this page on GitHub