just-bash 2.7.2 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -283,7 +283,7 @@ pnpm shell --no-network
283
283
 
284
284
  ### Data Processing
285
285
 
286
- `jq` (JSON), `python3`/`python` (Python via Pyodide), `sqlite3` (SQLite), `xan` (CSV), `yq` (YAML/XML/TOML/CSV)
286
+ `jq` (JSON), `python3`/`python` (Python via Pyodide; required opt-in), `sqlite3` (SQLite), `xan` (CSV), `yq` (YAML/XML/TOML/CSV)
287
287
 
288
288
  ### Compression & Archives
289
289
 
@@ -360,6 +360,24 @@ const env = new Bash({
360
360
 
361
361
  **Note:** The `curl` command only exists when network is configured. Without network configuration, `curl` returns "command not found".
362
362
 
363
+ ## Python Support
364
+
365
+ Python support via Pyodide is opt-in due to additional security surface. Enable it explicitly, but be aware of the risk:
366
+
367
+ ```typescript
368
+ const env = new Bash({
369
+ python: true,
370
+ });
371
+
372
+ // Execute Python code
373
+ await env.exec('python3 -c "print(1 + 2)"');
374
+
375
+ // Run Python scripts
376
+ await env.exec('python3 script.py');
377
+ ```
378
+
379
+ **Note:** The `python3` and `python` commands only exist when `python: true` is configured. Python is not available in browser environments.
380
+
363
381
  ## SQLite Support
364
382
 
365
383
  The `sqlite3` command uses sql.js (WASM-based SQLite) which is fully sandboxed and cannot access the real filesystem:
package/dist/Bash.d.ts CHANGED
@@ -51,6 +51,12 @@ export interface BashOptions {
51
51
  * Network access is disabled by default - you must explicitly configure allowed URLs.
52
52
  */
53
53
  network?: NetworkConfig;
54
+ /**
55
+ * Enable python3/python commands.
56
+ * Python is disabled by default as it introduces additional security surface
57
+ * (arbitrary code execution via pyodide).
58
+ */
59
+ python?: boolean;
54
60
  /**
55
61
  * Optional list of command names to register.
56
62
  * If not provided, all built-in commands are available.