MCPcopy Create free account
hub / github.com/altic-dev/Pilot / createGenericBashTool

Function createGenericBashTool

src/lib/generic-tools.ts:8–35  ·  view source on GitHub ↗
(
  executeCommand: (command: string) => Promise<string>,
)

Source from the content-addressed store, hash-verified

6 * Replicates the functionality of anthropic.tools.bash_20250124
7 */
8export function createGenericBashTool(
9 executeCommand: (command: string) => Promise<string>,
10) {
11 return tool({
12 description: `Execute bash commands to interact with the system. Use this to run shell commands, manage files, and interact with git.
13
14Available commands:
15- ls, cat, find: File operations
16- git: Version control
17- mkdir, cd: Directory operations
18- npm, pnpm: Package management
19- gh: GitHub CLI
20
21IMPORTANT: Only specific commands are allowed for security. Commands that modify git config (user.name, user.email) are forbidden.`,
22 inputSchema: z.object({
23 command: z.string().describe("The bash command to execute"),
24 restart: z
25 .boolean()
26 .optional()
27 .describe(
28 "Whether to restart the bash session (currently not supported)",
29 ),
30 }),
31 execute: async ({ command }) => {
32 return await executeCommand(command);
33 },
34 });
35}
36
37/**
38 * Generic text editor tool that works with any AI provider

Callers 1

createDockerToolsFunction · 0.90

Calls 1

executeCommandFunction · 0.85

Tested by

no test coverage detected