@crewspace/tools-shell
v0.1.0
Published
Shell tools for Crewspace agents — execute commands with timeout and sandbox safety
Maintainers
Readme
@crewspace/tools-shell
Shell tools for Crewspace agents — execute commands with timeout and sandbox safety.
Part of the Crewspace agent orchestration framework.
Installation
npm install @crewspace/tools-shellUsage
import { createShellTools } from '@crewspace/tools-shell';
// Create shell tools with a sandbox base path
const tools = createShellTools({ basePath: '/workspace/project' });
// Register with an agent
agent.addTool(tools.shellExec);Individual Tools
import { createShellExecTool } from '@crewspace/tools-shell';
const shellExec = createShellExecTool('/workspace');Destructive Command Detection
import { checkDestructiveCommand, DESTRUCTIVE_PATTERNS } from '@crewspace/tools-shell';
const warning = checkDestructiveCommand('rm -rf /');
// Returns a warning string if the command matches known destructive patternsAPI
createShellTools(options?)
Creates the shell tools bundle.
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| basePath | string | process.cwd() | Sandbox root for command execution |
| defaultTimeoutMs | number | 30000 | Default command timeout |
Tools
- shellExec — Execute a shell command with timeout, sandbox, and output truncation
Constants
DEFAULT_SHELL_TIMEOUT_MS— 30,000 msMAX_SHELL_TIMEOUT_MS— 300,000 ms (5 minutes)MAX_OUTPUT_SIZE— 1 MB
License
MIT
