Select the types of activity you want to include in your feed.
Revamp CLI README and rename sshkey command
Bump CLI version to 0.2.0, add eventsource/ws/libsodium-wrappers and update bun.lock. Remove unused Profile import and adjust command name from "sshkey" to "sshkeys" in the CLI entrypoint.
···11# Pocketenv CLI
2233-To install dependencies:
33+[](https://www.npmjs.com/package/@pocketenv/cli)
44+[](https://discord.gg/9ada4pFUFS)
55+[](https://opensource.org/licenses/MPL-2.0)
66+77+The official CLI for [Pocketenv](https://pocketenv.io) — create, manage, and connect to isolated sandboxes from your terminal. Powered by AT Protocol for open, portable, and vendor-agnostic sandbox definitions.
88+99+> [!NOTE]
1010+> **Still in development**
1111+>
1212+> This project is in early development. Expect breaking changes and rapid iteration.
1313+1414+## Installation
1515+1616+```sh
1717+npm install -g @pocketenv/cli
1818+```
1919+2020+```sh
2121+pnpm add -g @pocketenv/cli
2222+```
2323+2424+```sh
2525+bun add -g @pocketenv/cli
2626+```
2727+2828+Verify the installation:
2929+3030+```sh
3131+pocketenv --version
3232+```
3333+3434+## Quick Start
3535+3636+```sh
3737+# 1. Log in with your AT Proto account (e.g. Bluesky)
3838+pocketenv login <handle>.bsky.social
3939+4040+# 2. Create a sandbox
4141+pocketenv create
4242+4343+# 3. Start it
4444+pocketenv start <sandbox-name>
4545+4646+# 4. Open an interactive shell inside it
4747+pocketenv console <sandbox-name>
4848+```
4949+5050+## Authentication
5151+5252+Pocketenv uses [AT Protocol](https://atproto.com) for authentication. You need an AT Proto account (e.g. a [Bluesky](https://bsky.app) account) to use the CLI.
5353+5454+### Login
5555+5656+```sh
5757+pocketenv login <handle>
5858+```
5959+6060+Authenticates with your AT Proto handle. A browser window will open for you to authorize the app. Your session token is saved locally at `~/.pocketenv/token.json`.
6161+6262+**Example:**
6363+6464+```sh
6565+pocketenv login alice.bsky.social
6666+```
6767+6868+### Whoami
6969+7070+```sh
7171+pocketenv whoami
7272+```
7373+7474+Displays the currently logged-in user.
7575+7676+### Logout
7777+7878+```sh
7979+pocketenv logout
8080+```
8181+8282+Removes your local session token.
8383+8484+---
8585+8686+## Commands
8787+8888+### Sandbox Management
8989+9090+#### `pocketenv create [name]`
9191+9292+Create a new sandbox. Aliases: `new`
9393+9494+| Option | Description |
9595+|-----------------------------|---------------------------------------------|
9696+| `--provider, -p <provider>` | The provider to use (default: `cloudflare`) |
49755-```bash
66-bun install
9898+```sh
9999+pocketenv create my-sandbox
100100+pocketenv create my-sandbox --provider cloudflare
7101```
810299-To run:
103103+Supported providers: `cloudflare`, `daytona`, `deno`, `vercel`, `sprites`.
104104+105105+---
106106+107107+#### `pocketenv ls`
101081111-```bash
1212-bun run index.ts
109109+List all your sandboxes with their status and creation time.
110110+111111+```sh
112112+pocketenv ls
13113```
141141515-This project was created using `bun init` in bun v1.3.10. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
115115+Output example:
116116+117117+```
118118+NAME BASE STATUS CREATED AT
119119+true-punter-0nan openclaw RUNNING 33 minutes ago
120120+ruinous-straw-wz8n nix STOPPED 2 days ago
121121+narrative-shift-j80dx zeroclaw STOPPED 11 days ago
122122+mad-ambulance-k9eu nullclaw STOPPED 11 days ago
123123+revered-amateur-n6rz opencrust STOPPED 11 days ago
124124+high-priced-vac-ek73 picoclaw STOPPED 11 days ago
125125+```
126126+127127+---
128128+129129+#### `pocketenv start <sandbox>`
130130+131131+Start a stopped sandbox.
132132+133133+```sh
134134+pocketenv start my-sandbox
135135+```
136136+137137+---
138138+139139+#### `pocketenv stop <sandbox>`
140140+141141+Stop a running sandbox.
142142+143143+```sh
144144+pocketenv stop my-sandbox
145145+```
146146+147147+---
148148+149149+#### `pocketenv rm <sandbox>`
150150+151151+Delete a sandbox permanently. Aliases: `delete`, `remove`
152152+153153+```sh
154154+pocketenv rm my-sandbox
155155+```
156156+157157+---
158158+159159+### Interactive Shell
160160+161161+#### `pocketenv console [sandbox]`
162162+163163+Open an interactive shell inside a running sandbox. Aliases: `shell`, `ssh`, `s`
164164+165165+```sh
166166+# Connect to a specific sandbox
167167+pocketenv console my-sandbox
168168+169169+# Omit the name to auto-connect to the first running sandbox
170170+pocketenv console
171171+```
172172+173173+---
174174+175175+### Environment Variables
176176+177177+Manage environment variables scoped to a sandbox.
178178+179179+#### `pocketenv env put <sandbox> <key> <value>`
180180+181181+Set an environment variable.
182182+183183+```sh
184184+pocketenv env put my-sandbox DATABASE_URL postgres://localhost/mydb
185185+```
186186+187187+#### `pocketenv env list <sandbox>`
188188+189189+List all environment variables for a sandbox. Aliases: `ls`
190190+191191+```sh
192192+pocketenv env list my-sandbox
193193+pocketenv env ls my-sandbox
194194+```
195195+196196+#### `pocketenv env delete <sandbox> <key>`
197197+198198+Remove an environment variable. Aliases: `rm`, `remove`
199199+200200+```sh
201201+pocketenv env delete my-sandbox DATABASE_URL
202202+```
203203+204204+---
205205+206206+### Secrets
207207+208208+Manage encrypted secrets scoped to a sandbox.
209209+210210+#### `pocketenv secret put <sandbox> <key>`
211211+212212+Store a secret in a sandbox (value is prompted securely).
213213+214214+```sh
215215+pocketenv secret put my-sandbox API_KEY
216216+```
217217+218218+#### `pocketenv secret list <sandbox>`
219219+220220+List all secret keys stored in a sandbox. Aliases: `ls`
221221+222222+```sh
223223+pocketenv secret list my-sandbox
224224+```
225225+226226+#### `pocketenv secret delete <sandbox> <key>`
227227+228228+Delete a secret from a sandbox. Aliases: `rm`, `remove`
229229+230230+```sh
231231+pocketenv secret delete my-sandbox API_KEY
232232+```
233233+234234+---
235235+236236+### SSH Keys
237237+238238+Manage SSH keys associated with a sandbox.
239239+240240+#### `pocketenv sshkeys put <sandbox>`
241241+242242+Upload an SSH key pair to a sandbox.
243243+244244+| Option | Description |
245245+|-----------------|-----------------------------|
246246+| `--private-key` | Path to the SSH private key |
247247+| `--public-key` | Path to the SSH public key |
248248+249249+```sh
250250+pocketenv sshkeys put my-sandbox
251251+```
252252+253253+#### `pocketenv sshkeys get <sandbox>`
254254+255255+Retrieve the public SSH key from a sandbox.
256256+257257+```sh
258258+pocketenv sshkeys get my-sandbox
259259+```
260260+261261+---
262262+263263+### Tailscale
264264+265265+Manage Tailscale integration for your sandboxes.
266266+267267+#### `pocketenv tailscale put <sandbox>`
268268+269269+Store a Tailscale auth key in a sandbox.
270270+271271+```sh
272272+pocketenv tailscale put my-sandbox
273273+```
274274+275275+#### `pocketenv tailscale get <sandbox>`
276276+277277+Retrieve the stored Tailscale auth key (redacted) from a sandbox.
278278+279279+```sh
280280+pocketenv tailscale get my-sandbox
281281+```
282282+283283+---
284284+285285+## Environment Variables
286286+287287+The CLI can be configured via the following environment variables:
288288+289289+| Variable | Default | Description |
290290+|---------------------|----------------------------|-----------------------------------------------|
291291+| `POCKETENV_TOKEN` | _(none)_ | Override the session token (useful for CI/CD) |
292292+| `POCKETENV_API_URL` | `https://api.pocketenv.io` | Override the API base URL |
293293+| `POCKETENV_CF_URL` | `https://sbx.pocketenv.io` | Override the Cloudflare sandbox URL |
294294+| `POCKETENV_TTY_URL` | `https://api.pocketenv.io` | Override the TTY URL |
295295+296296+**Example — using a token in CI:**
297297+298298+```sh
299299+POCKETENV_TOKEN=<your-token> pocketenv ls
300300+```
301301+302302+---
303303+304304+## Use Cases
305305+306306+- Run AI agents (Codex, Claude, Gemini, OpenClaw, Copilot ...) safely in isolated environments
307307+- Spin up ephemeral dev sandboxes for quick prototyping
308308+- Share reproducible developer environments via AT Protocol
309309+- Test untrusted or third-party code securely
310310+- Provide sandbox infrastructure as a service
311311+312312+---
313313+314314+## Documentation
315315+316316+Full documentation is available at **[docs.pocketenv.io](https://docs.pocketenv.io)**.
317317+318318+---
319319+320320+## Contributing
321321+322322+Contributions are welcome! Please read the [Contributing Guidelines](https://github.com/pocketenv-io/pocketenv/blob/main/CONTRIBUTING.md) before submitting a pull request.
323323+324324+- **Bug reports & feature requests:** [Open an issue](https://github.com/pocketenv-io/pocketenv/issues/new)
325325+- **Community & feedback:** [Join our Discord](https://discord.gg/9ada4pFUFS)
326326+327327+---
328328+329329+## License
330330+331331+[Mozilla Public License 2.0](https://github.com/pocketenv-io/pocketenv/blob/main/LICENSE)
···55import { client } from "../../client";
66import { env } from "../../lib/env";
77import type { Sandbox } from "../../types/sandbox";
88-import type { Profile } from "../../types/profile";
98109// ── Protocol (mirrors @cloudflare/sandbox xterm addon) ───────────────────────
1110//
+3-3
apps/cli/src/index.ts
···150150 .description("delete an environment variable from the given sandbox")
151151 .action(deleteEnv);
152152153153-const sshkey = program.command("sshkey").description("manage SSH keys");
153153+const sshkeys = program.command("sshkeys").description("manage SSH keys");
154154155155-sshkey
155155+sshkeys
156156 .command("put")
157157 .argument("<sandbox>", "the sandbox to put the SSH key in")
158158 .option("--private-key", "the path to the SSH private key")
···160160 .description("put an SSH key in the given sandbox")
161161 .action(putKeys);
162162163163-sshkey
163163+sshkeys
164164 .command("get")
165165 .argument("<sandbox>", "the sandbox to get the SSH key from")
166166 .description("get an SSH key (public key only) from the given sandbox")