| name | pp-nejm |
| description | Browse, search, and triage New England Journal of Medicine articles from the terminal Trigger phrases: `what's in the current NEJM issue`, `search NEJM for`, `get NEJM article`, `recent NEJM articles`, `NEJM articles on`, `use nejm`, `run nejm`. |
| author | laci141 |
| license | Apache-2.0 |
| argument-hint | <command> [args] | install cli|mcp |
| allowed-tools | Read Bash |
| metadata | {"openclaw":{"requires":{"bins":["nejm-pp-cli"]},"install":[{"kind":"go","bins":["nejm-pp-cli"],"module":"github.com/mvanhorn/printing-press-library/library/health/nejm/cmd/nejm-pp-cli"}]}} |
New England Journal of Medicine โ Printing Press CLI
Prerequisites: Install the CLI
This skill drives the nejm-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
- Install via the Printing Press installer. It defaults binaries to
$HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:
npx -y @mvanhorn/printing-press-library install nejm --cli-only
- Verify:
nejm-pp-cli --version
- Ensure the reported install directory is on
$PATH for the agent/runtime that will invoke this skill.
If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.4 or newer). This installs into $GOPATH/bin (default $HOME/go/bin), so add that directory to $PATH instead:
go install github.com/mvanhorn/printing-press-library/library/health/nejm/cmd/nejm-pp-cli@latest
If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.
NEJM has no public API. This CLI builds an offline-queryable, agent-native corpus of NEJM articles sourced from OpenAlex's CC0 scholarly index (abstracts, authors, publication types, open-access flags), plus per-article metadata by DOI and full-text search over everything you have synced. Novel local-state commands like 'since', 'digest', 'reading-list', 'trends', and 'open-access' do things the website and PubMed wrappers cannot.
When to Use This CLI
Use this CLI when an agent or clinician needs current peer-reviewed NEJM literature metadata programmatically: the current issue, recently published articles, an article's abstract and bibliographic data by DOI, or an offline searchable corpus filtered by specialty, type, author, or free-access. It is the right choice when you want structured, composable output without driving a Cloudflare-gated browser.
Anti-triggers
Do not use this CLI for:
- Do not use this CLI to read full article text behind the NEJM paywall; it surfaces abstracts and metadata only.
- Do not use it for a broad multi-journal literature review; use a PubMed/Crossref tool for cross-journal search.
- Do not use the corpus 'search' command before syncing; it searches only locally synced data. For live archive-wide queries without a sync, use 'openalex search'.
Unique Capabilities
These capabilities aren't available in any other tool for this API.
Local state that compounds
-
since โ Show NEJM articles first seen in your local corpus within a time window.
Reach for this when an agent needs only what changed since the last check, not the whole issue.
nejm-pp-cli since 48h --agent
-
digest โ Triage the current issue grouped by specialty or type with abstracts and free/paywalled flags.
Use to summarize the week's NEJM issue in one structured payload instead of fetching each article.
nejm-pp-cli digest --agent
-
reading-list โ Queue NEJM articles by DOI locally and track read/unread state.
Use to persist a clinician's to-read queue across sessions without an account.
nejm-pp-cli reading-list add 10.1056/NEJMoa2506905
Second data source: OpenAlex (CC0)
-
openalex search โ Search NEJM works live in the OpenAlex scholarly index: abstracts, author lists, citation counts, and open-access flags.
Use when you need abstracts or citation counts without syncing and without the Cloudflare-gated NEJM transport; data is CC0-licensed.
nejm-pp-cli openalex search --query "vitamin D" --from-year 2015 --to-year 2026 --per-page 10 --sort cited
Flags: --query (full-text search), --from-year/--to-year (publication-year range), --per-page (1-50, default 20), --sort (cited or date).
Set NEJM_OPENALEX_MAILTO to your email to enroll OpenAlex requests (live search and sync) in the polite pool โ a dedicated, faster server pool. Unset, requests use the anonymous pool.
Corpus analytics
-
trends โ Show how NEJM output distributes by specialty, article type, and issue across the synced corpus.
Use to quantify NEJM coverage patterns no single page exposes.
nejm-pp-cli trends --agent
-
open-access โ Surface free full-text NEJM articles in the corpus, newest first.
Use for unsubscribed readers who can only act on freely-readable articles.
nejm-pp-cli open-access --agent --limit 20
HTTP Transport
This CLI uses Chrome-compatible HTTP transport for browser-facing endpoints. It does not require a resident browser process for normal API calls.
Command Reference
article โ NEJM articles by DOI
nejm-pp-cli article <doi> โ Fetch an NEJM article's metadata and abstract by DOI (e.g. 10.1056/NEJMoa2506905)
specialty โ NEJM specialty sections
nejm-pp-cli specialty โ List NEJM specialty sections
Finding the right command
When you know what you want to do but not which command does it, ask the CLI directly:
nejm-pp-cli which "<capability in your own words>"
which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match โ fall back to --help or use a narrower query.
Recipes
Current issue, agent-native, narrowed fields
nejm-pp-cli current --agent --select articles.doi,articles.title,articles.authors
Return only the fields an agent needs from the current issue, as compact JSON.
What's new in the last two days
nejm-pp-cli since 48h --agent
List articles first seen in the local corpus within the window.
Triage the week by specialty
nejm-pp-cli digest --group specialty --agent
Group the current issue by specialty with one-line abstracts.
Free full-text only
nejm-pp-cli open-access --limit 20 --agent
Surface freely-readable NEJM articles, newest first.
Cite an article
nejm-pp-cli article cite 10.1056/NEJMoa2506905 --format bibtex
Emit a BibTeX entry from the local article record.
Auth Setup
No authentication required.
Run nejm-pp-cli doctor to verify setup.
Agent Mode
Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.
-
Pipeable โ JSON on stdout, errors on stderr
-
Filterable โ --select keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
nejm-pp-cli article mock-value --agent --select id,name,status
-
Previewable โ --dry-run shows the request without sending
-
Offline-friendly โ sync/search commands can use the local SQLite store when available
-
Non-interactive โ never prompts, every input is a flag
-
Read-only โ do not use this CLI for create, update, delete, publish, comment, upvote, invite, order, send, or other mutating requests
Response envelope
Commands that read from the local store or the API wrap output in a provenance envelope:
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}
Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set โ piped/agent consumers and explicit-format runs get pure JSON on stdout.
Agent Feedback
When you (or the agent) notice something off about this CLI, record it:
nejm-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
nejm-pp-cli feedback --stdin < notes.txt
nejm-pp-cli feedback list --json --limit 10
Entries are stored locally at ~/.local/share/nejm-pp-cli/feedback.jsonl. They are never POSTed unless NEJM_FEEDBACK_ENDPOINT is set AND either --send is passed or NEJM_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.
Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
Output Delivery
Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
| Sink | Effect |
|---|
stdout | Default; write to stdout only |
file:<path> | Atomically write output to <path> (tmp + rename) |
webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
Named Profiles
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
nejm-pp-cli profile save briefing --json
nejm-pp-cli --profile briefing article mock-value
nejm-pp-cli profile list --json
nejm-pp-cli profile show briefing
nejm-pp-cli profile delete briefing --yes
Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.
Exit Codes
| Code | Meaning |
|---|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |
Argument Parsing
Parse $ARGUMENTS:
- Empty,
help, or --help โ show nejm-pp-cli --help output
- Starts with
install โ ends with mcp โ MCP installation; otherwise โ see Prerequisites above
- Anything else โ Direct Use (execute as CLI command with
--agent)
MCP Server Installation
- Install the MCP server:
go install github.com/mvanhorn/printing-press-library/library/health/nejm/cmd/nejm-pp-mcp@latest
- Register with Claude Code:
claude mcp add nejm-pp-mcp -- nejm-pp-mcp
- Verify:
claude mcp list
Direct Use
- Check if installed:
which nejm-pp-cli
If not found, offer to install (see Prerequisites at the top of this skill).
- Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the
--agent flag:
nejm-pp-cli <command> [subcommand] [args] --agent
- If ambiguous, drill into subcommand help:
nejm-pp-cli <command> --help.