Open Agent Loops
API Reference

shellTool

@open-agent-loops/core


function shellTool(backend): Tool;

Defined in: tools/builtin/shell.ts:40

Build a shell tool bound to a backend.

Parameters

ParameterTypeDescription
backendShellBackendThe ShellBackend that actually executes commands on the host.

Returns

Tool

A Tool named shell ready to pass to the agent loop or a ToolRegistry.

Remarks

Runs sequentially (ExecutionMode.Sequential): shell commands commonly have side effects and order matters, so the loop must not race a batch of them against each other. Results are shaped by formatShellResult.

See

Example

const tool = shellTool(myShellBackend);
// Recommended: gate a shell tool before granting it to an untrusted model.
await runAgent({ ...opts, tools: [tool] });
// The model can now call: shell({ command: "ls -la" })

On this page