MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getCommandTypeForLogging

Function getCommandTypeForLogging

src/tools/BashTool/BashTool.tsx:266–278  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

264export type BashToolInput = z.infer<ReturnType<typeof fullInputSchema>>;
265const COMMON_BACKGROUND_COMMANDS = ['npm', 'yarn', 'pnpm', 'node', 'python', 'python3', 'go', 'cargo', 'make', 'docker', 'terraform', 'webpack', 'vite', 'jest', 'pytest', 'curl', 'wget', 'build', 'test', 'serve', 'watch', 'dev'] as const;
266function getCommandTypeForLogging(command: string): AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS {
267 const parts = splitCommand_DEPRECATED(command);
268 if (parts.length === 0) return 'other' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS;
269
270 // Check each part of the command to see if any match common background commands
271 for (const part of parts) {
272 const baseCommand = part.split(' ')[0] || '';
273 if (COMMON_BACKGROUND_COMMANDS.includes(baseCommand as (typeof COMMON_BACKGROUND_COMMANDS)[number])) {
274 return baseCommand as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS;
275 }
276 }
277 return 'other' as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS;
278}
279const outputSchema = lazySchema(() => z.object({
280 stdout: z.string().describe('The standard output of the command'),
281 stderr: z.string().describe('The standard error output of the command'),

Callers 2

startBackgroundingFunction · 0.70
runShellCommandFunction · 0.70

Calls 1

splitCommand_DEPRECATEDFunction · 0.85

Tested by

no test coverage detected