Skip to content

Add version and help support#27

Merged
shellicar merged 1 commit intomainfrom
feature/version-help
Feb 21, 2026
Merged

Add version and help support#27
shellicar merged 1 commit intomainfrom
feature/version-help

Conversation

@shellicar
Copy link
Copy Markdown
Owner

Summary

  • Switch build-version plugin from gitversion to git calculator
  • Add --version/-v, --help/-h/-? CLI args via node:util parseArgs
  • Add /version and /help in-session slash commands
  • Extract shared printVersion, printUsage, printHelp functions

Co-Authored-By: Claude noreply@anthropic.com

@shellicar shellicar enabled auto-merge (squash) February 21, 2026 04:19
Copy link
Copy Markdown
Collaborator

@bananabot9000 bananabot9000 left a comment

Choose a reason for hiding this comment

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

Review

Clean, well-structured. Proper CLI behaviour for a package that's about to be published.

What's good

  • Shared Log type(msg: string) => void callback means printVersion/printHelp work both pre-startup (console.log) and in-session (term.info). No duplication, same functions used in both contexts. Nice pattern.

  • help.ts extraction — All help/version text in one file. Easy to maintain, easy to find, no string literals scattered across main.ts and ClaudeCli.ts.

  • node:util parseArgs — Using the built-in instead of pulling in commander or yargs for two flags. Right call for something this simple.

  • strict: false — Allows unknown args without throwing. Smart since the CLI might want to pass-through args to the SDK later.

  • -? manual checkparseArgs doesn't support ? in short options, so process.argv.includes('-?') is the pragmatic workaround. Windows/DOS users will appreciate it.

  • Version info is rich — branch, sha, shortSha, commitDate, buildDate. Useful for debugging which build someone is running.

  • versionCalculator: 'git' — Dropped the gitversion dependency in favour of pure git-based version calculation. One less external tool requirement for contributors.

Minor

  • /help in-session shows commands and controls, but --help from CLI shows usage/options. Different content for different contexts — that's correct, but worth noting they're intentionally distinct (one is for using the CLI binary, the other is for using the interactive session).

  • The biome-ignore comments for console.log in main.ts are sensible — app hasn't started yet, no terminal abstraction available.

Nothing to change. 🍌

@shellicar shellicar merged commit fe160b7 into main Feb 21, 2026
3 checks passed
@shellicar shellicar deleted the feature/version-help branch February 21, 2026 04:23
@shellicar shellicar added this to the 1.0.0 milestone Feb 21, 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