You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# bash-env
1
+
# just-bash
2
2
3
3
A simulated bash environment with an in-memory virtual filesystem, written in TypeScript.
4
4
@@ -30,25 +30,25 @@ Supports optional network access via `curl` with secure-by-default URL filtering
30
30
## Security model
31
31
32
32
- The shell only has access to the provided file system.
33
-
- Execution is protected against infinite loops or recursion through. However, BashEnv is not fully robust against DOS from input. If you need to be robust against this, use process isolation at the OS level.
33
+
- Execution is protected against infinite loops or recursion through. However, Bash is not fully robust against DOS from input. If you need to be robust against this, use process isolation at the OS level.
34
34
- Binaries or even WASM are inherently unsupported (Use [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) or a similar product if a full VM is needed).
35
35
- There is no network access by default.
36
36
- Network access can be enabled, but requests are checked against URL prefix allow-lists and HTTP-method allow-lists. See [network access](#network-access) for details
37
37
38
38
## Installation
39
39
40
40
```bash
41
-
npm install bash-env
41
+
npm install just-bash
42
42
```
43
43
44
44
## Usage
45
45
46
46
### Basic API
47
47
48
48
```typescript
49
-
import { BashEnv } from"bash-env";
49
+
import { Bash } from"just-bash";
50
50
51
-
const env =newBashEnv();
51
+
const env =newBash();
52
52
awaitenv.exec('echo "Hello" > greeting.txt');
53
53
const result =awaitenv.exec("cat greeting.txt");
54
54
console.log(result.stdout); // "Hello\n"
@@ -61,7 +61,7 @@ Each `exec()` is isolated—env vars, functions, and cwd don't persist across ca
Creates a bash tool for use with the [AI SDK](https://ai-sdk.dev/):
99
99
100
100
```typescript
101
-
import { createBashTool } from"bash-env/ai";
101
+
import { createBashTool } from"just-bash/ai";
102
102
import { generateText } from"ai";
103
103
104
104
const bashTool =createBashTool({
@@ -116,10 +116,10 @@ See [`examples/bash-agent`](./examples/bash-agent) for a full implementation.
116
116
117
117
### Vercel Sandbox Compatible API
118
118
119
-
BashEnv provides a `Sandbox` class that's API-compatible with [`@vercel/sandbox`](https://vercel.com/docs/vercel-sandbox), making it easy to swap implementations. You can start with BashEnv and switch to a real sandbox when you need the power of a full VM (e.g. to run node, python, or custom binaries).
119
+
Bash provides a `Sandbox` class that's API-compatible with [`@vercel/sandbox`](https://vercel.com/docs/vercel-sandbox), making it easy to swap implementations. You can start with Bash and switch to a real sandbox when you need the power of a full VM (e.g. to run node, python, or custom binaries).
0 commit comments