CLI
@trydock/cli is a thin wrapper over the REST API. No install step. Run it straight with npx.
Install
npx -y @trydock/cli initSkipping npm i -g avoids the sudo prompt on default macOS npm setups (where /usr/localis root-owned). Agents driving the CLI — Claude Code, Cursor, etc. — can't sudo, so npx is the safer install path. Pin a version if you need reproducibility: npx -y @trydock/cli@0.6.0.
npm install -g @trydock/cli
dock initAuth & config
On first run the CLI opens your browser to sign in via OAuth 2.1 + PKCE, then writes ~/.dock/config.json (mode 0600) with your refresh token and active workspace. Env-var overrides: DOCK_API_KEY and DOCK_API_URL (useful for staging).
Signing up with a referral
Dock is invite-only during beta. If a friend sent you a link like trydock.ai/invite/abc123, you can sign up purely from the terminal by passing it to dock init:
# Bare code
npx -y @trydock/cli init --ref abc123
# Or paste the whole invite URL
npx -y @trydock/cli init --ref https://trydock.ai/invite/abc123The CLI threads the code into the OAuth handoff. The login page forwards it to the server, where the invite-only gate accepts the new email when the code resolves to a real org. Without --ref, an unknown email is added to the waitlist instead.
First-run walkthrough
$ npx -y @trydock/cli init
◐ Opening browser for sign-in...
✓ Authenticated as you@example.com (Vector Apps)
✓ Workspace created → trydock.ai/welcome
✓ API key saved to ~/.dock/config.json
Try next:
dock rows welcome
dock add welcome title="My first row"
dock open welcomeCommands
Auth
dock init [name] [--ref <code|url>]dock init --ref abc123dock login [--ref <code|url>]dock login --ref https://trydock.ai/invite/abc123dock logoutdock whoamidock sessions logout-allWorkspaces
dock listdock listdock new <name> [--doc]dock new research-queuedock open <slug>dock rename <slug> <new-name>dock rename old-q4 q4-launchdock visibility <slug> <private|org|unlisted|public>dock delete <slug>dock share <slug> <email> [role]dock share q4-launch mike@vector.build editordock members <slug>dock columns <slug>Rows
dock rows <slug>dock rows content-pipelinedock add <slug> key=val ...dock add content-pipeline title="First" status="drafted"dock get <slug> <row-id>dock set <slug> <row-id> key=val ...dock remove <slug> <row-id>dock history <slug> <row-id>Doc-mode workspaces
dock doc <slug>Agent-to-agent transport (scp for docs)
dock push <name> [--workspace <slug>] [--from <file>]echo "agent-1 said: ..." | dock push report.mddock pull <name> [--workspace <slug>] [--prompt <text>]dock pull report.md --prompt="summarize across agents" | claudeWebhooks (one endpoint per org)
dock webhook listdock webhook listdock webhook add --url <url> [--events ...]dock webhook add --url https://hooks.example.com/dock --events "row.updated,workspace.renamed"dock webhook pause <id>dock webhook resume <id>dock webhook rm <id>dock webhook deliveries <id>API keys
dock keysdock key new --name <n> [--workspace <slug>]dock key new --name "Argus prod"dock key revoke <id>Profile / Org
dock profiledock profile set --name <name>dock orgdock org set --name <name> [--visibility private|org]Billing
dock billingdock billing upgrade <pro|scale> [--annual]dock billing downgradedock billing portalSupport
dock supportdock supportdock support new --kind <...> --title "..." --body "..."dock support new --kind bug --title "Row 409 on retry" --body "Steps..."dock support show <id>Referrals
dock referralsdock referrals linkdock referrals link | pbcopyData
dock export [--out FILE]Common
dock helpdock --jsonPiping into scripts
Every command supports --json for machine output:
$ dock list --json | jq '.workspaces[] | select(.mode=="table") | .slug'
"content-pipeline"
"research-queue"
"investor-tracker"
$ dock rows content-pipeline --json | jq '.rows | map(select(.data.status=="sealed")) | length'
31
$ dock keys --json | jq '.keys[] | select(.revokedAt == null) | .id'Source
The CLI is open source at github.com/try-dock-ai/cli. File issues, send PRs, or read the code to see exactly what it does before pasting it into your terminal.
Related: Quickstart · REST API
Frequently asked questions
- What can I do with the Dock CLI?
- Drive every Dock operation from your terminal. ~30 commands cover workspaces, surfaces, rows, doc bodies, agents, API keys, webhooks, billing, search, events. Install via `npx -y @trydock/cli`.
- Is the Dock CLI free?
- Yes, fully free and open-source. Counts against your Dock plan's normal API rate limit (Free 10K/mo, Pro 100K, Scale 1M); the CLI itself doesn't add any cost.
- Do I need to install the Dock CLI to use Dock?
- No. The dashboard + REST API + MCP server work without it. The CLI is a convenience for terminal-first workflows: scripting, CI, agent provisioning, bulk operations. Use it when terminal beats browser for the task.
- Does the Dock CLI work with my AI agent?
- Yes. Use it to mint per-agent `dk_` keys (`dock key new --name "Argus"`), provision per-project workspaces, archive completed work, export workspace state. The CLI is a first-class agent-ops tool.
- How do I see all available Dock CLI commands?
- `dock --help` lists top-level commands; `dock <command> --help` drills into each. Or browse the full catalog at `/docs/cli`. Tab completion is supported via `dock completion <bash | zsh | fish>`.
- Can I use the Dock CLI in a CI pipeline?
- Yes. Set `DOCK_API_KEY` as a CI secret; the CLI uses it without a login flow. Exit codes are stable: 0 success, 1 user error, 2 server error. Output via `--output json` is grep-friendly.
- Does the Dock CLI work offline?
- No. Every command hits Dock's REST API live. There's no local cache or offline mode; if your network is down, commands fail with a connection error.
- Is the Dock CLI source open?
- Yes, MIT-licensed. Source at `github.com/try-dock-ai/cli`. Contributions welcome; the CLI is a thin wrapper around Dock's REST API + OpenAPI spec, so most additions are straightforward.
- How do I report a bug in the Dock CLI?
- Open an issue at `github.com/try-dock-ai/cli/issues` with `dock --version` output and the command + flags that triggered the bug. Or `dock support new "CLI bug: …"` from the CLI itself; routes to the same place.
- Does the Dock CLI support shell completion?
- Yes, via `dock completion <shell>`. Outputs the completion script for bash, zsh, fish. Source it in your `.bashrc` / `.zshrc` for tab completion of subcommands, flags, and workspace slugs.