Command Reference

Using the pulse CLI.

pulse has two halves: a light half for finding and running data you can already describe, across all nine sources, and a heavier half that hands your request to an LLM to write CDC WONDER XML for you. Start with the light half. It never calls an LLM, so it's faster and needs no provider key.

1 · Setup

Install it.

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

# From PyPI (requires Python 3.11+) pip install pulse-code pulse --help # From uv in this local directory uv run pulse --help
No key needed

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 your data

Figure out what's available.

None of this calls an LLM. It's all local keyword matching over the bundled catalogs, across every source.

Start with a subject if you don't know which source holds what you want. Topics span all nine sources:

pulse topics pulse topics mortality # drill into one
No key needed

Search by plain description. This matches datasets and bundled queries by keyword and synonym, without calling an LLM:

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
No key needed

Or go straight at a source. The nesting is identical whether you want cancer rates or flu hospitalizations:

pulse source # what sources exist pulse source seer # what that source offers pulse source seer mortality --site 55 --sex female -f csv pulse source nssp national --start 202401 -f csv pulse source cdc-open query leading_death --where "year='2015'" -f csv
No key needed

Drill into one WONDER dataset. You get its measures, grouping dimensions, and bundled examples:

pulse source wonder datasets pulse source wonder info D176
No key needed

List the bundled example queries. All 59 work as-is, and every one has an annotated walkthrough in the WONDER XML reference:

pulse source wonder list-queries pulse source wonder list-queries --dataset D176
No key needed

Run one. This hits the live CDC WONDER API, which requires 15 seconds between consecutive requests. pulse waits that out for you:

pulse source wonder run drug-deaths-by-year-2018-2024-req.xml pulse source wonder run opioid-overdose-deaths-2018-2024-req.xml -f csv -o out.csv
No key needed

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. pulse grounds each request in the closest matching bundled queries, the same examples annotated in the WONDER XML reference, so the generated XML follows real parameter combinations instead of guessing from scratch.

Build XML without running it. Use this when you want to inspect or save it first:

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

Build and run in one step:

pulse source wonder query "fentanyl deaths by state 2020-2024" -f csv
Needs LLM key

Refine an existing query with feedback. It starts from real XML, either a bundled query or a file you built earlier, rather than a blank prompt:

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

4 · The complicated cases

Comparisons and multi-turn conversations.

Compare two or more causes or datasets side by side. The LLM decides the request needs multiple sub-queries, builds each one, then runs them in sequence, waiting out CDC's rate limit between calls:

pulse source wonder compare "opioid overdose deaths vs suicide deaths by state 2018-2023"
Needs LLM key

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. This is a REPL that keeps the current XML in memory across turns, so each follow-up refines what came before instead of starting over:

pulse source wonder chat "drug overdose deaths by year 2018-2024"
Needs LLM key

Inside the REPL:

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

pulse treats anything not prefixed with : as another round of natural-language feedback on the current query.