Command Reference

Using the pulse CLI.

pulse has two halves: a light half for finding and running datasets you already know how to describe, and a heavier half that hands your request to an LLM to write the CDC WONDER XML for you. Start with the light half. It's faster, free, and works offline.

1 · Setup

Install it.

Requires Python 3.12+. The LLM-backed commands (further down this page) also need a provider key; everything else works without one.

uv sync

Set an Anthropic key for the default provider, or point pulse at Azure OpenAI instead:

export ANTHROPIC_API_KEY=sk-ant-... # or use Azure OpenAI Foundry instead: export LLM_PROVIDER=azure_openai export AZURE_OPENAI_API_KEY=... export AZURE_OPENAI_ENDPOINT=https://<resource>.openai.azure.com export AZURE_OPENAI_DEPLOYMENT=<deployment-name> export AZURE_OPENAI_API_VERSION=<api-version>

2 · Light usage: finding a dataset

Figure out what's available.

No LLM needed for any of this: it's all local keyword matching over the bundled dataset catalog.

See everything: every dataset pulse knows, grouped by topic:

pulse datasets pulse datasets --topic Mortality # filter by topic pulse topics # just the topic list + counts

Search by plain description: matches datasets and bundled queries by keyword/synonym, no LLM call:

pulse search "opioid overdose deaths by state" pulse search "maternal mortality by race" --datasets # datasets only pulse search "tick-borne disease cases" --queries # bundled queries only

Drill into one dataset: measures, grouping dimensions, bundled examples:

pulse info D176

List the bundled example queries: 36 working queries, ready to run as-is:

pulse list-queries pulse list-queries --dataset D176

Run one: hits the live CDC WONDER API (respects its 15s rate limit):

pulse run drug-deaths-by-year-2018-2024-req.xml pulse run opioid-overdose-deaths-2018-2024-req.xml -f csv -o out.csv

3 · Heavier usage: natural language queries

Ask for something that doesn't exist yet.

These commands call an LLM (Claude or Azure OpenAI, per your LLM_PROVIDER) to turn a plain-English request into CDC WONDER XML. It grounds each request in the closest matching bundled queries (the same examples shown on this site), so the generated XML follows real, working parameter combinations instead of guessing from scratch.

Build XML without running it: inspect or save it first:

pulse build "drug overdose deaths by state and year 2018-2023" pulse build "maternal mortality by race, 2018-2023" -o maternal-race.xml

Build and run in one step:

pulse query "fentanyl deaths by state 2020-2024" -f csv

Refine an existing query with feedback: starts from real XML (a bundled query or a file you built earlier) instead of a blank prompt:

pulse refine opioid-overdose-deaths-2018-2024-req.xml "break it down by state" pulse refine drug-deaths-by-year-2018-2024-req.xml "show monthly not yearly" --run -f csv

4 · The complicated cases

Comparisons and multi-turn conversations.

Compare two or more causes/datasets side by side: the LLM decides this needs multiple sub-queries, builds each one, and runs them in sequence (respecting CDC's rate limit between calls):

pulse compare "opioid overdose deaths vs suicide deaths by state 2018-2023"

If a request turns out not to be a comparison, compare falls back to running it as a single query and tells you so.

Iterate conversationally: a REPL that keeps the current XML in memory across turns, so each follow-up refines what came before instead of starting over:

pulse chat "drug overdose deaths by year 2018-2024" pulse> break it down by state pulse> :xml # show the current XML pulse> :run # execute it against CDC WONDER pulse> :save drug-deaths-by-state.xml pulse> :exit

Anything not prefixed with : is treated as another round of natural-language feedback on the current query.