MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / commandAsHint

Function commandAsHint

src/utils/collapseReadSearch.ts:125–136  ·  view source on GitHub ↗

* Format a bash command for the ⎿ hint. Drops blank lines, collapses runs of * inline whitespace, then caps total length. Newlines are preserved so the * renderer can indent continuation lines under ⎿.

(command: string)

Source from the content-addressed store, hash-verified

123 * renderer can indent continuation lines under ⎿.
124 */
125function commandAsHint(command: string): string {
126 const cleaned =
127 '$ ' +
128 command
129 .split('\n')
130 .map(l => l.replace(/\s+/g, ' ').trim())
131 .filter(l => l !== '')
132 .join('\n')
133 return cleaned.length > MAX_HINT_CHARS
134 ? cleaned.slice(0, MAX_HINT_CHARS - 1) + '…'
135 : cleaned
136}
137
138/**
139 * Checks if a tool is a search/read operation using the tool's isSearchOrReadCommand method.

Callers 1

collapseReadSearchGroupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected