| Crates.io | tla-cli |
| lib.rs | tla-cli |
| version | 0.1.2 |
| created_at | 2025-11-21 21:16:16.435228+00 |
| updated_at | 2025-11-21 21:40:16.418493+00 |
| description | TLA+ CLI for linting, formatting, and TLC checks |
| homepage | |
| repository | https://github.com/younes-io/tla |
| max_upload_size | |
| id | 1944275 |
| size | 48,016 |
Command-line tool providing linting, formatting, and TLC invocation for TLA+ projects.
cargo install --path . then run tla ...cargo build --release then ./target/release/tla ...cargo install tla-cli — it will still install the binary as tla (package name differs from bin name).tlafmt formatter: cargo install tlafmttlc model checker: download tla2tools.jar and add a wrapper script on PATH (snap tlaplus ships only the Toolbox GUI, not tlc).# inside your project (or any directory)
mkdir -p tools
curl -L -o tools/tla2tools.jar \
https://github.com/tlaplus/tlaplus/releases/latest/download/tla2tools.jar
# generate a wrapper that uses that jar
cargo run -- doctor \
--write-tlc-wrapper tools/tlc \
--jar tools/tla2tools.jar
# put it on PATH (add to your shell rc to persist)
export PATH="$PWD/tools:$PATH"
# verify
cargo run -- doctor
# Reminder: keep the tools directory on PATH in future shells (e.g., add the export line to ~/.zshrc).
You can also set TLA_TOOLS_JAR=/path/to/tla2tools.jar and run:
cargo run -- doctor --write-tlc-wrapper /some/bin/tlc
# Lint TLA+ files (default .)
tla lint [PATH...]
# JSON diagnostics
tla lint path --json
# Format using tlafmt
tla fmt [PATH...]
# Model check with TLC
tla check --spec MySpec [--cfg MySpec.cfg]
# Environment check (tlafmt/tlc presence, optional wrapper creation)
tla doctor [--write-tlc-wrapper <PATH>] [--jar <tla2tools.jar>]
Exit codes: success 0; lint errors or formatter/check failures 1; unexpected internal errors non-zero.
cargo fmt
cargo clippy -- -D warnings
cargo test
# Smoke (examples)
tla lint fixtures/ok.tla
tla lint fixtures/unused.tla --json
tla check --spec Minimal # requires tlc on PATH