🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@ag-bash/bash

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-bash/bash

Unified Agentic Bash for Ag-Bash

Source
npmnpm
Version
6.0.2
Version published
Weekly downloads
27
-38.64%
Maintainers
1
Weekly downloads
 
Created
Source

@ag-bash/bash

AI-Native Sandboxed Bash Runtime for TypeScript

npm version License: Apache-2.0

A complete bash interpreter with an in-memory filesystem, built for AI agents and TypeScript applications. No VM, no Docker, no native dependencies.

Quick Start

npm install @ag-bash/bash
// Direct execution
import { Bash } from "@ag-bash/bash";
const bash = new Bash();
const result = await bash.exec("echo hello");
console.log(result.stdout); // "hello\n"

// Tagged template (zx-style)
import { createShell } from "@ag-bash/bash";
const $ = createShell();
const name = "world";
await $`echo ${name}`;

// Agent RunLoop
import { RunLoop } from "@ag-bash/bash/agent-runtime";

Export Paths

Import PathContents
@ag-bash/bashCore API: Bash, createShell, shellEscape, defineCommand
@ag-bash/bash/agent-runtimeRunLoop, BudgetManager, LLMProvider
@ag-bash/bash/testingcreateTestBash, assertions, fixtures
@ag-bash/bash/aiMulti-framework adapters (OpenAI, Anthropic, LangChain, Vercel)
@ag-bash/bash/slimMinimal API surface for bundle-sensitive environments
@ag-bash/bash/advancedFull internal surface for power users

Key Features

  • 100+ built-in commandsgrep, sed, awk, jq, find, xargs, and more
  • Pluggable filesystems — InMemory (default), Overlay (copy-on-write), ReadWrite (real disk), Mountable (multi-mount)
  • Full shell syntax — Pipes, redirections, loops, functions, globs, variable expansion
  • Optional runtimes — Python (CPython/WASM) and JavaScript (QuickJS/WASM)
  • Agentic toolsag-edit, ag-diff, ag-snapshot, ag-analyze, ag-todo, ag-plan
  • Custom commands — Extend with defineCommand() and full pipe/redirect support
  • Security-first — No host filesystem access by default, no network, prototype-pollution hardened
  • Zero native deps — Pure TypeScript, runs in Node.js and browsers

Configuration

const bash = new Bash({
  files: { "/data/config.json": '{"key": "value"}' },
  env: { NODE_ENV: "production" },
  cwd: "/app",
  runtimes: { python: true, javascript: true },
  agentic: { enabled: true },
});

Security Model

  • In-memory filesystem by default (no host access)
  • No network access unless explicitly allowed via URL allowlists
  • Python/JS runtimes disabled by default
  • Prototype-pollution defenses via null-prototype objects throughout

License

Apache-2.0

FAQs

Package last updated on 31 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts