The monty CLI binary — spawned as worker subprocesses by pydantic-monty
Actively maintained. Last release 6 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install pydantic-monty-runtimepydantic-monty-runtime
The monty command-line binary for the
Monty sandbox.
Installing the wheel puts the compiled binary in the environment's scripts directory. The wheel includes the MIT licence for Monty and the upstream licences and notices for the embedded CPython modules and typeshed stubs.
You normally don't install this directly — the
pydantic-monty metapackage pulls
it in alongside the Python bindings, which need it to spawn worker
subprocesses. Install it on its own to get just the CLI, or to supply the binary
to an existing pydantic-monty-client
install:
uv add pydantic-monty-runtime
# or
pip install pydantic-monty-runtime
Or to install the monty binary as a tool
uv tool install pydantic-monty-runtime
monty --help
Usage
monty— start an interactive REPLmonty file.py— run a Python filemonty -c "<code>"— run a program passed as a string (likepython -c)-i/--interactive— run the file or-cprogram in a REPL session (likepython -i)-t/--type-check— type check (powered by ty) before executing--type-check-format— diagnostic format:full(default),concise,json,githuband the other ty formats (requires--type-check)-m/--mount /host/path::/virtual/path[::mode[::write_limit_bytes]]— mount a host directory into the sandbox (ro,rw, oroverlay); repeat for several, which need distinct virtual paths and disjoint host directories; animportof a module the sandbox does not bundle runs<cwd>/name/__init__.py, else<cwd>/name.py, from them, raisingModuleNotFoundErrorwhen neither exists--cwd /virtual/path— the sandbox's working directory (default: the first mount's virtual path, else ); relative paths resolve against it