levain-cli
The open toolchain for authoring Levain agent recipes: a validator, model checker, and code generator for the PlusCal recipe format that Levain agents are defined in.
A recipe package is a graph.tla PlusCal spec (the agent's node graph
and state) plus a Python package with one function per node. This tool
checks both halves and keeps them coherent:
- validate — parse the spec, enforce the recipe grammar profile, check graph topology, translate PlusCal to TLA+, and model-check the result with TLC (deadlock and termination).
- validate-package — all of the above, plus Python source
cross-checks (every
@nodefunction exists and is importable) andpyproject.tomlchecks. - generate-state — regenerate
_state.py, the typedGraphStateTypedDict node functions program against.
Install
uv tool install levain-cli
TLC model checking (stages 4-5) needs a Java runtime; tla2tools.jar
is fetched automatically on first use. Without Java the tool degrades
to the pure-Python stages and says so — the Levain platform re-runs
full validation on every push, so nothing is lost, only local
feedback latency.
Use
levain validate graph.tla
levain validate-package .
levain generate-state .
levain --version
The import package is levain_recipe — use it to lint recipes from
your own CI or scripts:
from levain_recipe.validate import validate_fast
Validation errors are prescriptive ([stage] line N: message, with
TLC counterexample traces) — they are the recipe format's primary
teaching interface, for humans and agents alike.
For MCP clients that cannot run shell commands (e.g. Claude Desktop),
levain mcp serves the same operations over stdio; install
with the [mcp] extra.
What this is not
Recipe execution — compiling a validated spec into a running agent, sandboxing, integrations — happens on the Levain platform. Passing local validation is necessary, not sufficient: the platform validates again server-side before a version can be published.
Metadata
Release files for levain-cli 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| levain_cli-0.1.10.tar.gz | 49.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| levain_cli-0.1.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.3 kB
Release files / levain_cli-0.1.10.tar.gz
| Download URL | levain_cli-0.1.10.tar.gz |
|---|---|
| Size | 49.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad8c46481ef4f79cd6dd583f5036f191ca917d605155aed74ceea3aedb4203bf
|
|
BLAKE2b-256 checksum How to use checksums |
bf110dc8de4e15383d8321bdc4ff7cc5fc7d5a07ab3096282adc20943621debb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / levain_cli-0.1.10-py3-none-any.whl
| Download URL | levain_cli-0.1.10-py3-none-any.whl |
|---|---|
| Size | 58.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a362d1793caa8873c21780af9fda9bf1ad04b9d72329634748f2b06bc7845c46
|
|
BLAKE2b-256 checksum How to use checksums |
119726c9f379debe42c26a71c9cc31f781f0a78e6e0164e27daa20c294f73027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log