feat: add --verbose flag to commit-echo suggest#74
Conversation
Adds -v/--verbose flag to 'commit-echo suggest' that prints: - Model name and provider - Diff size (or truncation details) - Style profile summary (avg length, imperative mood rate) - Number of commits analyzed
404-Page-Found
left a comment
There was a problem hiding this comment.
PR Review: feat: add --verbose flag to commit-echo suggest (#74)
Verdict: Request Changes 🟡
The PR adds a useful -v/--verbose flag and is generally well-structured. However, there are a few issues that should be addressed before merging.
What the PR does well
- Focused scope — Single feature, clean 20-line delta.
- Good naming —
-v/--verbosefollows CLI conventions. - Consistent styling — Uses
pc.dim()for verbose output, same pattern as existing profile display. - Edge cases handled:
- Profile stats only shown when
profile.totalCommits > 0(no crash on empty history) - Diff size only shown when no truncation occurred (
else ifensures mutual exclusion) - Flag is properly converted to boolean with
Boolean(options.verbose)preventing Commander's default string behavior
- Profile stats only shown when
- No breaking changes — Existing behavior untouched when
--verboseis omitted.
Issues to address
1. Missing automated tests (Important)
The PR adds a new user-facing CLI flag but includes no tests. The project has an existing test suite with patterns like tests/e2e/suggest-smoke.test.mjs that mock a server and test the CLI end-to-end. A similar test should verify that:
commit-echo suggest -vexits successfully- Verbose output (model, provider, diff size, or profile stats) appears on stdout when the flag is set
- Without
--verbose, output is unchanged (no regression)
2. Unnecessary undefined guard on imperativeRate (Nitpick → should clean up)
if (profile.imperativeRate !== undefined) {StyleProfile.imperativeRate is typed as number (not optional), and the outer check profile.totalCommits > 0 guarantees buildProfile returns a meaningful value. This guard is dead code and should be removed.
3. Inconsistent abbreviation with existing formatProfile (Nitpick)
The existing formatProfile() displays:
Average length: 42 characters
But the new verbose output uses:
Avg length: 42 chars
Consider aligning the wording to match the existing convention ("characters" instead of "chars").
Security ✅
No new dependencies, no exposed secrets, no injection vectors.
Performance ✅
Negligible — adds a handful of console.log calls.
Documentation ✅
-v, --verbose is properly registered in Commander. The PR description documents what each verbose line produces.
Summary: The feature is well-conceived and the implementation is mostly clean. Please add tests for the new flag, remove the dead-code guard, and consider the wording nitpick above.
What
Added
-v/--verboseflag to thecommit-echo suggestcommand that prints extra diagnostic information.Why
Makes it easier to debug and understand what the tool is doing under the hood — which model/provider is being used, whether the diff was truncated, and the style profile statistics.
Verbose output includes
pc.dim()for less prominent stylingTesting
commit-echo suggest -vworks as alias for--verbose--verbose, output is unchanged (no breaking change)npm run buildpasses