@agent-sh/harness-bash
v0.2.0
Published
Bash tool for AI agent harnesses — autonomous shell execution with pluggable executor, permission hook, cwd-carry, inactivity timeout, and background job support
Downloads
71
Maintainers
Readme
@agent-sh/harness-bash
Shell with tokio-style cwd-carry, inactivity + wall-clock timeouts, head+tail spill-to-file on overflow, and background jobs.
Part of the @agent-sh/harness-* monorepo — see the top-level README for architectural context and the full tool surface.
Install
npm install @agent-sh/harness-bashRequires Node ≥ 20.
Usage
import { bash, bash_output, bash_kill, createLocalBashExecutor } from "@agent-sh/harness-bash";
const session = {
cwd: process.cwd(),
permissions: { roots: [process.cwd()], sensitivePatterns: [], unsafeAllowBashWithoutHook: true },
executor: createLocalBashExecutor(),
logicalCwd: { value: process.cwd() },
};
const r = await bash({ command: "ls -la" }, session);Contract
The full contract — input shape, output discriminated-union, error codes, permission model, and acceptance tests — lives in agent-knowledge/design/bash.md. Changes to this package must stay in sync with that spec.
License
MIT © Avi Fenesh
