Releases: ashuiGordon/stata-cli
Release list
stata-cli v0.5.2 — Config Command + Stata 19 Detection
stata-cli v0.5.2
New: stata-cli config command
Persistent configuration stored in ~/.stata-cli/config.json. Agents can search for Stata on the user's machine and save the path permanently:
# Agent saves the found path
stata-cli config set stata-path "/path/to/stata"
# All future commands auto-detect from config
stata-cli run "display 1+1" # works without --stata-pathCommands:
stata-cli config set <key> <value>— save a config valuestata-cli config get <key>— read a config valuestata-cli config list— show all saved config
Improved path detection
Detection priority: --stata-path flag > STATA_PATH env > config.json > platform defaults.
Added Stata 19 / StataNow 19 to default path detection:
- Windows:
C:\Program Files\Stata19,C:\Program Files\StataNow19 - macOS:
/Applications/Stata,/Applications/StataNow - Linux:
/usr/local/stata19,/usr/local/statanow19
Install / Upgrade
pip install --upgrade stata-cliFull Changelog: v0.5.1...v0.5.2
stata-cli v0.5.1
Improved
- Updated README (EN/ZH) with parallel session documentation and usage examples
- Updated website with parallel session code snippet in performance section
- Fixed socket leak in
_find_free_porton Windows
Parallel Sessions (from v0.5.0)
stata-cli --session proj_a daemon start
stata-cli --session proj_b daemon start
stata-cli --session proj_a run "regress price mpg"
stata-cli --session proj_b run "summarize income"
stata-cli daemon status # list all running sessions
stata-cli daemon stop --all # stop allFull Changelog: v0.5.0...v0.5.1
stata-cli v0.5.0 — Multi-Session Daemon
stata-cli v0.5.0
Run multiple Stata sessions in parallel — like opening multiple Stata windows, each with independent data, estimates, and macros.
New: --session global option
# Start parallel sessions
stata-cli --session proj_a daemon start
stata-cli --session proj_b daemon start
# Each session has its own state
stata-cli --session proj_a run "use project_a.dta, clear"
stata-cli --session proj_b run "use project_b.dta, clear"
# Route any command to a specific session
stata-cli --session proj_a run "regress price mpg weight"
stata-cli --session proj_b return eDaemon management
stata-cli daemon status # list all running sessions
stata-cli daemon stop --all # stop all sessions at onceBackwards compatible
No --session = session "default" — everything works exactly as before.
Install / Upgrade
pip install --upgrade stata-cliFull Changelog: v0.4.2...v0.5.0
stata-cli v0.4.2
Fixed
stata-cli skill <topic> --compactno longer errors — skill command now ignores unknown options (agents frequently pass global flags like--compactafter the subcommand)
Full Changelog: v0.4.1...v0.4.2
stata-cli v0.4.1
Improved
stata-cli --helpnow shows actionable skill description:Stata reference library — 57 topics, use 'skill --list' to browse.(improves agent discoverability)
Full Changelog: v0.4.0...v0.4.1
stata-cli v0.4.0 — Built-in Stata Reference Library
stata-cli v0.4.0
New feature: stata-cli skill — a built-in Stata reference library with 57 topics covering core Stata, econometrics, causal inference, and community packages.
New Command
stata-cli skill— show overview with critical gotchas, common patterns, and topic routing tablestata-cli skill --list— list all 57 topics grouped by categorystata-cli skill <topic>— output detailed reference for a specific topic
57 Topics Across 8 Categories
| Category | Topics |
|---|---|
| Data Operations | basics, data-import-export, data-management, variables-operators, string/date/math functions |
| Statistics & Econometrics | descriptive-statistics, linear-regression, panel-data, time-series, limited-dependent-variables, survey, bootstrap, missing-data, ML, GMM |
| Causal Inference | treatment-effects, difference-in-differences, regression-discontinuity, matching-methods, sample-selection |
| Advanced Methods | survival-analysis, SEM, nonparametric, spatial, machine-learning (lasso) |
| Graphics | graphics (twoway, scatter, bar, histogram, graph export) |
| Programming | programming-basics, advanced-programming, mata-introduction, mata-programming, mata-matrix-operations, mata-data-access |
| Output & Workflow | tables-reporting, workflow-best-practices, external-tools-integration |
| Community Packages | reghdfe, estout, outreg2, asdoc, tabout, coefplot, csdid, rdrobust, psmatch2, synth, ivreg2, xtabond2, binsreg, and more |
Highlights
- 32 short aliases:
regression,panel,did,rd,mata,lasso,iv, etc. - Partial matching fallback: even approximate topic names resolve correctly
- Agent-friendly: AI agents can call
stata-cli skill didbefore running analysis to get method-specific guidance - SKILL.md routing table: agents auto-discover the skill library and query relevant topics
- Integrated reference content from stata-skill (MIT license)
Install / Upgrade
pip install --upgrade stata-cliFull Changelog: v0.3.0...v0.4.0
v0.3.0 — Structured Results, Matrix, Labels & More
stata-cli v0.3.0
Major feature release — 8 new capabilities leveraging PyStata's sfi API for structured data access.
New Commands
stata-cli return r/e/s— retrieve r(), e(), s() stored results as structured JSONstata-cli vars— inspect variable metadata (name, type, format, label)stata-cli matrix e(b)— read Stata matrices as JSONstata-cli labels— list and inspect value labelsstata-cli macro get/set— access Stata macros including c(), e(), r()stata-cli frame— list frames and current working frame
New Options
--graph-format png|svg|pdf— choose graph export format--log PATH— save output to a log file
Highlights
- AI Agent 最大提升: 跑完
regress后直接stata-cli return e获取 R²、系数、N 等结构化 JSON,无需从文本解析 - 矩阵直读:
stata-cli matrix e(b)返回系数向量,stata-cli matrix e(V)返回方差-协方差矩阵 - SVG/PDF 图表:
--graph-format svg适合论文和网页嵌入 - All new commands fully support daemon mode
Install / Upgrade
pip install --upgrade stata-cliFull Changelog: v0.2.2...v0.3.0
v0.2.2 — npm Fix
Fixed
- Python 3.10+ requirement (use native union type syntax)
- npm package.json bin path fixed
v0.2.1 — Python 3.9 Fix
Fixed
- Python 3.9 compatibility: added
from __future__ import annotationsto resolvestr | Nonesyntax error
v0.2.0 — Initial Release
stata-cli v0.2.0
First public release of stata-cli — a command-line interface for Stata via PyStata.
Features
stata-cli run— execute inline Stata code or pipe from stdinstata-cli do— execute .do files with///continuation and graph auto-namingstata-cli data— view current dataset as JSON withif-condition filteringstata-cli help— browse Stata help with SMCL-to-plain-text conversionstata-cli stop— interrupt running Stata commandsstata-cli detect— auto-detect Stata installation pathstata-cli daemon start/stop/status/restart— daemon mode for sub-second execution (~85ms vs ~3s)--compact/--json/--max-tokensoutput control- Graph auto-detection and PNG export
- npm wrapper (
npx stata-cli)
Install
pip install stata-cli