Skip to content

fix: expose the CLI package version - #110

Merged
nicholls73 merged 2 commits into
mainfrom
codex/add-cli-version-command
Aug 1, 2026
Merged

fix: expose the CLI package version#110
nicholls73 merged 2 commits into
mainfrom
codex/add-cli-version-command

Conversation

@nicholls73

@nicholls73 nicholls73 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • print the installed package version for openbrain version, openbrain --version, and openbrain -V
  • reuse the existing package-version reader used by update checks
  • cover all three forms through the installed CLI regression test

Why

The CLI previously treated every version form as an unknown command and printed general help instead.

Testing

  • pnpm lint
  • pnpm build
  • pnpm test (128 passed, 1 skipped)
  • manual checks against dist/cli.js for all three version forms

Summary by CodeRabbit

  • New Features

    • Added a version command to display the installed application version.
    • Added --version and -V aliases for quick version checks.
    • Updated command-line usage information to document the new options.
  • Bug Fixes

    • Improved installation verification to ensure all supported version options return the correct installed version.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 27dc378b-5e91-479c-b3cc-57fb92d299d2

📥 Commits

Reviewing files that changed from the base of the PR and between ba513c5 and 60a23ee.

📒 Files selected for processing (1)
  • src/cli.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cli.ts

📝 Walkthrough

Walkthrough

The CLI adds a version command with --version and -V aliases. Each option prints the installed package version and exits. The usage text and installation test cover the new behavior.

Changes

CLI version reporting

Layer / File(s) Summary
Version command and aliases
src/cli.ts, tests/install-script.test.ts
The CLI reads and prints the current package version for version, --version, and -V. The usage text documents all three forms. The installation test verifies each argument.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI as openbrain CLI
  participant Reader as readCurrentVersion()
  participant Package as installed package.json
  CLI->>Reader: handle version, --version, or -V
  Reader->>Package: read installed version
  Package-->>Reader: return package version
  Reader-->>CLI: print version and exit
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: exposing the installed package version through the CLI.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-cli-version-command

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/cli.ts (1)

642-642: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the supported version aliases.

The usage text lists openbrain version, but it omits openbrain --version and openbrain -V. Add both aliases so users can discover every supported version form.

Proposed usage update
   openbrain version
+  openbrain --version
+  openbrain -V
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/cli.ts` at line 642, Update the usage text around the existing “openbrain
version” entry in the CLI help to also list the supported “openbrain --version”
and “openbrain -V” aliases, so all version invocation forms are documented.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/cli.ts`:
- Line 642: Update the usage text around the existing “openbrain version” entry
in the CLI help to also list the supported “openbrain --version” and “openbrain
-V” aliases, so all version invocation forms are documented.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4f1ff148-162d-4576-af7d-618d7a6455a2

📥 Commits

Reviewing files that changed from the base of the PR and between a4663e1 and ba513c5.

📒 Files selected for processing (2)
  • src/cli.ts
  • tests/install-script.test.ts

@nicholls73
nicholls73 merged commit d9a1eb0 into main Aug 1, 2026
6 checks passed
@nicholls73
nicholls73 deleted the codex/add-cli-version-command branch August 1, 2026 22:38
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.

1 participant