MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / docker

Function docker

src/tools/docker/docker-tools.ts:17–23  ·  view source on GitHub ↗
(args: string[], timeoutMs = 120_000)

Source from the content-addressed store, hash-verified

15const DOCKER_HINT = 'Install Docker Desktop (macOS) from https://www.docker.com/products/docker-desktop/ and ensure the daemon is running.';
16
17async function docker(args: string[], timeoutMs = 120_000): Promise<ToolResult> {
18 const r = await runProcess('docker', args, { timeoutMs });
19 if (r.notFound) return { content: notInstalledMessage('docker', DOCKER_HINT), isError: true };
20 if (r.timedOut) return { content: `docker ${args[0]} timed out after ${Math.round(timeoutMs / 1000)}s.`, isError: true };
21 const out = [r.stdout.trim(), r.stderr.trim()].filter(Boolean).join('\n');
22 return { content: out || '(no output)', isError: !r.ok };
23}
24
25// ---- docker_ps ----
26const PsArgs = z.object({ all: z.boolean().optional().describe('Include stopped containers (docker ps -a). Default false.') });

Callers 6

executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls 2

runProcessFunction · 0.85
notInstalledMessageFunction · 0.85

Tested by

no test coverage detected