TLA+ tools: download TLC, compile custom modules, run model checker
Project description
TLA+ CLI
Command-line tool for working with TLA+ specifications and the TLC model checker.
Installation
Install system-wide via uv tool:
uv tool install tlaplus-cli
Upgrade:
uv tool upgrade tlaplus-cli
Uninstall:
uv tool uninstall tlaplus-cli
Usage
Managing TLA+ Tools
The tla tools command group allows you to download and manage multiple versions of the TLA+ toolset (TLC, SANY, TLATeX) directly from GitHub releases.
List available and installed toolset versions:
tla tools list
Install the latest toolset version:
tla tools install
[!TIP] The first version you install is automatically "pinned" as the default. Subsequent installs won't change your pin unless you manually use
tla tools pin.
Install a specific toolset version:
tla tools install v1.8.0
Pin a specific version to be used by default:
tla tools pin v1.8.0
Upgrade the pinned version (or a specific version) to a newer commit:
tla tools upgrade
[!NOTE] If the target version to upgrade is not yet installed locally, the CLI will automatically download it.
Show the absolute path to the pinned version's tla2tools.jar:
tla tools path
Or for a specific version:
tla tools path v1.8.0
Example output:
/home/bob/.cache/tla/tools/v1.8.0-5a47802/tla2tools.jar
Show the toolset versions directory and all installed version directories:
tla tools dir
Example output:
/home/bob/.cache/tla/tools
v1.7.0-abc1234
v1.8.0-5a47802
Uninstall a specific version (or use 'default' to remove legacy jars):
tla tools uninstall v1.8.0
[!TIP] Use
--allto remove all installed tags for a specific version name without interactive prompts.
[!NOTE] If you uninstall the currently pinned version, the CLI will automatically "fall back" to the next best installed version (ranked by semver, then release date).
Run TLC
Run the TLC model checker on a specification. This uses the currently pinned toolset version.
tla tlc <spec_name>
For example (runs queue.tla):
tla tlc queue
Project-Aware Execution
The CLI intelligently resolves the specification file and its project structure. It will check the following locations:
<spec_name>(if it's a direct path to a file, e.g.,models/my_model.tla)<spec_name>.tlaspec/<spec_name>.tla(checks an innerspec/folder relative to the spec's location)
Furthermore, it automatically discovers the project root by looking for modules/, classes/, or lib/ directories adjacent to the spec file or its parent. When a project root is found:
- The project's
classes/directory is added to the Java classpath. - Any
*.jarfiles found in the project'slib/directory are added to the Java classpath. - The
-DTLA-Librarysystem property is set to the project'smodules/directory, allowing TLC to find your custom Java overrides.
To check the currently pinned tla2tools.jar path and its TLC version:
tla tlc --version
Compile Custom Java Modules
Java modules (overrides) are compiled using the pinned version of the toolset.
Compile modules in the current project:
tla modules build
Compile modules in a specific project path:
tla modules build path/to/project
Configure a persistent custom modules path:
tla modules path /path/to/custom/modules
View or reset the custom modules path:
tla modules path # View current path
tla modules path none # Reset to default
Configure a persistent custom modules dependencies (lib) path:
tla modules lib /path/to/custom/libs
View or reset the custom lib path:
tla modules lib # View current path
tla modules lib none # Reset to default
[!TIP] Setting a persistent
module_path(and optionallymodule_lib_path) allowstla modules buildandtla tlcto resolve your Java overrides regardless of where the commands are executed.
Verbose output:
tla modules build --verbose
The build command:
- Resolves the project root (defaults to
workspace.rootfrom config). - Includes
lib/*.jarfiles from the project root in thejavacclasspath. - Compiles
.javafiles from the project'smodules/directory into itsclasses/directory. - Generates the necessary Java service provider configuration for TLC overrides.
Check Java Version
tla check-java
Cache Management
The CLI caches GitHub API responses for 1 hour to prevent rate limiting. To clear this cache manually:
tla fetch-cache clear
Configuration
On first run, a default config is created at:
~/.config/tla/config.yaml
You can manage the configuration using the tla config command:
tla config list # Display current configuration
tla config edit # Open config in default editor ($EDITOR or vim)
tla config edit nano # Open config in a specific editor
Example configuration (config.yaml):
tla:
urls:
tags: https://api.github.com/repos/tlaplus/tlaplus/tags
releases: https://api.github.com/repos/tlaplus/tlaplus/releases
workspace:
root: . # Project root (relative to CWD)
spec_dir: spec # Directory containing .tla files
modules_dir: modules # Directory containing .java files
classes_dir: classes # Directory for compiled .class files
tlc:
java_class: tlc2.TLC
overrides_class: tlc2.overrides.TLCOverrides
module_path: null # (Optional) Persistent custom modules path
module_lib_path: null # (Optional) Persistent custom modules lib path
java:
min_version: 11
opts:
- "-XX:+IgnoreUnrecognizedVMOptions"
- "-XX:+UseParallelGC"
Directory Layout
| Directory | Purpose | Location |
|---|---|---|
| Config | config.yaml |
~/.config/tla/ |
| Toolset Versions | Version dirs & tools-pinned-version.txt file |
~/.cache/tla/tools/ |
| API Cache | github_cache.json |
~/.cache/tla/ |
| Workspace | specs + modules + classes | Set via workspace.root in config |
Note on Package Name
This package is distributed on PyPI as tlaplus-cli but imports as tla. There is a separate, unrelated tla package on PyPI (a TLA+ parser). If you have both installed, they will conflict. In practice this is unlikely since they serve different purposes, but be aware of it.
Dependencies
- Java >= 11: Required for TLC.
- uv: For installing the tool.
Project details
Release history Release notifications | RSS feed
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 tlaplus_cli-0.4.1.tar.gz.
File metadata
- Download URL: tlaplus_cli-0.4.1.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a527b95e138a0fc47b584c84c6edd58cc8e5a659f44e7671af7224a407ba20bd
|
|
| MD5 |
3869e55fef00443fea9a734dcf6684e2
|
|
| BLAKE2b-256 |
6b966dad4ba2afa825a1812a2a51508a90e38b6caae523fa36a846a5a2d40acf
|
Provenance
The following attestation bundles were made for tlaplus_cli-0.4.1.tar.gz:
Publisher:
release.yml on nikolskiy/tlaplus-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tlaplus_cli-0.4.1.tar.gz -
Subject digest:
a527b95e138a0fc47b584c84c6edd58cc8e5a659f44e7671af7224a407ba20bd - Sigstore transparency entry: 1368291750
- Sigstore integration time:
-
Permalink:
nikolskiy/tlaplus-cli@d9745b1ed4db54b2d256e83fc0b5d22a9733c4bc -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/nikolskiy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9745b1ed4db54b2d256e83fc0b5d22a9733c4bc -
Trigger Event:
push
-
Statement type:
File details
Details for the file tlaplus_cli-0.4.1-py3-none-any.whl.
File metadata
- Download URL: tlaplus_cli-0.4.1-py3-none-any.whl
- Upload date:
- Size: 36.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a2a03b25d06a2a81143c3a1e765033b150ddcbd9f105fcec7da5c5a1fe97a15
|
|
| MD5 |
d288c93ed70cff306ed5e89406eaaa5a
|
|
| BLAKE2b-256 |
62d8a4712b7487e7d85e2bbcba4746dcc08f674f3d330060209b1b665e84dd3e
|
Provenance
The following attestation bundles were made for tlaplus_cli-0.4.1-py3-none-any.whl:
Publisher:
release.yml on nikolskiy/tlaplus-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tlaplus_cli-0.4.1-py3-none-any.whl -
Subject digest:
5a2a03b25d06a2a81143c3a1e765033b150ddcbd9f105fcec7da5c5a1fe97a15 - Sigstore transparency entry: 1368291754
- Sigstore integration time:
-
Permalink:
nikolskiy/tlaplus-cli@d9745b1ed4db54b2d256e83fc0b5d22a9733c4bc -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/nikolskiy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9745b1ed4db54b2d256e83fc0b5d22a9733c4bc -
Trigger Event:
push
-
Statement type: