[AISOS-2387] Add a forge version CLI command - #298
Closed
forgeSmith-bot wants to merge 2 commits into
Closed
Conversation
Detailed description: - Added a new 'forge version' CLI subcommand and registered its parser and handler in 'src/forge/cli.py'. - Implemented 'cmd_version' handler to print the installed package version from 'forge.__version__'. - Created comprehensive unit tests in 'tests/unit/test_cli_version.py' to verify command routing and standard output formatting. - Updated documentation in 'docs/getting-started.md' to instruct users on verifying their installation using the version command. Closes: AISOS-2387
Auto-committed by Forge container fallback.
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 a new
versioncommand to the Forge command-line interface, enabling users to easily retrieve and verify the installed Forge package version. Providing direct access to versioning details improves the developer experience and simplifies support and troubleshooting workflows by ensuring absolute clarity on the running software version.Changes
Command Line Interface
src/forge/cli.py: Registered theversionsubcommand and implemented the asynchronouscmd_versionhandler to fetch and print the version string fromforge.__version__.Documentation
docs/getting-started.md: Updated the Installation section of the documentation to guide users on verifying their installation using theuv run forge versioncommand.Testing
tests/unit/test_cli_version.py: Developed unit tests to validate correct subcommand routing and verify standard output formatting.Implementation Notes
cmd_versionhandler is implemented as an asynchronous function to align with the existing architectural patterns of the CLI.capsysfixtures are utilized to accurately capture and verify CLI standard output during unit testing.forge.__version__to ensure a single, consistent source of truth.Testing
tests/unit/test_cli_version.pyutilizingAsyncMockpatching andcapsysto assert proper command routing and verify correct output matching. All tests passed with zero errors.Related Tickets
Generated by Forge SDLC Orchestrator