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.

FlagTypeDefaultDescription
--relayURLws://127.0.0.1:9100/wsRelay WebSocket URL
--namestringauto-generatedHuman-readable space name
--dirpathcurrent directoryTarget directory
--subfolderstring"kutl" (prompted)Subfolder name inside a git repo

Example

kutl init --name my-project

kutl 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.

FlagTypeDefaultDescription
--relayURLRelay WebSocket URL (inferred from target when possible)
--dirpathcurrent directoryTarget directory
--subfolderstringSubfolder 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/ws

kutl 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.

FlagTypeDefaultDescription
--dirpathcurrent directoryTarget directory

kutl daemon

kutl daemon <run|start|stop|status>

Manage the background daemon that watches files and syncs with the relay.

SubcommandDescription
runRun in the foreground (watches all registered spaces)
startStart as a background process (PID written to ~/.kutl/daemon.pid)
stopStop the running daemon (graceful SIGTERM, then SIGKILL)
statusShow daemon status and list registered spaces

Example

kutl daemon start
kutl daemon status
# daemon is running (PID 12345)
#   /path/to/project: my-project (ws://127.0.0.1:9100/ws)

kutl auth

kutl auth <login|token|status|logout>

Authenticate with a relay. Not required for OSS relays with authentication disabled. Required for kutlhub and relays with KUTL_RELAY_REQUIRE_AUTH=true.

SubcommandDescription
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
statusShow current authentication status (token prefix, account, relay)
logoutDelete stored credentials

Credentials are stored in ~/.kutl/credentials. The KUTL_TOKEN environment variable takes precedence over stored credentials.

kutl config

kutl config <set|show>

View or update your local identity (DID) configuration.

SubcommandDescription
set <key> <value>Set a config value. Valid keys: name, email
showShow current DID, name, and email

Example

kutl config set name "Alice"
kutl config set email "[email protected]"
kutl config show

kutl watch

kutl watch

Watch 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.dt

Files and directories

PathPurpose
~/.kutl/identityDID keypair (ed25519)
~/.kutl/credentialsStored auth tokens (per-relay)
~/.kutl/daemon.pidRunning daemon PID
~/.kutl/logs/daemon.logDaemon output log
.kutlspaceTeam-wide space config (safe to commit)
.kutl/space.jsonPer-installation runtime config (space ID, relay URL)
.kutl/docs/Document storage (.dt files)