From .do file to structured result

One CLI.
Full Stata.

Panel data Causal inference Graphs
85 ms Warm daemon execution
JSON Agent-readable results
57 Built-in Stata topics
17–19 Stata versions supported
Agent-native by design

Prompt in.
Evidence out.

Give any shell-capable agent a real Stata runtime. Keep your datasets, estimation commands, stored results, matrices, and graphs in one persistent session.

01

Connect to the Stata you already own

stata-cli detects Stata and PyStata on macOS, Windows, and Linux. No remote data upload and no replacement statistics engine.

02

Run code without losing context

A persistent daemon keeps datasets, macros, estimates, and frames alive across calls, with named sessions for parallel projects.

03

Return structured empirical results

Agents can inspect variables, r()/e()/s(), matrices, labels, filtered rows, help files, and exported graphs instead of scraping terminal noise.

One binary, full workflow

Everything an agent needs to work empirically.

Execute

Inline Stata, multi-line analysis, stdin, and complete .do files with reliable exit codes.

Inspect

Datasets, variable metadata, frames, labels, macros, matrices, and stored estimation results.

Interpret

Built-in references for regression, panel data, DiD, IV, RDD, matching, graphics, and community packages.

Deliver

Compact JSON responses, token-aware output, logs, and automatic PNG, SVG, or PDF graph export.

Quick start

Install.
Detect.
Run.

Stata 17 or newer and Python 3.9+ are all you need. Start the daemon once, then let your agent move at interactive speed.

$ pip install stata-cli
$ stata-cli detect
Stata detected

$ stata-cli daemon start
$ stata-cli --json run "sysuse auto, clear
regress price mpg weight"