CLI Reference
Every kutl command, its flags, and usage examples.
kutl init
kutl init [--relay <url>] [--name <name>] [--dir <path>] [--subfolder <name>]Initialize a new kutl space in a directory. Creates .kutlspace and .kutl/, generates a DID identity if one doesn't exist, and registers the space name with the relay.
| Flag | Type | Default | Description |
|---|---|---|---|
--relay | URL | ws://127.0.0.1:9100/ws | Relay WebSocket URL |
--name | string | auto-generated | Human-readable space name |
--dir | path | current directory | Target directory |
--subfolder | string | "kutl" (prompted) | Subfolder name inside a git repo |
Example
kutl init --name my-projectkutl update
kutl update [--dir <path>]Refresh the kutl-managed section of AGENTS.md against the running binary's instructions template. Use this when AGENTS.md was generated by an older kutl version and is out of date. Anchors at the space's project root (the git repo root if any, otherwise the space directory) and bails if no kutl space is present at or under the anchor.
| Flag | Type | Default | Description |
|---|---|---|---|
--dir | path | current directory | Target directory |
Example
kutl updatekutl join
kutl join [<target>] [--relay <url>] [--dir <path>] [--subfolder <name>]Join an existing space. The target can be:
- A bare name (e.g.
my-project) — resolved via the default or specified relay - An owner/slug (e.g.
alice/my-project), which connects via kutlhub - A full invite URL (e.g.
https://...), with the relay extracted from the URL
If invoked inside a directory with an existing .kutlspace, the space name from that file is used and the target argument may be omitted.
| Flag | Type | Default | Description |
|---|---|---|---|
--relay | URL | — | Relay WebSocket URL (inferred from target when possible) |
--dir | path | current directory | Target directory |
--subfolder | string | — | Subfolder name inside a git repo |
Examples
# Join by name (uses default relay)
kutl join my-project
# Join by name with an explicit relay
kutl join my-project --relay ws://relay.example.com:9100/wskutl sync
kutl sync [--dir <path>]Push local changes and pull remote changes, then exit. A one-shot alternative to running the daemon continuously. Useful for CI pipelines or scripts.
| Flag | Type | Default | Description |
|---|---|---|---|
--dir | path | current directory | Target directory |
kutl status
kutl status [--format human|json]Show client diagnostic state: daemon and desktop tray liveness, registered spaces, identity, and relay reachability. Works whether the daemon is running or not. Run from any directory.
| Flag | Type | Default | Description |
|---|---|---|---|
--format | human|json | human | Output format. json emits a machine-readable snapshot with a stable schema; safe to paste into a support issue. |
Example
kutl status
# daemon: running (PID 12345, $KUTL_HOME=~/.kutl)
# identity: Alice ([email protected])
#
# spaces (1 registered):
# ✓ my-project /home/alice/code/proj relay=ws://127.0.0.1:9100/ws last-activity=12s ago
#
# relays:
# ws://127.0.0.1:9100/ws reachablekutl daemon
kutl daemon <run|start|stop>Manage the background daemon that watches files and syncs with the relay.
| Subcommand | Description |
|---|---|
run | Run in the foreground (watches all registered spaces) |
start | Start as a background process (PID written to ~/.kutl/daemon.pid) |
stop | Stop the running daemon (graceful SIGTERM, then SIGKILL) |
To inspect daemon liveness and registered spaces, use kutl status.
Example
kutl daemon start
kutl status
# daemon: running (PID 12345, $KUTL_HOME=~/.kutl)kutl auth
kutl auth <login|token|logout>Authenticate with a relay. Not required for OSS relays running on loopback (the default), where auth is automatically disabled. Required for kutlhub and any relay bound off-loopback (where KUTL_RELAY_REQUIRE_AUTH defaults to true). --relay defaults to the kutlhub URL wss://relay.kutlhub.com/ws; pass an explicit URL to authenticate against a self-hosted relay.
| Subcommand | Description |
|---|---|
login [--token <TOKEN>] [--relay <URL>] | Authenticate via OAuth device flow (opens browser), or store a token directly with --token |
token <TOKEN> [--relay <URL>] | Store a personal access token for a relay |
logout | Delete stored credentials |
Credentials are stored in ~/.kutl/auth.json. The KUTL_TOKEN environment variable takes precedence over stored credentials. To see which identity is currently active, use kutl status.
kutl config
kutl config set <key> <value>Set your local identity (DID) configuration. To read the current identity and other client state, use kutl status.
| Subcommand | Description |
|---|---|
set <key> <value> | Set a config value. Valid keys: name, email |
Example
kutl config set name "Alice"
kutl config set email "[email protected]"
kutl statuskutl watch
kutl watchWatch a space for signals. Runs as a Claude Code channel and MCP tool server over stdio. Must be invoked inside a space directory. This enables AI agents to participate in kutl spaces by receiving flags and making edits through the sync protocol.
kutl surface
kutl surface [--dir <path>]Copy documents from the space into a parent directory (or a configured surface target). Intended for git coexistence: kutl is the source of truth for documents, and surface lifts them into your git working tree. Always overwrites the target.
Requires a [surface] section in .kutlspace with a target path configured.
kutl log
kutl log <path>Show the change history of a .dt document file. Displays changes in reverse chronological order, similar to git log.
Example
kutl log .kutl/docs/notes.dtFiles and directories
| Path | Purpose |
|---|---|
~/.kutl/identity | DID keypair (ed25519) |
~/.kutl/auth.json | Stored auth tokens (per-relay) |
~/.kutl/daemon.pid | Running daemon PID |
~/.kutl/logs/daemon.log | Daemon output log |
.kutlspace | Team-wide space config (safe to commit) |
.kutl/space.json | Per-installation runtime config (space ID, relay URL) |
.kutl/docs/ | Document storage (.dt files) |