Skip to content

feat: add CLI version flag#192

Open
nanookclaw wants to merge 1 commit into
littlebearapps:mainfrom
nanookclaw:fix/version-flag
Open

feat: add CLI version flag#192
nanookclaw wants to merge 1 commit into
littlebearapps:mainfrom
nanookclaw:fix/version-flag

Conversation

@nanookclaw

@nanookclaw nanookclaw commented May 28, 2026

Copy link
Copy Markdown

Summary

Adds a --version / -v CLI guard to the outlook-assistant entrypoint so operators can check the installed package version without starting the MCP server. The flag reads package.json, prints @littlebearapps/outlook-assistant v<version>, and exits before config/module loading or startup logs.

Closes #68.

Verification

  • npm test -- test/cli-version.test.js --runInBand
  • node index.js --version
  • node index.js -v
  • npm run lint (0 errors; existing warnings unchanged)
  • npm run format:check
  • git diff --check
  • npm test -- --runInBand

Summary by CodeRabbit

  • New Features

    • Added --version and -v CLI flags to display the server package name and version information.
  • Tests

    • Added test suite validating CLI version flag behavior and output formatting.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eac87271-38df-4968-bf47-605c120df854

📥 Commits

Reviewing files that changed from the base of the PR and between 080f80e and 152e884.

📒 Files selected for processing (2)
  • index.js
  • test/cli-version.test.js

📝 Walkthrough

Walkthrough

This PR adds a --version and -v CLI flag to the server entrypoint that prints the package name and version to stdout and exits cleanly, before any module initialization or startup logging occurs.

Changes

CLI Version Flag

Layer / File(s) Summary
Version flag implementation and tests
index.js, test/cli-version.test.js
Added early CLI flag detection that intercepts --version and -v, reads version from package.json, and prints <name> v<version> to stdout before exiting with code 0. Comprehensive test suite validates output format, exit codes, and confirms no MCP server startup logging is emitted when the flag is used.

🎯 1 (Trivial) | ⏱️ ~5 minutes

🐰 A flag so neat, both short and long,
Reads the version package, never gets it wrong,
Prints the name, the number too, then hops away,
Before the server starts up for the day! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add CLI version flag' clearly summarizes the main change—adding a CLI flag for version output.
Linked Issues check ✅ Passed The PR implements all requirements from issue #68: checks process.argv for --version/-v, reads from package.json, prints the correct format, and exits with status 0.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #68; index.js adds the version flag handler and test/cli-version.test.js provides comprehensive validation tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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.

Add --version CLI flag

1 participant