MCPcopy Create free account
hub / github.com/WJX20/claude-code / getCommandTypeForLogging

Function getCommandTypeForLogging

src/tools/PowerShellTool/PowerShellTool.tsx:262–271  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

260export type { PowerShellProgress } from '../../types/tools.js';
261const COMMON_BACKGROUND_COMMANDS = ['npm', 'yarn', 'pnpm', 'node', 'python', 'python3', 'go', 'cargo', 'make', 'docker', 'terraform', 'webpack', 'vite', 'jest', 'pytest', 'curl', 'Invoke-WebRequest', 'build', 'test', 'serve', 'watch', 'dev'] as const;
262function getCommandTypeForLogging(command: string): AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS {
263 const trimmed = command.trim();
264 const firstWord = trimmed.split(/\s+/)[0] || '';
265 for (const cmd of COMMON_BACKGROUND_COMMANDS) {
266 if (firstWord.toLowerCase() === cmd.toLowerCase()) {
267 return cmd as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS;
268 }
269 }
270 return 'other' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS;
271}
272export const PowerShellTool = buildTool({
273 name: POWERSHELL_TOOL_NAME,
274 searchHint: 'execute Windows PowerShell commands',

Callers 3

callFunction · 0.70
startBackgroundingFunction · 0.70
runPowerShellCommandFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected