Skip to content

[AISOS-2387] Add a forge version CLI command - #298

Closed
forgeSmith-bot wants to merge 2 commits into
forge-sdlc:mainfrom
forgeSmith-bot:forge/aisos-2387
Closed

[AISOS-2387] Add a forge version CLI command#298
forgeSmith-bot wants to merge 2 commits into
forge-sdlc:mainfrom
forgeSmith-bot:forge/aisos-2387

Conversation

@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

Summary

This pull request introduces a new version command 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

  • Modified src/forge/cli.py: Registered the version subcommand and implemented the asynchronous cmd_version handler to fetch and print the version string from forge.__version__.

Documentation

  • Modified docs/getting-started.md: Updated the Installation section of the documentation to guide users on verifying their installation using the uv run forge version command.

Testing

  • Created tests/unit/test_cli_version.py: Developed unit tests to validate correct subcommand routing and verify standard output formatting.

Implementation Notes

  • The cmd_version handler is implemented as an asynchronous function to align with the existing architectural patterns of the CLI.
  • Standard python capsys fixtures are utilized to accurately capture and verify CLI standard output during unit testing.
  • The package version is retrieved directly from forge.__version__ to ensure a single, consistent source of truth.

Testing

  • Unit Testing: Ran comprehensive tests in tests/unit/test_cli_version.py utilizing AsyncMock patching and capsys to assert proper command routing and verify correct output matching. All tests passed with zero errors.
  • Manual Verification: Confirmed that executing the version command outputs the correct package version and completes with a successful exit code.

Related Tickets


Generated by Forge SDLC Orchestrator

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.
@forgeSmith-bot

Copy link
Copy Markdown
Collaborator Author

🛠️ Forge PR Commands

This pull request was created by Forge! You can use the following commands by commenting on this PR:

  • /forge rebase - Merge the base branch (e.g. main) into this PR branch, with conflicts resolved by AI.
  • /forge skip-gate <name> - Skip a named CI check (substring match) for this PR. This setting persists across subsequent pushes.
  • /forge unskip-gate <name> - Remove a previously set CI check skip.

Feel free to use these commands to manage your workflow!

@eshulman2 eshulman2 closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants