The napdock CLI
One signed executable that gives agents, scripts and people the same account features as the app: 63 commands, JSON in and out, and everything needed to use it correctly built in.
Overview
Napdock doesn't replace your coding agent. Anything that can run a shell command can work in a cloud workspace, run an agent and save immutable checkpoints. The Mac app uses the same authenticated API to show sessions and their saved results.
Everything except discovery needs a Napdock account, which opens with the public release. The app itself works without the CLI or an account.
napdock version{"kind":"version","schemaVersion":1,"version":"0.1.0","platform":"macos"}napdock describe start-agentnapdock agent-guide | head -4Napdock agent syncStart with `napdock commands`, then `napdock describe COMMAND` and`napdock schema COMMAND`. These run offline without credentials. Schemas
Install and sign in
The CLI is a signed macOS executable that installs to
~/.local/bin/napdock. Updates replace it atomically and
keep the previous version for rollback.
napdock login opens your browser and waits for approval.
The CLI keeps its own credentials in macOS Keychain and never prints
access tokens.
auth-status verifies the session and logout
revokes it.
Discovery
Start with the catalog, read the schema for a command, then send one structured request. These commands run offline without credentials, and schemas are generated from the installed binary's protocol.
-
napdock commands - The full catalog, with each command's effect and whether it needs confirmation.
-
napdock describe CMD - Usage, effect and suggested next commands.
-
napdock schema CMD - The JSON Schema for the command's input.
-
napdock agent-guide - Orchestration and recovery instructions written for agents.
napdock commands | jq '.commands | length'69napdock agent-guide | head -3Napdock agent syncDiscover the installed contract with commands, describe COMMAND, schema COMMANDnapdock describe start-agent | jq -c '{summary, usage, next}'{"summary":"Start a native agent with a stable operation ID.","usage":"napdock start-agent --input request.json [--wait] [--dry-run]","next":["agent-status","submit"]}
Requests and dry runs
Every workflow accepts --input request.json or
--input - for stdin. The object is the complete versioned
request from the command's schema, and it never contains credentials.
Writes carry an operation ID. Repeat an uncertain request with the
same ID and input to get the original receipt instead of a duplicate.
--dry-run validates a request offline; it doesn't check
ownership, revisions, quota or availability.
printf '{"kind":"create_objective"}' | napdock work-update --project demo --revision 3 --operation op-1 --action-file - --dry-runInvalid input. Use napdock commands, describe COMMAND, or schema COMMAND; validate with --dry-run. Confirmation commands require --confirm.{"kind":"error","schemaVersion":1,"code":"INVALID_REQUEST"}
Effects and confirmation
Each command declares its effect in the catalog. Destructive and
publishing steps need an explicit --confirm after review,
and the server still checks the digest, ownership and operation state.
| Effect | Commands | Meaning |
|---|---|---|
read
|
23 | Reads state. Safe to repeat. |
write
|
34 | Changes state under an operation ID; retries return the same receipt. |
destructive
|
0 | Rewrites a branch. Requires --confirm after a reviewed digest. |
publish
|
0 | Publishes saved state outside Napdock. |
browser
|
4 | Opens an authenticated page in the system browser. |
local
|
8 | Runs on this machine only, such as sign-in or discovery. |
Agent sync workflow
Choose a session, start the native agent in a cloud container, submit work and wait for its durable checkpoint. Inspect saved commits before moving the session back to your Mac.
napdock sessions --project PROJECT_IDnapdock start-agent --input agent.json --waitnapdock submit --input turn.json --waitnapdock history --input history.json
Exit codes
-
0 - The read or action succeeded, or the submission was accepted.
-
1 - The remote task failed or was interrupted, a conflict or not-found, or the session closed without the selected result.
-
2 - Invalid command or input.
-
3 - Sign-in required.
-
4 - A durable operation is pending, busy or needs recovery. Inspect the receipt.
-
5 - Service, response, credential storage, configuration or local I/O failure.
-
124 - The local wait deadline expired.
-
130 - Local observation was cancelled.
Command reference
All 63 commands, generated from the catalog that ships with
the binary. Run
napdock describe CMD for the same information locally.
Discovery and setup 9 Catalog, schemas and the orchestration guide. These run offline.
-
doctorCheck platform and build configuration without accessing credentials.
napdock doctor -
completionsPrint shell command completion for bash, zsh or fish.
napdock completions bash|zsh|fish -
commandsList every command and its effects.
napdock commands -
describeRead command metadata and next steps.
napdock describe COMMAND -
schemaPrint a workflow command's exact input JSON Schema.
napdock schema COMMAND -
agent-guideRead the orchestration and recovery guide.
napdock agent-guide -
versionRead binary version and contract version.
napdock version -
new-operation-idGenerate an operation ID to persist before mutation.
napdock new-operation-id -
waitObserve one task's completion without interrupting remote work.
napdock wait --project ID --branch ID --session ID --operation ID [--cursor N] [--timeout SECONDS]
Account 5 Sign in through the browser and connect GitHub.
-
loginSign in through the browser; credentials stay in Keychain.
napdock login -
logoutRevoke this CLI identity session.
napdock logout -
auth-statusVerify the CLI's saved authentication.
napdock auth-status -
github-connectAuthorize GitHub for a repository using browser device flow.
napdock github-connect --repository ID -
github-disconnectRemove a repository's saved GitHub credential.
napdock github-disconnect --repository ID
Projects and imports 10 List projects and agent sessions, import repositories.
-
import-localImport a reviewed local folder snapshot.
napdock import-local --input request.json [--dry-run] -
importsList import receipts; continue with after.
napdock imports --input request.json [--dry-run] -
projectsList projects; continue with after.
napdock projects --input request.json [--dry-run] -
sessionsList project agent workspace streams; continue with after.
napdock sessions --input request.json [--dry-run] -
rename-sessionRename a session, or clear its name with a null title.
napdock rename-session --input request.json [--dry-run] -
archive-sessionArchive a session, or restore it with state active.
napdock archive-session --input request.json [--dry-run] -
discard-sessionRemove a side chat for good, with its forked conversation.
napdock discard-session --input request.json [--dry-run] -
import-githubImport a GitHub repository using its saved Keychain connection.
napdock import-github --input request.json [--dry-run] -
read-importRead an import receipt by its original operation ID.
napdock read-import --input request.json [--dry-run] -
new-sessionStart a new session in a project from device files or a saved checkpoint.
napdock new-session --input request.json [--dry-run]
History and files 5 Read checkpoints, compare saved commits and read files.
-
historyRead a history page; continue with after and the same snapshot.
napdock history --input request.json [--dry-run] -
compareRead a file-comparison page for two immutable commits.
napdock compare --input request.json [--dry-run] -
file-diffRead a selected file diff for two immutable commits.
napdock file-diff --input request.json [--dry-run] -
branch-filesList a directory at an owned branch saved commit.
napdock branch-files --input request.json [--dry-run] -
branch-fileRead a project file at an owned branch saved commit.
napdock branch-file --input request.json [--dry-run]
Workspaces 15 Open an agent workspace, edit files and run commands in it.
-
workspace-serveStart one managed preview server using argv; save and expiry stop it automatically.
napdock workspace-serve --input PATH|- [--wait] [--dry-run] -
workspace-stop-serverStop the managed preview server without closing the workspace.
napdock workspace-stop-server --input PATH|- [--wait] [--dry-run] -
workspace-openTake exclusive remote workspace ownership at an exact commit.
napdock workspace-open --input PATH|- [--wait] [--dry-run] -
workspace-statusRead remote ownership, revision, expiry and saved commit.
napdock workspace-status --input PATH|- [--wait] [--dry-run] -
workspace-saveClose remote ownership, checkpoint to Artifacts and resume the branch.
napdock workspace-save --input PATH|- [--wait] [--dry-run] -
workspace-recoverResume a failed save; an uncertain command is never rerun and its partial changes are retained.
napdock workspace-recover --input PATH|- [--wait] [--dry-run] -
workspace-readRead a remote UTF-8 file and its SHA-256 for safe editing.
napdock workspace-read --input PATH|- [--wait] [--dry-run] -
workspace-writeCreate, replace or delete a remote file using its expected hash and workspace revision.
napdock workspace-write --input PATH|- [--wait] [--dry-run] -
workspace-execRun argv in the remote workspace. Use rg, find, git diff, builds and tests with bounded output.
napdock workspace-exec --input PATH|- [--wait] [--dry-run] -
workspace-syncApply a local file delta with explicit deletions and per-file hashes as one recoverable batch.
napdock workspace-sync --input PATH|- [--wait] [--dry-run] -
workspace-read-manyRead a bounded set of files and hashes at the current workspace revision.
napdock workspace-read-many --input PATH|- [--wait] [--dry-run] -
workspace-checkpointCheckpoint to Artifacts and retain exclusive remote ownership at the new commit.
napdock workspace-checkpoint --input PATH|- [--wait] [--dry-run] -
workspace-exec-asyncRun a durable bounded job; poll or cancel it by the original operation ID.
napdock workspace-exec-async --input PATH|- [--wait] [--dry-run] -
workspace-jobRead a job receipt without replaying execution.
napdock workspace-job --input PATH|- [--wait] [--dry-run] -
workspace-cancelRequest cancellation of the exact active job and await its settled receipt.
napdock workspace-cancel --input PATH|- [--wait] [--dry-run]
Built-in agent 6 Start a native agent, send turns and stream events.
-
agent-statusInspect the agent session.
napdock agent-status --input request.json [--dry-run] -
start-agentStart a native agent with a stable operation ID.
napdock start-agent --input request.json [--wait] [--dry-run] -
recover-agent-startRecover agent startup using its original operation and inputs.
napdock recover-agent-start --input request.json [--dry-run] -
submitSubmit a task to a branch session with a stable operation ID.
napdock submit --input request.json [--wait] [--dry-run] -
interruptInterrupt the branch session's active task.
napdock interrupt --input request.json [--dry-run] -
eventsRead ordered session events after an exclusive cursor.
napdock events --input request.json [--dry-run]
Previews 4 Expose a port behind an authenticated preview URL.
-
previewsList branch previews.
napdock previews --input request.json [--dry-run] -
expose-previewExpose a named application port.
napdock expose-preview --input request.json [--dry-run] -
unexpose-previewRevoke and clean up a preview.
napdock unexpose-preview --input request.json [--dry-run] -
launch-previewOpen an authenticated preview in the system browser.
napdock launch-preview --input request.json [--dry-run]
Terminals 5 Open, hand off and close an agent workspace terminal.
-
handoff-terminalSave a checkpoint and move the branch workspace to the selected execution target.
napdock handoff-terminal --input request.json [--dry-run] -
open-terminalOpen an authenticated terminal in the system browser.
napdock open-terminal --input request.json [--dry-run] -
terminal-statusRead terminal ownership and checkpoint progress.
napdock terminal-status --input request.json [--dry-run] -
close-terminalClose terminal ownership and checkpoint work.
napdock close-terminal --input request.json [--dry-run] -
recover-terminalRecover interrupted terminal ownership.
napdock recover-terminal --input request.json [--dry-run]
Plugins 1 Install, grant and revoke MCP plugins for agents.
-
plugin-controlList, install, remove, grant or revoke plugins, and set a plugin's scope or account.
napdock plugin-control --input request.json [--dry-run]
Resources 3 Read and change resource ceilings.
-
resource-settingsRead resource ceilings and their revision.
napdock resource-settings --input request.json [--dry-run] -
save-resource-settingsSave ceilings using the expected revision.
napdock save-resource-settings --input request.json [--dry-run] -
retry-resource-cleanupRetry the exact stalled cleanup through its original fenced coordinator; never force-release a slot.
napdock retry-resource-cleanup --input request.json [--dry-run]