@kokorolx/ai-sandbox-wrapper 2.4.0 → 2.7.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
@@ -4,25 +4,57 @@
4
4
 
5
5
  Protect your SSH keys, API tokens, and system files while using AI tools that need filesystem access.
6
6
 
7
- *Last updated: February 6, 2026*
7
+ *Last updated: February 25, 2026*
8
8
 
9
- ## ✨ New in v2.3.0-beta: Web Mode & Port Exposure
9
+ ---
10
10
 
11
- - **Web Auto-Detection**: `opencode web` automatically exposes port 4096 and injects `--hostname 0.0.0.0`
12
- - **`--expose` Flag**: New way to expose ports (replaces deprecated `PORT` env var)
13
- - **Port Conflict Detection**: Fails fast if port is already in use
11
+ ## 📑 Table of Contents
12
+
13
+ - [What's New](#-whats-new)
14
+ - [Why Use This?](#️-why-use-this)
15
+ - [Quick Start](#-quick-start)
16
+ - [Configuration](#️-configuration)
17
+ - [API Keys](#api-keys)
18
+ - [Workspaces](#workspaces)
19
+ - [Port Exposure](#port-exposure)
20
+ - [Server Authentication](#server-authentication)
21
+ - [Network Access](#network-access)
22
+ - [Git Access](#git-access)
23
+ - [Clipboard](#clipboard)
24
+ - [Directory Structure](#-directory-structure)
25
+ - [Security Model](#-security-model)
26
+ - [Quick Reference](#-quick-reference)
27
+ - [Troubleshooting](#-troubleshooting)
28
+ - [Other Tools](#-other-tools)
29
+ - [Contributing](#-contributing)
30
+ - [License](#-license)
31
+
32
+ ---
33
+
34
+ ## ✨ What's New
35
+
36
+ ### v2.7.0: Git Fetch-Only Mode & Bundled Skills
37
+
38
+ - **Git Fetch-Only**: Allow git fetch/pull but block push — perfect for AI agents that should read but not write
39
+ - **Bundled Skills**: RTK token optimizer skills auto-installed for OpenCode users
40
+ - **SSH Config Fix**: Resolved crash during git credential setup
14
41
 
15
42
  ```bash
16
- # Web mode - automatic port exposure
17
- opencode web
43
+ # Fetch-only mode (no push allowed)
44
+ opencode --git-fetch
18
45
 
19
- # Custom port
20
- opencode web --port 8080
46
+ # Or select from interactive menu:
47
+ # 4) Fetch only - allow once (no push, this session)
48
+ # 5) Fetch only - always for this workspace (no push)
21
49
 
22
- # Expose additional ports
23
- opencode --expose 3000,5555 web
50
+ # Manage via CLI
51
+ npx @kokorolx/ai-sandbox-wrapper git fetch-only ~/projects/myrepo
52
+ npx @kokorolx/ai-sandbox-wrapper git full ~/projects/myrepo
53
+ npx @kokorolx/ai-sandbox-wrapper git status
24
54
  ```
25
55
 
56
+ ---
57
+
26
58
  ## 🛡️ Why Use This?
27
59
 
28
60
  | Without Sandbox | With AI Sandbox |
@@ -32,6 +64,8 @@ opencode --expose 3000,5555 web
32
64
  | Host environment exposed | ✅ API keys passed explicitly |
33
65
  | Runs with your permissions | ✅ Non-root, CAP_DROP=ALL |
34
66
 
67
+ ---
68
+
35
69
  ## 🚀 Quick Start
36
70
 
37
71
  **Prerequisites:** Docker Desktop (macOS/Windows) or Docker Engine (Linux)
@@ -49,9 +83,12 @@ opencode
49
83
 
50
84
  During setup: select **opencode**, choose registry images (faster), whitelist your project directories.
51
85
 
86
+ ---
87
+
52
88
  ## ⚙️ Configuration
53
89
 
54
90
  ### API Keys
91
+
55
92
  ```bash
56
93
  nano ~/.ai-sandbox/env
57
94
  ```
@@ -61,6 +98,7 @@ OPENAI_API_KEY=sk-...
61
98
  ```
62
99
 
63
100
  ### Workspaces
101
+
64
102
  ```bash
65
103
  npx @kokorolx/ai-sandbox-wrapper workspace add ~/projects/my-app
66
104
  # Or: echo '/path/to/project' >> ~/.ai-sandbox/workspaces
@@ -94,7 +132,7 @@ Output:
94
132
  🌐 Web UI available at http://localhost:4096
95
133
  ```
96
134
 
97
- ### Server Authentication (OpenCode web/serve)
135
+ ### Server Authentication
98
136
 
99
137
  Control authentication for OpenCode web server:
100
138
 
@@ -137,10 +175,93 @@ Git credentials are **not** shared by default. When you run a tool, you'll be pr
137
175
  ```
138
176
  🔐 Git Access Control
139
177
  1) Yes, allow once
140
- 2) Yes, always allow for this workspace
178
+ 2) Yes, always allow for this workspace
141
179
  3) No, keep Git disabled (secure default)
180
+ 4) Fetch only - allow once (no push, this session)
181
+ 5) Fetch only - always for this workspace (no push)
142
182
  ```
143
183
 
184
+ **Fetch-only mode** allows `git fetch`, `git pull`, `git clone` but blocks `git push`. Uses git's `pushInsteadOf` config — no network restrictions needed.
185
+
186
+ ```bash
187
+ # Force fetch-only via flag
188
+ opencode --git-fetch
189
+
190
+ # Manage via CLI
191
+ npx @kokorolx/ai-sandbox-wrapper git fetch-only ~/projects/myrepo
192
+ npx @kokorolx/ai-sandbox-wrapper git full ~/projects/myrepo
193
+ ```
194
+
195
+ ### Clipboard
196
+
197
+ Clipboard access in containers requires a terminal that supports **OSC52** protocol.
198
+
199
+ **Supported terminals:** iTerm2, Warp, Kitty, Alacritty, WezTerm, Windows Terminal, Ghostty
200
+
201
+ **Not supported:** GNOME Terminal, VS Code Terminal, Tilix, Terminator
202
+
203
+ Test if your terminal supports clipboard:
204
+ ```bash
205
+ printf "\033]52;c;$(printf "test" | base64)\a"
206
+ # Press Cmd+V / Ctrl+V - if you see "test", it works
207
+ ```
208
+
209
+ 📖 **Full details:** [CLIPBOARD_SUPPORT.md](CLIPBOARD_SUPPORT.md)
210
+
211
+ ### MCP Tools (Browser Automation)
212
+
213
+ During setup, you can optionally install MCP servers for AI agent browser automation:
214
+
215
+ | Tool | Maintainer | Features | Size |
216
+ |------|------------|----------|------|
217
+ | **Chrome DevTools MCP** | Google | Performance profiling, Core Web Vitals, detailed console/network inspection | ~400MB |
218
+ | **Playwright MCP** | Microsoft | Multi-browser (Chromium), TypeScript code generation, vision mode | ~300MB |
219
+
220
+ After installation, configure your MCP client (e.g., OpenCode) to use them:
221
+
222
+ **`~/.config/opencode/opencode.json`:**
223
+ ```json
224
+ {
225
+ "mcp": {
226
+ "chrome-devtools": {
227
+ "type": "local",
228
+ "command": [
229
+ "chrome-devtools-mcp",
230
+ "--headless",
231
+ "--isolated",
232
+ "--executablePath", "/opt/chromium",
233
+ "--chromeArg=--no-sandbox",
234
+ "--chromeArg=--disable-setuid-sandbox"
235
+ ]
236
+ },
237
+ "playwright": {
238
+ "type": "local",
239
+ "command": [
240
+ "npx", "@playwright/mcp@latest",
241
+ "--headless",
242
+ "--browser", "chromium",
243
+ "--no-sandbox"
244
+ ]
245
+ }
246
+ }
247
+ }
248
+ ```
249
+
250
+ > **Note:** The `--no-sandbox` flags are required when running in Docker containers. This is safe because the container itself provides isolation.
251
+
252
+ ### Bundled Skills (OpenCode)
253
+
254
+ OpenCode containers auto-install these skills on first run (existing skills are never overwritten):
255
+
256
+ | Skill | Description |
257
+ |-------|-------------|
258
+ | `rtk` | Command reference for RTK token optimizer (60-90% token savings) |
259
+ | `rtk-setup` | Persistent RTK enforcement — updates AGENTS.md and propagates to subagents |
260
+
261
+ Skills are copied to `~/.config/opencode/skills/` and available immediately.
262
+
263
+ ---
264
+
144
265
  ## 📁 Directory Structure
145
266
 
146
267
  ```
@@ -156,6 +277,8 @@ Native configs are bind-mounted:
156
277
  - `~/.config/opencode` ↔ `/home/agent/.config/opencode`
157
278
  - `~/.local/share/opencode` ↔ `/home/agent/.local/share/opencode`
158
279
 
280
+ ---
281
+
159
282
  ## 🔐 Security Model
160
283
 
161
284
  ```
@@ -177,6 +300,8 @@ Native configs are bind-mounted:
177
300
  └─────────────────────────────────────────────────┘
178
301
  ```
179
302
 
303
+ ---
304
+
180
305
  ## 📚 Quick Reference
181
306
 
182
307
  ```bash
@@ -192,11 +317,16 @@ opencode -e 3000,4000 # Multiple ports
192
317
  # Network
193
318
  opencode -n mynetwork # Join Docker network
194
319
 
320
+ # Git fetch-only
321
+ opencode --git-fetch # Fetch only (no push)
322
+
195
323
  # Management
196
324
  npx @kokorolx/ai-sandbox-wrapper workspace list
197
325
  npx @kokorolx/ai-sandbox-wrapper clean
198
326
  ```
199
327
 
328
+ ---
329
+
200
330
  ## ❓ Troubleshooting
201
331
 
202
332
  | Issue | Solution |
@@ -205,6 +335,9 @@ npx @kokorolx/ai-sandbox-wrapper clean
205
335
  | `Outside whitelisted workspace` | `echo "$(pwd)" >> ~/.ai-sandbox/workspaces` |
206
336
  | Port already in use | Stop the process or use different port |
207
337
  | Docker not found | Install and start Docker Desktop |
338
+ | Clipboard not working | Use OSC52-compatible terminal. See [CLIPBOARD_SUPPORT.md](CLIPBOARD_SUPPORT.md) |
339
+
340
+ ---
208
341
 
209
342
  ## 📦 Other Tools
210
343
 
@@ -212,10 +345,14 @@ This sandbox also supports **Claude, Gemini, Aider, Kilo, Codex, Amp, Qwen**, an
212
345
 
213
346
  See [TOOLS.md](TOOLS.md) for the full list and tool-specific configuration.
214
347
 
348
+ ---
349
+
215
350
  ## 🤝 Contributing
216
351
 
217
352
  See [CONTRIBUTING.md](CONTRIBUTING.md).
218
353
 
354
+ ---
355
+
219
356
  ## 📝 License
220
357
 
221
358
  MIT