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

Function getProcessCommand

src/utils/genericProcessUtils.ts:94–107  ·  view source on GitHub ↗
(pid: string | number)

Source from the content-addressed store, hash-verified

92 * @deprecated Use getAncestorCommandsAsync instead
93 */
94export function getProcessCommand(pid: string | number): string | null {
95 try {
96 const pidStr = String(pid)
97 const command =
98 process.platform === 'win32'
99 ? `powershell.exe -NoProfile -Command "(Get-CimInstance Win32_Process -Filter \\"ProcessId=${pidStr}\\").CommandLine"`
100 : `ps -o command= -p ${pidStr}`
101
102 const result = execSyncWithDefaults_DEPRECATED(command, { timeout: 1000 })
103 return result ? result.trim() : null
104 } catch {
105 return null
106 }
107}
108
109/**
110 * Gets the command lines for a process and its ancestors in a single call

Callers 1

isClaudeProcessFunction · 0.85

Calls 1

Tested by

no test coverage detected