Skip to content

Add --dry-run flag to commit-echo suggest #90

@404-Page-Found

Description

@404-Page-Found

Task summary

Add a --dry-run flag to commit-echo suggest that shows what would be sent to the LLM — the diff, style profile, resolved prompts, and truncation info — without actually making the API call. Useful for debugging custom prompt templates and understanding what data the LLM receives.

Why this is a good first issue

Well-scoped feature that adds a single flag and an early-return path. Teaches CLI option registration with Commander.js, the suggest command flow, and how prompts are assembled. No external API calls needed for testing.

Suggested files or areas

  • src/index.ts — Add --dry-run / -n option to the suggest command
  • src/commands/suggest.ts — When --dry-run is set, print the diff, resolved prompts, profile summary, and truncation info (if any), then exit without calling generateSuggestions

Acceptance criteria

  • commit-echo suggest --dry-run prints the diff, system prompt, user prompt, style profile summary, and truncation info
  • commit-echo suggest -n works as an alias
  • No API call is made when --dry-run is set
  • Without --dry-run, behavior is unchanged
  • npm run build passes with no errors

Extra context

  • Follow the existing flag pattern in src/index.ts (e.g., --verbose, --commit, --yes)
  • The showVerboseInfo() and showTruncationWarning() functions in src/commands/suggest.ts demonstrate how to print diagnostic info using pc.dim() / pc.yellow()
  • resolveSystemPrompt() and resolveUserPrompt() in src/llm/prompt.ts can be called directly to show the resolved prompts
  • Use pc.dim() for the diff and prompt output to distinguish it from normal output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions