Task summary
Add a --json flag to the commit-echo history command so the style profile and recent commits can be output as JSON for scripting, CI pipelines, and tool integration.
Why this is a good first issue
The task is well-scoped: it only modifies one command file and the CLI entry point. The profile data structure (StyleProfile) is already defined in src/types.ts, and the human-readable formatting already exists in formatProfile(). Adding a JSON output path is a straightforward parallel implementation.
Suggested files or areas
src/commands/history.ts — add --json flag handling and JSON output branch
src/index.ts — register the --json option on the history command
Acceptance criteria
Extra context
StyleProfile and CommitEntry types are in src/types.ts
loadEntries and buildProfile are in src/history/store.ts
- Use
JSON.stringify for output—avoid logging through @clack/prompts when --json is set
Task summary
Add a
--jsonflag to thecommit-echo historycommand so the style profile and recent commits can be output as JSON for scripting, CI pipelines, and tool integration.Why this is a good first issue
The task is well-scoped: it only modifies one command file and the CLI entry point. The profile data structure (
StyleProfile) is already defined insrc/types.ts, and the human-readable formatting already exists informatProfile(). Adding a JSON output path is a straightforward parallel implementation.Suggested files or areas
src/commands/history.ts— add--jsonflag handling and JSON output branchsrc/index.ts— register the--jsonoption on thehistorycommandAcceptance criteria
commit-echo history --jsonoutputs a valid JSON object withprofileandrecentCommitskeyscommit-echo history --jsonexits with code 0 and output is written to stdout only (no ANSI formatting, no intro/outro)commit-echo history(without flag) continues to output the current human-readable format unchangedcommit-echo history --jsonreturns{ "profile": null, "recentCommits": [], "totalCommits": 0 }npm run buildsucceeds with no errorsExtra context
StyleProfileandCommitEntrytypes are insrc/types.tsloadEntriesandbuildProfileare insrc/history/store.tsJSON.stringifyfor output—avoid logging through @clack/prompts when--jsonis set