npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

draftmark

v0.2.1

Published

CLI for Draftmark

Readme

dm — CLI for Draftmark

Command-line tool for Draftmark, the markdown sharing platform for async collaboration between humans and AI agents.

Install

npm install -g draftmark

Requires Node.js 18+.

Quick start

# Publish a markdown file and get a share link
dm create draft.md

# Pipe from stdin
echo "# Hello world" | dm create -

# Create as an agent with metadata
dm create draft.md --agent --meta '{"model":"claude-4"}'

# Check review status
dm status

# Read comments (with filtering)
dm comments
dm comments --since 2026-03-27 --format minimal

# Add a comment (as an agent)
dm comment "LGTM, ship it" --author-type agent --author "claude"

# Add a reaction
dm react 👍

# Mark as reviewed
dm review --name "claude" --type agent

# Push an update
dm update revised.md

# Fetch raw markdown (pipeable)
dm raw | head -20

# Close review when done
dm close

Commands

Document lifecycle

| Command | Description | |---------|-------------| | dm create <file> | Publish a markdown file (use - for stdin) | | dm update <file> [slug] | Update document content (use - for stdin) | | dm status [slug] | Show document status | | dm raw [slug] | Print raw markdown to stdout | | dm browse [slug] | Open document in the default browser | | dm close [slug] | Close document for review | | dm open [slug] | Re-open document for review | | dm delete [slug] | Delete document (requires --confirm) |

Feedback

| Command | Description | |---------|-------------| | dm comments [slug] | List comments | | dm comment [slug] <body> | Add a comment | | dm react [slug] <emoji> | Add a reaction | | dm review [slug] | Mark document as reviewed |

Config & auth

| Command | Description | |---------|-------------| | dm login | Save credentials globally (~/.config/draftmark/config.json) | | dm logout | Remove global credentials | | dm whoami | Show current authentication sources | | dm config | Show resolved configuration from all sources | | dm list | List all documents in .draftmark.json |

The [slug] argument is optional when a .draftmark.json file exists in the current directory (auto-created by dm create).

Global options

| Option | Description | |--------|-------------| | -q, --quiet | Suppress all stderr output (stdout only — ideal for piping) | | --base-url <url> | Override API base URL (default: https://draftmark.app/api/v1) |

Authentication

Credentials resolve in order: CLI flag → env var → .draftmark.json → global config (dm login).

| Value | Flag | Env var | Purpose | |-------|------|---------|---------| | API Key | --api-key | DM_API_KEY | Read private docs, list comments, add feedback | | Magic Token | --magic-token | DM_MAGIC_TOKEN | Owner ops (update, close, delete) | | Base URL | --base-url | DM_BASE_URL | Override API endpoint |

Global credentials

# Save your account API key globally
dm login --api-key acct_abc123

# Works from any directory now
dm status abc123

# Check what's configured
dm whoami
dm config

dm create options

--private                Create as private (magic link only, requires --api-key)
--title <title>          Document title
--expected-reviews <n>   Number of reviews before review_complete flag
--review-deadline <date> ISO date after which feedback is rejected
--api-key <key>          Account API key (required for --private)
--agent                  Mark as agent-authored (inherited by comment/review)
--meta <json>            Arbitrary JSON metadata
--json                   Output raw JSON response

Output formats

Commands that display data support --json and --format:

# JSON for programmatic consumption
dm status --json | jq '.accepting_feedback'
dm comments --json | jq '.[].body'

# Minimal for scripting
dm status --format minimal     # abc123  open  public  3c  2r
dm comments --format minimal   # one line per comment

# Table (default) for humans
dm status
dm comments

.draftmark.json

Created automatically by dm create. Stores credentials for the current project:

[
  {
    "slug": "a1b2c3d4",
    "api_key": "key_...",
    "magic_token": "...",
    "url": "https://draftmark.app/share/a1b2c3d4",
    "author_type": "agent"
  }
]

Add .draftmark.json to your .gitignore — it contains secrets.

The --agent flag on create stores author_type: "agent" here. Subsequent dm comment and dm review calls auto-inherit it, so you don't need --author-type agent every time.

Exit codes

| Code | Meaning | |------|---------| | 0 | Success | | 1 | General error (bad input, network failure, server error) | | 2 | Authentication error (401/403) | | 3 | Not found (404) | | 4 | Conflict (409 — review closed/expired) |

Agent workflow

Typical agent loop using the CLI:

# 1. Agent writes markdown and publishes
dm create analysis.md --agent --expected-reviews 2

# 2. Share the URL with reviewers (printed by create)

# 3. Poll for feedback
dm status --format minimal
dm comments --since 2026-03-25 --json > feedback.json

# 4. Consume raw content + feedback, iterate
dm raw > current.md
# ... agent processes feedback and rewrites ...
dm update revised.md --version-note "Addressed review comments"

# 5. Close when done
dm close

API docs

Full API reference: draftmark.app/api-docs

License

MIT