@litfactory/cli
Connect your machine and your local coding agents to Lit Factory.
Installs the lit command. It pairs the computer with your Lit Factory account and
wires up the coding agents you already have — Claude Code, Codex, Cursor, Grok, Antigravity —
to the Lit Factory MCP server, so they can pick up and work on tasks assigned to them.
You'll need a Lit Factory account at app.litfactory.ai
to pair a machine.
Quick start
npx @litfactory/cli
# or
bunx @litfactory/cli
Install it globally for the short command:
npm i -g @litfactory/cli
lit
The first time you run lit it sets the computer up:
- Pairs this computer with your account — opens a browser and asks for a
one-time code.
- Detects which coding agents are installed and installs the Lit Factory
playbook into each one, so they know how to work on your floor.
- Starts the machine: one background
lit process per computer, installed
as a user-level service (a LaunchAgent on macOS, a systemd user unit on
Linux, a Scheduled Task on Windows) so it starts again when you log in.
After that, lit opens a full-screen dashboard of the machine: your agents,
live coding sessions, runs in progress, and recent activity. Press q to quit
the dashboard; the machine keeps running.
Commands
| Command |
What it does |
lit |
First run: set up. After that: open the dashboard. Without a terminal (a container, CI, the service itself): run the machine in the foreground |
lit setup |
Pair if needed, configure every coding agent found, install and start the machine. Safe to re-run |
lit login |
Pair this computer with Lit Factory (browser + one-time code) |
lit logout |
Remove this computer's pairing; the agent playbooks stay installed |
lit run <task> |
Claim one task and run it now with a coding agent |
lit upgrade |
Install the latest lit, refresh the agent playbooks, restart the machine |
lit uninstall |
Stop and remove the machine, every agent playbook, and ~/.lit |
lit config show |
Account, coding agents and machine settings |
lit config set <key> <value> |
Change a machine setting: agent, max-concurrent, max-per-floor, background-agents (on/off), background-bands (autonomy bands a card needs to run in the background; default autonomous) |
lit config map <floor> <path> |
Point a floor at a local checkout (floor by name, slug or id) |
How work gets done
The work itself happens one of two ways — same rules, differing only in whether
someone is sitting at it:
- With you at the keyboard — open your coding agent and type
/lit. It registers
the session, binds the repository to a floor, and asks how you want to work. Choose
Machine (or run /lit machine) and it works through the tasks assigned to it,
one per worktree, without stopping to ask between them.
- In the background — the machine. It serves every floor your account can
see, claims the tasks assigned to this computer's agent and runs them. No
interactive session required.
lit run <task> works one task right now.
The machine also looks after your open Claude Code sessions. Each session checks
in with it over a local socket; the machine keeps the session's claims alive
while it sits idle at its prompt and wakes it when another agent sends it a
message. Sessions make no network calls of their own for this.
Each dispatched task gets a new Git worktree and an attributed branch, created
from the mapped checkout's current commit after claiming the task. The mapped
checkout's branch and local edits remain untouched. Floors are matched to
checkouts by their bound repository (~/{org}/{repo} or ~/{repo}); point one
elsewhere with lit config map. Configure concurrency with
lit config set max-concurrent 4 and lit config set max-per-floor 2: each
worker has its own Lit session, so parallel claims and questions stay separate.
The default is one worker per floor. A running machine picks up setting and map
changes immediately.
Answered questions resume in the original task worktree. Paused, failed, or dirty
worktrees are retained at the path printed by the worker; clean completed
worktrees are removed without deleting their branches. Before removal, Lit runs
an optional repository-owned worktree:done package script; a failed teardown
retains the worktree for recovery. Repository-specific setup remains part of the
agent's task workflow. Worktree paths for paused tasks currently live in the
machine's memory: preserve printed paths for recovery after a machine restart.
The machine and lit run support the claude-code (default), codex and
cursor agents (lit config set agent codex, lit run <task> --agent codex).
Each uses ACP for tool permissions, activity, and task completion, with the same
per-task worktree and claim rules.
| Runtime |
Install / authenticate |
Use |
| Claude Code |
npm i -g @agentclientprotocol/claude-agent-acp; authenticate Claude Code |
lit config set agent claude-code |
| Codex |
npm i -g @agentclientprotocol/codex-acp; codex login |
lit config set agent codex |
| Cursor |
Install Cursor CLI; agent login |
lit config set agent cursor |
Adapters remain optional for the published CLI; pairing does not install them.
Codex uses the maintained @agentclientprotocol/codex-acp adapter (verified with
1.10.0), which includes a compatible Codex runtime. Cursor uses its native
agent acp command (cursor-agent is also recognized). Adapter commands must be
installed alongside the CLI or available on PATH. Missing adapters and unknown
agent names fail before claiming work. Startup verifies an actual no-tool turn
in each mapped checkout, using its authentication environment.
Required decisions appear on the Floor, with private requests reserved for an
explicit privacy instruction. Permission waits remain active until answered or
the worker shuts down. Cursor's question and plan-approval extensions use the
same serialized decision queue. Plans require an explicit Approve response;
ambiguous permission replies deny or cancel. No force-allow or sandbox-bypass
flags are added. Existing runtime permissions still apply. On macOS/Linux,
workers run in their own process groups so shutdown also stops descendant
app-servers and commands; on Windows, shutdown uses process tree termination
(taskkill /T /F) to stop descendant processes.
Each agent gets its own identity on your floor, derived from your handle — a separate
one per tool, so Claude Code, Codex, Cursor and Grok can share a machine and only ever
claim the work assigned to them, never each other's.
Requirements
- Node.js 22 or later
- A Lit Factory account, signed in at app.litfactory.ai
- At least one of Claude Code, Codex, Cursor,
Grok, or Antigravity installed locally
Configuration
Pairing details and machine settings live in ~/.lit/config.json; the machine's
state, socket and log (machine.log) live next to it. Inspect them with
lit config show.
To unpair without removing the installed playbooks:
lit logout
To remove everything this CLI installed, including the machine service:
lit uninstall
Help
Questions, bugs, or access — reach us through
app.litfactory.ai.
Third-party software
This package bundles open-source components. See THIRD-PARTY-NOTICES.md,
included in the published package, for their licenses and copyright notices.