Home

CmdStan

CmdStan is the command-line interface for the Stan probabilistic programming language. It provides the core workflow for compiling Stan models and running inference from the shell, making it a foundational tool in the Stan ecosystem. CmdStan is designed for scripting, automation, and use on various computing environments, including high-performance systems.

A typical workflow starts with writing a Stan model in a .stan file. The model is compiled

CmdStan is cross-platform, compatible with Linux, macOS, and Windows environments that provide a compatible toolchain. It

In the broader Stan ecosystem, CmdStan complements higher-level interfaces such as PyStan and CmdStanPy for Python

into
an
executable,
after
which
data
are
supplied
(commonly
in
JSON
or
R
dump
format)
and
a
run
is
launched
via
the
command
line.
CmdStan
supports
different
inference
methods,
including
sampling
with
Markov
chain
Monte
Carlo,
as
well
as
optimization
and
variational
inference.
When
performing
sampling,
users
can
configure
the
number
of
chains,
warmup
iterations,
total
iterations,
thinning,
and
seeds.
CmdStan
can
launch
multiple
chains
in
parallel,
leveraging
available
CPU
cores.
Output
includes
posterior
samples
in
a
draws
file
(CSV)
and
accompanying
diagnostics
data,
along
with
log
messages
and
related
files.
relies
on
a
C++
compiler
and
build
tools,
and
uses
a
straightforward,
script-friendly
workflow
that
emphasizes
reproducibility
and
automation
through
shell
scripts
or
integration
into
larger
pipelines.
users
and
RStan
for
R
users.
CmdStan
remains
a
lightweight,
language-agnostic
option
for
running
Stan
models,
offering
detailed
control
over
model
compilation
and
inference
without
additional
language
bindings.