Add optional CLI wrapper for tla2tools.jar#1371
Conversation
Adds a minimal `tla` script as a convenience wrapper for invoking the existing TLA+ tools from the command line. The script delegates to existing Java entry points and does not modify any functionality or build behavior. Placed under general/cli to keep it separate from core components. [Feature][CLI] Signed-off-by: Pierre-Louis Suckrow <pierresuckrow@tutanota.com>
|
Thanks! This is one of those things we only have a chance to do once so it's important to get it right. I've wanted to do it for a while (#783) although never got around to it. But if you'd like to drive the process for this it probably involves opening up a discussion on the mailing list and also joining the monthly community meeting to talk it over with people. @hwayne has some experience with tlacli which might inform the design here as well. Basically a lot of design-level work! |
|
Thanks, that makes sense. I agree that something official and standardized, along the lines of tlacli, would deserve proper design discussion and broader planning. I will definitely take the steps you proposed. Sorry that I did not follow the path described in That said, if supporting a Homebrew formula is also part of the goal (like I had in mind), then I understand the concern that changing the CLI later could become awkward. |
|
No worries, I think this is a good initiative. We've just been dragged down by backwards compatibility stuff for current command-line tooling creating a not-so-great experience (for example: requiring the |
|
Since TLCI is referenced in this PR, I’d like to highlight a broader design consideration: we should aim to move as much functionality as possible into tla2tools.jar, keeping any wrapper script minimal and lightweight. At the same time, TLC.java is difficult to modify due to legacy constraints. However, there’s no inherent limitation preventing us from introducing a new entry point—such as TLC2.java (or a better-named alternative)—that the wrapper script can delegate to. This new class could define a cleaner, more flexible command-line interface without being bound by the constraints of the existing implementation. |
|
@lemmy so you're thinking the wrapper script should do very little CLI arg parsing/translation and such, and instead just be a thin wrapper around the new entrypoint so people don't have to run |
|
@suckrowPierre there is a virtual TLA+ community meeting next week on Tuesday if you would like to join and discuss this work! https://zoom-lfx.platform.linuxfoundation.org/meetings/tla?view=month |
|
@ahelwer ah sorry, I just saw your message now. I will try to join the next one. |
This PR adds a minimal CLI wrapper (
tla) for invoking the TLA+ tools.Currently, users invoke tools via Java class names, for example:
java -cp tla2tools.jar tlc2.TLC
This change introduces an optional unified entrypoint:
tla tlc Spec.tla
tla sany Spec.tla
tla repl
The script delegates directly to existing Java entry points in
tla2tools.jar and does not introduce any new functionality.
Key properties:
This is intended as a small usability improvement and does not affect
existing workflows.
As a secondary benefit, having a stable CLI entrypoint also makes it easier
to package the tla2tools via external package managers (e.g., Homebrew),
without requiring changes to the core repository.
A brew formulae for the toolbox does already exists but not for tla2tools.