Skip to content

Releases: ashuiGordon/stata-cli

stata-cli v0.5.2 — Config Command + Stata 19 Detection

Choose a tag to compare

@ashuiGordon ashuiGordon released this 01 Jun 06:55

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-path

Commands:

  • stata-cli config set <key> <value> — save a config value
  • stata-cli config get <key> — read a config value
  • stata-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-cli

Full Changelog: v0.5.1...v0.5.2

stata-cli v0.5.1

Choose a tag to compare

@ashuiGordon ashuiGordon released this 19 May 04:22

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_port on 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 all

Full Changelog: v0.5.0...v0.5.1

stata-cli v0.5.0 — Multi-Session Daemon

Choose a tag to compare

@ashuiGordon ashuiGordon released this 19 May 04:16

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 e

Daemon management

stata-cli daemon status          # list all running sessions
stata-cli daemon stop --all      # stop all sessions at once

Backwards compatible

No --session = session "default" — everything works exactly as before.

Install / Upgrade

pip install --upgrade stata-cli

Full Changelog: v0.4.2...v0.5.0

stata-cli v0.4.2

Choose a tag to compare

@ashuiGordon ashuiGordon released this 15 May 09:59

Fixed

  • stata-cli skill <topic> --compact no longer errors — skill command now ignores unknown options (agents frequently pass global flags like --compact after the subcommand)

Full Changelog: v0.4.1...v0.4.2

stata-cli v0.4.1

Choose a tag to compare

@ashuiGordon ashuiGordon released this 15 May 09:45

Improved

  • stata-cli --help now 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

Choose a tag to compare

@ashuiGordon ashuiGordon released this 15 May 09:06

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 table
  • stata-cli skill --list — list all 57 topics grouped by category
  • stata-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 did before 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-cli

Full Changelog: v0.3.0...v0.4.0

v0.3.0 — Structured Results, Matrix, Labels & More

Choose a tag to compare

@ashuiGordon ashuiGordon released this 13 May 07:23

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 JSON
  • stata-cli vars — inspect variable metadata (name, type, format, label)
  • stata-cli matrix e(b) — read Stata matrices as JSON
  • stata-cli labels — list and inspect value labels
  • stata-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-cli

Full Changelog: v0.2.2...v0.3.0

v0.2.2 — npm Fix

Choose a tag to compare

@ashuiGordon ashuiGordon released this 13 May 07:23

Fixed

  • Python 3.10+ requirement (use native union type syntax)
  • npm package.json bin path fixed

v0.2.1 — Python 3.9 Fix

Choose a tag to compare

@ashuiGordon ashuiGordon released this 13 May 07:23

Fixed

  • Python 3.9 compatibility: added from __future__ import annotations to resolve str | None syntax error

v0.2.0 — Initial Release

Choose a tag to compare

@ashuiGordon ashuiGordon released this 13 May 07:23

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 stdin
  • stata-cli do — execute .do files with /// continuation and graph auto-naming
  • stata-cli data — view current dataset as JSON with if-condition filtering
  • stata-cli help — browse Stata help with SMCL-to-plain-text conversion
  • stata-cli stop — interrupt running Stata commands
  • stata-cli detect — auto-detect Stata installation path
  • stata-cli daemon start/stop/status/restart — daemon mode for sub-second execution (~85ms vs ~3s)
  • --compact / --json / --max-tokens output control
  • Graph auto-detection and PNG export
  • npm wrapper (npx stata-cli)

Install

pip install stata-cli