Local CLI: qestyle¶
The qestyle command runs the exact same review engine locally — same prompts, rules, and fix logic as the GitHub Action.
Installation¶
Install directly from GitHub:
# Latest release
pip install git+https://github.com/QuantEcon/action-style-guide.git
# Specific version
pip install git+https://github.com/QuantEcon/action-style-guide.git@v0.7
# Development (editable install from local clone)
git clone https://github.com/QuantEcon/action-style-guide.git
cd action-style-guide
pip install -e .Set your Anthropic API key:
export ANTHROPIC_API_KEY='your-key-here'Usage¶
# Review all categories — applies fixes, writes report
qestyle lecture.md
# Check specific categories only
qestyle lecture.md --categories writing
qestyle lecture.md --categories math,code
# Report only, don't modify the file
qestyle lecture.md --dry-run
# Write report to a custom path
qestyle lecture.md -o custom-report.md
# Use a specific model or temperature
qestyle lecture.md --model claude-sonnet-4-5-20250929 --temperature 1.0
# Check version
qestyle --versionOutput¶
By default, qestyle applies rule-type fixes directly to the lecture file and writes a Markdown report to qestyle({category})-{lecture}.md alongside the original file.
Since lectures live in Git repos, you can review changes with git diff and restore with git checkout.
Uncommitted changes warning¶
If the lecture file has uncommitted changes, qestyle will warn you and ask to confirm before proceeding — giving you a chance to commit or stash first.
Report contents¶
The report contains:
Style suggestions — advisory items requiring human judgment (listed first)
Applied fixes — record of what was automatically changed (at the end)
Warnings — any processing issues
Dry-run mode¶
Use --dry-run to skip applying fixes and just write the report. Useful to preview what would change.
Categories¶
| Category | Focus |
|---|---|
writing | Writing style and formatting |
math | Mathematics notation and LaTeX |
code | Python code style |
jax | JAX-specific patterns |
figures | Figure formatting and captions |
references | Citations and bibliography |
links | Hyperlinks and cross-references |
admonitions | Note/warning/tip blocks |
If no categories specified, all categories are checked sequentially.
Examples¶
Check a single category¶
qestyle lectures/aiyagari.md --categories writingPreview changes without applying¶
qestyle lectures/aiyagari.md --dry-run --categories mathReview all categories and inspect¶
qestyle lectures/aiyagari.md
git diff lectures/aiyagari.mdUndo all changes¶
git checkout -- lectures/aiyagari.md