CLI
Commands
Every CLI command and flag.
Every command prints help with --help. Commands marked JSON accept --json for machine-readable output; progress goes to stderr. With --json, usage errors are JSON too.
Account and target
| Command | What it does | JSON |
|---|---|---|
statefold login [--device-name <name>] | Sign in to the active target with a device code. | |
statefold logout [--all] | Remove sign-in for the active target; --all removes every target's after confirmation. | |
statefold account | Show sign-in status for Local and Staging. | Yes |
statefold use local|staging | Select the target for this repository. | |
statefold config | Show the active target configuration for this repository. | Yes |
statefold doctor [--confirm-sensitive] | Inspect repository, target and credential state. | Yes |
Connections
| Command | What it does | JSON |
|---|---|---|
statefold connections | List your coding-agent connections on the active target. | Yes |
statefold connect codex [--label <name>] | Connect a ChatGPT Codex subscription with device authorization. | |
statefold connect claude-code [--label <name>] [--auth-mode claude-subscription|api-key] | Connect a reusable Claude subscription with the installed Claude Code CLI (claude setup-token). --auth-mode api-key opens the browser API-key form instead. | |
statefold connect opencode|pi|gemini [--label <name>] | Open the browser form for that agent and wait for it. |
Threads
| Command | What it does | JSON |
|---|---|---|
statefold task new "<prompt>" | Upload this checkout and open a new thread on it. | Yes |
statefold task list | List threads and their current statuses. | Yes |
statefold task open <task-id> | Open a thread in the browser. | Yes |
statefold task result <task-id> [--output <new-directory>] | Download the saved result into a new directory. | Yes |
statefold task apply <task-id> [--output <new-directory>] | Download the saved result and apply it to the original checkout. | Yes |
statefold task pending --clear | Abandon an interrupted thread admission. |
task new options:
--harness <id>and--model <id>choose the agent and model.--skill <id>adds a skill; repeat it for more.--detachedstarts an empty project without uploading this directory.--no-openprints the thread address instead of opening a browser.
task new uploads the exact local workspace, including uncommitted work, so review what you are sending. If an upload is interrupted, run the same task new again to resume; use task pending --clear only to abandon it.
task list reads saved metadata and never wakes a workspace. task result downloads the last saved result, not unsaved live changes. task apply runs in the original checkout, refuses conflicts without changing HEAD or the index, and keeps a downloaded copy for review.
Skills
| Command | What it does | JSON |
|---|---|---|
statefold skills list [--project <uuid>] | List your skills. | Yes |
statefold skills upload [dir] [--scope local|global] [--project <uuid>] [--usage available|default|required] | Upload a skill or a collection to a project or your personal library. | Yes |
statefold skills show <id> | Show a skill version. | Yes |
statefold skills export <id> <dir> | Export a skill into a new directory. | Yes |
statefold skills remove <name> [--project <uuid>] | Remove a skill from a scope. | Yes |
statefold skills usage <id> --usage available|default|required [--project <uuid>] | Change when agents get a skill. | Yes |
--scope global cannot be combined with --project. An upload that partly fails exits with code 1.