command line

Share markdown.
Collect feedback.
Never leave the shell.

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.

# install globally
$ npm install -g draftmark

# save your account key globally
$ dm login --api-key acct_xxxx
✓ Credentials saved

# publish (stdin works too: cat plan.md | dm create -)
$ dm create plan.md --agent
✓ Document created
URL: draftmark.app/share/a1b2c3d4

# poll for feedback, pipe as JSON
$ dm comments --json | jq
// the flow
00

Install & log in

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.

$ npm install -g draftmark
$ dm login --api-key acct_xxxx

# or skip login: export DM_API_KEY=acct_xxxx
01

Create a doc

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 plan.md --agent
# stdin
$ cat plan.md | dm create -

✓ Document created
URL: draftmark.app/share/a1b2c3d4
02

Share the link

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.

# .draftmark.json (gitignored)
{
  "slug": "a1b2c3d4",
  "api_key": "acct_xxxx"
}
03

Collect feedback

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.

$ dm comments --since 2026-07-01
$ dm comments --format minimal
alice: section 3 needs a rollback plan
bob [agent]: LGTM, ship it
04

Iterate & close

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 comments --json | jq
$ dm update revised.md
$ dm close

# exit 0 ok · 2 auth · 3 not found · 4 conflict
// built for the terminal
[|]

stdin & pipes

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.

[json]

JSON output

--format json (or table / minimal) on any read command. Pipe comments straight into jq or your agent's context — no scraping.

[⚡]

Agent badge

--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-4]

Scriptable exit codes

0 ok, 1 error, 2 auth, 3 not found, 4 conflict. Structured JSON errors too — branch on results in CI or a shell script.

[cfg]

Layered config

Resolves credentials in order: CLI flags → env vars (DM_API_KEY) → .draftmark.json → global config from dm login. Sensible defaults, easy overrides.

[+]

Rich metadata

--meta '{...}' attaches arbitrary JSON, --expected-reviews and --deadline configure the review lifecycle at create time.

[-q]

Quiet mode

-q silences everything but the essentials — clean output for logs and pipelines. --since filters comments by date for incremental polling.

[url]

Self-host ready

--base-url points the CLI at any Draftmark instance. Same commands, your own host. dm whoami confirms who you're acting as.

// example: full loop
setup (once)
$ npm install -g draftmark
$ dm login --api-key acct_xxxx
# key stored in ~/.config/draftmark
agent or human writes plan.md
publish
$ dm create plan.md --agent --expected-reviews 2
# → URL saved to .draftmark.json, posted to the PR
team reviews at draftmark.app/share/a1b2c3d4
iterate
$ dm status
# review_complete: true
$ dm comments --json | jq
$ dm update revised.md
$ dm close

Markdown review,
one command away.

npm install -g draftmarkget the Claude Code skill →