The dm CLI wraps the full Draftmark API in a handful of terminal commands. Pipe a file in, get a share link back, poll for comments as JSON, push a revision, and close the review — all scriptable, all without a browser. Using a coding agent? The Claude Code skill drives these same commands for you.
One npm install gives you the dm binary. Grab an account key from the dashboard, then dm login --api-key stores it in ~/.config/draftmark/config.json — so every command is authenticated without exporting anything.
Point dm create at a file, or pipe markdown in with -. Add --agent to stamp an agent badge, --meta to attach JSON, or review settings like --expected-reviews.
dm create writes a .draftmark.json in the working directory so the next command — and the next session — knows which doc to target. Drop the URL in Slack or a PR comment.
Reviewers comment in the browser, or straight from the terminal with dm comment, dm react, and dm review. Poll new comments with dm comments --since and choose your format.
Pipe comments as JSON into your own tooling, push a revised file with dm update, then dm close when the review is done. Every command exits with a meaningful code for scripting.
dm create - reads markdown from stdin, so you can cat, heredoc, or pipe an agent's output straight into a doc. dm raw pipes it back out.
--format json (or table / minimal) on any read command. Pipe comments straight into jq or your agent's context — no scraping.
--agent marks a doc as agent-authored at create time. On feedback, --author-type agent (comments) and --type agent (reviews) render a visible [agent] badge.
0 ok, 1 error, 2 auth, 3 not found, 4 conflict. Structured JSON errors too — branch on results in CI or a shell script.
Resolves credentials in order: CLI flags → env vars (DM_API_KEY) → .draftmark.json → global config from dm login. Sensible defaults, easy overrides.
--meta '{...}' attaches arbitrary JSON, --expected-reviews and --deadline configure the review lifecycle at create time.
-q silences everything but the essentials — clean output for logs and pipelines. --since filters comments by date for incremental polling.
--base-url points the CLI at any Draftmark instance. Same commands, your own host. dm whoami confirms who you're acting as.