Skip to content

Getting Started

m4bwav edited this page Nov 3, 2026 · 8 revisions

historywright needs Python 3.9 or newer and nothing else: hw.py uses only the standard library. CI runs it on Linux, macOS and Windows with Python 3.9 and 3.14.

Install

As a Claude Code plugin, from the repository's own marketplace:

/plugin marketplace add m4bwav/historywright
/plugin install historywright@historywright

As plain Agent Skills, for any agent that reads them (GitHub Copilot, Cursor, Codex, or Claude Code without the plugin system), clone the repository and link every folder under skills/ into the agent's skills folder. Keep the three together, because the two siblings call the hub's scripts/hw.py. In PowerShell (junctions need no administrator rights):

git clone https://github.com/m4bwav/historywright
foreach ($s in Get-ChildItem historywright\skills -Directory) { New-Item -ItemType Junction -Path "$HOME\.claude\skills\$($s.Name)" -Target $s.FullName }

On macOS and Linux:

git clone https://github.com/m4bwav/historywright
for s in historywright/skills/*/; do ln -s "$PWD/$s" ~/.claude/skills/; done

Use the skills folder your agent reads (~/.claude/skills, ~/.agents/skills, ~/.copilot/skills or .cursor/skills). The plugin install, the plain-skills install and the release zip install were not run for this wiki; the author's copy is installed from a local marketplace.

Both routes install main, which can be ahead of the last release. For exactly 0.6.1, download historywright-0.6.1.zip from the release, unzip it and link the folders under skills/ the same way (Versions and upgrading).

First run

The commands below run hw.py from its folder, skills/historywright/scripts/; from anywhere else, give its path.

python hw.py --version
0.6.1

doctor says what works on this machine. A fresh install has no contact address, no keys and no East Asian calendar table yet:

python hw.py doctor
{
 "ok": true,
 "version": "0.6.1",
 "checks": {
  "python": "<python>",
  "python_ok": true,
  "home": "<home>",
  "home_from": "HW_HOME",
  "config": "<home>/config.json",
  "contact": false,
  "keys": {
   "openalex": false,
   "whg": false,
   "smithsonian": false,
   "europeana": false
  },
  "registry": {
   "path": "<repo>/skills/historywright-sources/references/registry.json",
   "sources": 96
  },
  "era_outline": true,
  "dila_table": false,
  "cache_entries": 0,
  "user_agent": "historywright/0.6.1 (https://github.com/m4bwav/historywright)",
  "pdftotext": false,
  "cwd_in_skill_folder": false
 },
 "todo": [
  "set a contact address for the User-Agent: hw.py keys contact --set ADDRESS (the user's own)",
  "East Asian eras build on first use (hw.py cal setup, 1.3 MB download)"
 ],
 "config_has": []
}

<home> stands for the home folder: HW_HOME when it is set, else a .historywright folder in the working directory when one exists, else ~/.historywright; home_from says which (the run above set HW_HOME). It holds the config file, the answer cache, the fetch log, the pages read, the endpoint pace and the calendar table. A project's .historywright folder keeps its own cache, fetch log and pages, while keys, the calendar table and the pace stay in ~/.historywright unless the project folder has its own config.json. Run hw.py by its full path from the project folder: cwd_in_skill_folder is true when it runs from inside the skill folder, where it cannot see the project's folder. pdftotext says whether that program is on the PATH; quote checks on PDFs use it when it is, else a built-in reader. <repo> is wherever the skills are installed.

Keys

Everything works without keys. All of them are free and in your own name, and hw.py stores them in <home>/config.json, outside any repository. The environment variables HW_CONTACT, OPENALEX_API_KEY and WHG_TOKEN take precedence over the file.

python hw.py keys status --offline
{
 "ok": true,
 "config": "<home>/config.json",
 "keys": {
  "contact": {
   "set": false,
   "why": "goes into the User-Agent; Wikimedia allows 10 requests a minute without one and 200 with one"
  },
  "openalex": {
   "set": false,
   "key": null
  },
  "whg": {
   "set": false,
   "token": null
  },
  "dpla": {
   "set": false,
   "key": null
  },
  "smithsonian": {
   "set": false
  },
  "europeana": {
   "set": false
  }
 },
 "note": "every key is optional and free; historywright works without any"
}
  • Contact address (keys contact --set ADDRESS): not a key, but it goes into the User-Agent, and Wikimedia allows 10 requests a minute without one and 200 with one (Commands).
  • OpenAlex (scholarship): a ten times bigger daily budget and pages past the first. keys openalex --email ADDRESS shows what it will send; --yes requests the key, and OpenAlex emails an activation link that is valid for seven days.
  • World Historical Gazetteer (places worldwide): keys whg opens the sign-in page (--no-browser prints it instead). WHG signs in only through ORCID, which is free and open to anyone. Generate a token on your WHG profile page, then keys whg --token TOKEN.
  • Smithsonian (api.data.gov) and Europeana: optional, for their collection searches.
  • DPLA (Digital Public Library of America): optional, for hw.py src dpla. curl -X POST https://api.dp.la/v2/api_key/YOUR_EMAIL emails a key; save it as keys.dpla in the config ({"api_key": "..."}) or set DPLA_API_KEY. keys status checks it live.

Paid and gated sources (the ctext.org API, JSTOR, the Oxford Classical Dictionary and the like) are never queried: the registry names them as places to look.

Then ask a history question

With the skills installed, ask your agent a history question in plain words ("When was Julius Caesar born?"). The hub loads, runs the eight steps and answers in the fixed format. hw.py also works on its own, without an agent: every command is on Commands.

Clone this wiki locally