Skip to content

[AISOS-2390] Add a forge version CLI command - #300

Merged
eshulman2 merged 1 commit into
forge-sdlc:mainfrom
forgeSmith-bot:forge/aisos-2390
Aug 11, 2026
Merged

[AISOS-2390] Add a forge version CLI command#300
eshulman2 merged 1 commit into
forge-sdlc:mainfrom
forgeSmith-bot:forge/aisos-2390

Conversation

@forgeSmith-bot

Copy link
Copy Markdown
Collaborator

Summary

This pull request introduces the forge version CLI 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

  • Modified src/forge/cli.py to implement the cmd_version asynchronous command handler.
  • Registered the version subparser under the primary command-line parser and mapped it to the execution handlers dictionary.

Testing

  • Created tests/unit/test_cli_version.py containing comprehensive unit tests for command routing, expected output verification, and successful exit code behavior.

Documentation

  • Updated CLAUDE.md to document uv run forge version under the developer commands section.
  • Updated docs/developer-guide.md to reference and explain the new command under developer workflows and debugging tools.

Implementation Notes

  • Dynamic Version Sourcing: The CLI retrieves version information by directly importing __version__ from the forge package, ensuring the output is always synchronized with the installed package state.
  • Async Framework Compliance: The command is integrated as an async handler (cmd_version) to stay consistent with Forge's existing async CLI processing architecture.
  • Linting & Formatting: All newly introduced and modified code conforms to project styling rules as validated by Ruff.

Testing

  • Unit Tests: Developed a full unit testing suite in tests/unit/test_cli_version.py that verifies CLI parser routing, command-line outputs, and exit codes.
  • Regression Verification: Ran local tests via pytest over the newly created test suite as well as tests/unit/test_cli_config.py to ensure overall CLI suite stability.

Related Tickets


Generated by Forge SDLC Orchestrator

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
@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 merged commit 7bb153d into forge-sdlc:main Aug 11, 2026
6 checks passed
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