@vite-hub/shell
v0.0.1
Published
Unified shell runtimes for ViteHub.
Maintainers
Readme
@vite-hub/shell
@vite-hub/shell gives agents and workspace tools structured command execution with explicit boundaries.
Install
pnpm add @vite-hub/shellMinimal API
// server/utils/shell.ts
import { analyzeShellCommand, createShellRuntime } from "@vite-hub/shell"
import type { ShellExecutionProvider } from "@vite-hub/shell"
const provider: ShellExecutionProvider = {
boundary: {
cwd: true,
env: true,
filesystem: { writable: false },
network: false,
processes: { background: false, interactive: false },
streaming: false,
timeout: { enforcedBy: "runtime", supported: true },
},
async exec(command) {
return {
command,
event: "command_finished",
exitCode: 0,
stderr: "",
stdout: "ok\n",
}
},
}
const runtime = createShellRuntime({ provider, policy: { maxShellCalls: 5 } })
const analysis = await analyzeShellCommand("echo ok")
const result = analysis.ok ? await runtime.exec("echo ok") : undefinedUsed by
workspaceShell() in @vite-hub/agent uses this package to expose scoped shell work to an agent. Workspace adapters live in @vite-hub/shell/workspace.
Built on just-bash for the built-in shell provider and sh-syntax for command analysis.
Learn more at vitehub.dev.
