Skip to content

Extract formatToolLine to shared output module#120

Merged
jancurn merged 4 commits intomainfrom
claude/standardize-tool-output-G1FpS
Mar 26, 2026
Merged

Extract formatToolLine to shared output module#120
jancurn merged 4 commits intomainfrom
claude/standardize-tool-output-G1FpS

Conversation

@jancurn
Copy link
Copy Markdown
Member

@jancurn jancurn commented Mar 26, 2026

Summary

Refactored the formatToolLine function to be a shared utility in the output module instead of being duplicated in the grep command module.

Key Changes

  • Moved formatToolLine function from src/cli/commands/grep.ts to src/cli/output.ts and exported it as a public function
  • Updated formatToolsSummary in src/cli/output.ts to use the new formatToolLine function, eliminating inline formatting logic
  • Updated imports in src/cli/commands/grep.ts to import formatToolLine from the output module instead of defining it locally
  • Removed duplicate function definition from grep.ts

Implementation Details

  • The function maintains the same formatting behavior: displays tool name with parameters, annotations, and task execution mode in a compact bullet-point style
  • Both modules now use the same centralized implementation, reducing code duplication and ensuring consistent formatting across the CLI

https://claude.ai/code/session_013pnhFftwbtbgrAHkNxm9aL

claude added 4 commits March 26, 2026 10:27
Extract formatToolLine from output.ts and reuse it in grep.ts so both
"mcpc @fs" and "mcpc grep" display tools with the same format (space
between tool name and params).

https://claude.ai/code/session_013pnhFftwbtbgrAHkNxm9aL
Ensures TypeScript compilation errors (like unused imports caught by
noUnusedLocals) are caught before committing, not just in CI.

https://claude.ai/code/session_013pnhFftwbtbgrAHkNxm9aL
@jancurn jancurn merged commit 1670bf7 into main Mar 26, 2026
6 checks passed
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.

3 participants