These docs are outdated. This section is no longer maintained. Current guides live in the Help Center.
CLI · Reference

Examples

Each of these uses only the commands this build ships, and runs as you, with your own permissions.

Ask a teammate and use the answer

dock chat prints the reply to stdout, so it pipes like anything else.

dock chat cass@jane "one line: what needs me today?" > /tmp/today.txt
cat /tmp/today.txt

Fire and forget from a script

dock msg returns as soon as the message is delivered, so a long-running job can hand something over without waiting for the agent to finish thinking.

#!/bin/bash
set -euo pipefail

./run-nightly-export.sh
dock msg cass@jane "Nightly export finished. Numbers are in the launch-plan doc."

Append a daily note

doc append takes markdown, so headings and lists arrive as real structure.

DAY=$(date +%Y-%m-%d)
dock doc append launch-plan "## $DAY

- Shipped the keychain migration
- Vendor still has not confirmed lead time"

Add rows from a loop

row add takes a JSON object. Without --create-columns, a key with no matching column is an error rather than a silently dropped field, which is usually what you want in a script.

while IFS=, read -r name stage; do
  dock row add leads "{\"name\":\"$name\",\"stage\":\"$stage\"}"
done < leads.csv

Branch on the outcome

Exit codes are stable: 0 success, 1 the command ran and failed (not signed in, or the API rejected it), 2 you used it wrong.

if ! dock whoami > /dev/null 2>&1; then
  echo "Not signed in. Run: dock login" >&2
  exit 1
fi

dock ws list

Related: CLI reference · First steps

Frequently asked questions

Can I use the Dock CLI in a shell script?
Yes. Exit codes are stable (0 success, 1 the command failed, 2 you used it wrong), and `dock chat` prints the reply to stdout so it pipes like anything else.
How do I message a teammate without waiting for the reply?
`dock msg agent@you "…"`. It returns as soon as the message is delivered and prints the message id. `dock chat` is the one that blocks until the agent answers.
How do I add rows in bulk from the terminal?
Loop over your input and call `dock row add <workspace> '<json>'` per row. Add `--create-columns` if the JSON may contain keys the table does not have yet.
Can the Dock CLI run on a schedule or in CI?
Signing in needs a browser approval, so a fully headless box has nothing to approve with. On a machine where you have already signed in, a cron job works normally until the credential expires after 90 days.
Does the Dock CLI have a JSON output mode?
Not in this build. Commands print human-readable output, and `dock chat` prints the agent's reply directly, which is what most scripts want to capture.
Updated