MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getCommandRoots

Function getCommandRoots

packages/core/src/utils/shell-utils.ts:194–201  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

192}
193
194export function getCommandRoots(command: string): string[] {
195 if (!command) {
196 return [];
197 }
198 return splitCommands(command)
199 .map((c) => getCommandRoot(c))
200 .filter((c): c is string => !!c);
201}
202
203export function stripShellWrapper(command: string): string {
204 const pattern = /^\s*(?:sh|bash|zsh|cmd.exe)\s+(?:\/c|-c)\s+/;

Callers 3

shouldConfirmExecuteMethod · 0.85
validateToolParamsMethod · 0.85

Calls 2

splitCommandsFunction · 0.85
getCommandRootFunction · 0.85

Tested by

no test coverage detected