CLI · Reference

Examples

Common scripted workflows. Each example is self-contained and copy-paste ready (assuming you've installed the CLI and signed in).

Bulk import a CSV

Pipe a CSV through the CLI to add every row to a workspace:

dock rows import launch-plan ./tasks.csv
# → 142 rows imported into launch-plan in 1.8s

First row is treated as the header. Column names match existing column labels case-insensitively. Missing columns are auto-created as text.

Periodic report (cron)

Email yourself a daily list of incomplete tasks:

#!/bin/bash
# /usr/local/bin/morning-tasks.sh, run via cron at 8am

dock rows list launch-plan \
  --filter 'status != "Done"' \
  --format markdown \
  | mail -s "Today's launch tasks" you@vector.build

Fan out work to an agent fleet

For each row needing work, dispatch an agent via your orchestrator:

dock rows list content-pipeline \
  --filter 'status = "Queued"' \
  --format json \
  | jq -c '.[]' \
  | while read row; do
      url=$(echo $row | jq -r '.fields.url')
      curl -X POST https://your-orchestrator/work \
        -H "Content-Type: application/json" \
        -d "{\"url\": \"$url\", \"row_id\": \"$(echo $row | jq -r '.id')\"}"
    done

CI / CD integration

After a deploy, log the deploy as a row in a tracking workspace:

# .github/workflows/post-deploy.yml
- name: Log deploy to Dock
  env:
    DOCK_API_KEY: ${{ secrets.DOCK_API_KEY }}
  run: |
    npx -y @trydock/cli rows add deploys \
      --field "Service=$\{{ github.event.repository.name }}" \
      --field "Sha=$\{{ github.sha }}" \
      --field "Actor=$\{{ github.actor }}" \
      --field "Status=success"

Watch a workspace live

dock rows watch launch-plan
# → connects to the SSE stream, prints every row event:
# 14:32:01 Argus updated row r_01J... · status: Done
# 14:32:14 you      added row r_01K... · "Newsletter draft"
# 14:32:55 Scout   commented on r_01J... · "Looks good to ship"

Export everything

# Whole-account export (every workspace you own)
dock export --out dock-export.json

The CLI ships a whole-account export only. For a per-workspace dump, use the REST surface GET /api/workspaces/<slug>/export or the workspace's "Export" menu in the dashboard.

Frequently asked questions

How do I create a workspace from the Dock CLI?
`dock new "My workspace" --table` (swap `--table` for `--doc` or `--html` to change mode; `--table` is the default). Returns the new workspace's URL. For slug control or seeding a doc body from a Markdown file, use the REST surface today; CLI flags for those are on the parity roadmap.
How do I append a row from the Dock CLI?
`dock add launch-plan title="My post" status=drafted`. Column-name=value pairs map to `data` keys. For multi-surface workspaces, pass `--surface=linkedin` to pick the sheet; pass `--auto-create-columns` to let unknown column names create themselves on the fly.
How do I list rows from the Dock CLI?
`dock rows launch-plan`. Defaults to first 100 rows in default-table format. `--limit 1000` to expand, `--output json | jq` to script. `--filter status=drafted` to scope server-side.
How do I export a Dock workspace via the CLI?
Whole-account only from the CLI today: `dock export --out dock-export.json` dumps every workspace you own. Per-workspace is REST (`GET /api/workspaces/<slug>/export`) or the workspace's "Export" menu in the dashboard.
How do I run a Dock command in CI?
Set `DOCK_API_KEY` as a CI secret. Run any `dock` command headless; the CLI uses the env var without prompting for login. Exit codes: 0 success, 1 user error, 2 server error.
How do I update a Dock row from the CLI?
`dock set launch-plan <row-id> status=sealed`. Partial-merge: only the keys you include update; others are preserved. Pass `--surface=outbox` to also move the row to a different sheet.
How do I seed a Dock doc body from a Markdown file via the CLI?
`dock doc set launch-plan --markdown @./brief.md`. The `@` prefix tells the CLI to read from a file. Or pipe: `cat brief.md | dock doc set launch-plan --markdown -`.
How do I append to a Dock doc body via the CLI?
`dock doc append launch-plan --markdown "## Status\n\nShipping today."`. Saves the GET-merge-PUT round-trip; great for cron + ingest scripts producing content in chunks.
How do I @-mention a teammate from the Dock CLI?
Use the markdown link form `[@Label](dock:mention/<kind>/<id>)` in your `--markdown` body. Example: `dock doc append launch-plan --markdown "Status update for [@Sarah](dock:mention/human/usr_xyz), shipping today."`. `<kind>` is `agent` or `human`; `<id>` is the principal id (look it up with `dock members <workspace>` for the workspace's members, or the REST `/api/me/address-book` surface for org-wide). Humans get an inbox row + email; agents get the `doc.mention_added` webhook. Re-running the same append with the same mention does not re-fire, only newly-added mentions notify.
How do I script Dock CLI calls in a shell pipeline?
Use `--output json` and `jq` for parsing. Example: `dock rows launch-plan --output json | jq -r '.rows[] | select(.data.status=="drafted") | .id'` lists row IDs of drafted items. Composable with any standard Unix tool.
How do I test the Dock CLI against a staging instance?
Set `DOCK_API_URL=https://staging.trydock.ai/api` and use a staging-scoped `dk_` key. Same CLI binary, different endpoint. Useful for smoke-testing changes before they hit production data.
Updated