[AISOS-2390] Add a forge version CLI command - #300
Merged
Conversation
Detailed description: - Implemented cmd_version async command handler in src/forge/cli.py to retrieve and print the installed Forge package version - Registered the version parser to subparsers and registered the command route mapping in src/forge/cli.py - Added comprehensive unit tests in tests/unit/test_cli_version.py covering CLI parsing, routing, output verification and exit codes - Updated CLI developer documentation in both CLAUDE.md and docs/developer-guide.md Closes: AISOS-2390
Collaborator
Author
🛠️ Forge PR CommandsThis pull request was created by Forge! You can use the following commands by commenting on this PR:
Feel free to use these commands to manage your workflow! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces the
forge versionCLI command to provide a straightforward and reliable way for users and developers to inspect the currently installed version of the Forge package. Enabling rapid, programmatic version identification simplifies debugging, assists with issue reporting, and supports automated environment validation.Changes
CLI & Command Routing
src/forge/cli.pyto implement thecmd_versionasynchronous command handler.versionsubparser under the primary command-line parser and mapped it to the execution handlers dictionary.Testing
tests/unit/test_cli_version.pycontaining comprehensive unit tests for command routing, expected output verification, and successful exit code behavior.Documentation
CLAUDE.mdto documentuv run forge versionunder the developer commands section.docs/developer-guide.mdto reference and explain the new command under developer workflows and debugging tools.Implementation Notes
__version__from theforgepackage, ensuring the output is always synchronized with the installed package state.cmd_version) to stay consistent with Forge's existing async CLI processing architecture.Testing
tests/unit/test_cli_version.pythat verifies CLI parser routing, command-line outputs, and exit codes.pytestover the newly created test suite as well astests/unit/test_cli_config.pyto ensure overall CLI suite stability.Related Tickets
Generated by Forge SDLC Orchestrator