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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file levain_cli-0.1.0.tar.gz.
File metadata
- Download URL: levain_cli-0.1.0.tar.gz
- Upload date:
- Size: 46.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baa641a274d095bd465dfdbfe94d8219c2e7c04f3277f3681d60e2634731eb0f
|
|
| MD5 |
65a90ecc83b0817f38581c4285808476
|
|
| BLAKE2b-256 |
6f0198f16d815d7f4e0a289191bd1c1d083d354dd420e48c14642ccf0f98d1ae
|
Provenance
The following attestation bundles were made for levain_cli-0.1.0.tar.gz:
Publisher:
pypi-publish.yaml on levainlabs/levain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
levain_cli-0.1.0.tar.gz -
Subject digest:
baa641a274d095bd465dfdbfe94d8219c2e7c04f3277f3681d60e2634731eb0f - Sigstore transparency entry: 2613840759
- Sigstore integration time:
-
Permalink:
levainlabs/levain@6f5127ed2b4e30c034338794363c543442ab2ab0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/levainlabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@6f5127ed2b4e30c034338794363c543442ab2ab0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file levain_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: levain_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 56.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0187b77f4473397bf168a52a2af5c11b627dde3e999bfa8833be0cb73529fc45
|
|
| MD5 |
5c541c00178944a5b13e7d88e6dde306
|
|
| BLAKE2b-256 |
c83769ba948a933f02d6a223c5e05c35264f3a269d3b0cc487b5dd6abc351e4f
|
Provenance
The following attestation bundles were made for levain_cli-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yaml on levainlabs/levain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
levain_cli-0.1.0-py3-none-any.whl -
Subject digest:
0187b77f4473397bf168a52a2af5c11b627dde3e999bfa8833be0cb73529fc45 - Sigstore transparency entry: 2613569973
- Sigstore integration time:
-
Permalink:
levainlabs/levain@6f5127ed2b4e30c034338794363c543442ab2ab0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/levainlabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yaml@6f5127ed2b4e30c034338794363c543442ab2ab0 -
Trigger Event:
workflow_dispatch
-
Statement type: