viberun 0.3.7 → 0.4.2

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,7 +4,7 @@
4
4
 
5
5
  # viberun
6
6
 
7
- `viberun` is a CLI-first, agent-native app host. Run `viberun <app>` locally and get dropped into an agent session inside a persistent Ubuntu container on a remote host. App data is stored under `/home/viberun` and survives container restarts or image updates.
7
+ `viberun` is a shell-first, agent-native app host. Run `viberun` to open the shell, then `vibe <app>` to jump into a persistent Ubuntu container on a remote host. App data is stored under `/home/viberun` and survives container restarts or image updates.
8
8
 
9
9
  ## Quick start (end-to-end)
10
10
 
@@ -35,30 +35,39 @@ Or with env vars:
35
35
  curl -fsSL https://viberun.sh | VIBERUN_INSTALL_DIR=~/.local/bin VIBERUN_INSTALL_BIN=viberun bash
36
36
  ```
37
37
 
38
- ### 2) Bootstrap a host (once per VM)
38
+ ### 2) Connect a host (once per VM)
39
39
 
40
- Use any SSH host alias (for example, `myhost` in `~/.ssh/config`):
40
+ Start the shell:
41
41
 
42
42
  ```bash
43
- viberun bootstrap myhost
43
+ viberun
44
44
  ```
45
45
 
46
- Optional: set it as your default host (and agent) so you can omit `@host` later:
46
+ If this is the first time, you'll see a setup banner. Type:
47
47
 
48
48
  ```bash
49
- viberun config --host myhost --agent codex
49
+ setup
50
+ ```
51
+
52
+ Enter your SSH login (for example, `user@myhost` in `~/.ssh/config`).
53
+ You can also run setup directly from the CLI:
54
+
55
+ ```bash
56
+ viberun setup myhost
50
57
  ```
51
58
 
52
59
  ### 3) Start your first app
53
60
 
61
+ Inside the shell:
62
+
54
63
  ```bash
55
- viberun hello-world
64
+ vibe hello-world
56
65
  ```
57
66
 
58
- If this is the first run, the server will prompt to create the container. Press Enter to accept.
67
+ If this is the first run, the server will create the container.
59
68
 
60
- Detach without stopping the agent: Ctrl-\\ . Reattach later with `viberun hello-world`.
61
- Paste clipboard images into the session with Ctrl-V; `viberun` uploads the image and inserts a `/tmp/viberun-clip-*.png` path.
69
+ Detach without stopping the agent: Ctrl-\\ . Reattach later with `vibe hello-world`.
70
+ Paste clipboard images into the session with Ctrl-V; viberun uploads the image and inserts a `/tmp/viberun-clip-*.png` path.
62
71
 
63
72
  ### 4) Hello-world prompt (paste inside the session)
64
73
 
@@ -68,35 +77,31 @@ Create a beautiful hello-world web app with a simple, tasteful landing page.
68
77
 
69
78
  ### 5) Open the app
70
79
 
71
- While the session is active, `viberun` starts a localhost proxy to the host port. The agent will print a URL like:
80
+ From the shell:
72
81
 
73
- ```
74
- http://localhost:8080
82
+ ```bash
83
+ open hello-world
75
84
  ```
76
85
 
77
- Open it in your browser.
78
- If you've configured app URLs, `viberun <app> url` shows the HTTPS address.
86
+ When the shell starts, viberun forwards app ports automatically. `open` prefers a public URL if configured; otherwise it uses the localhost URL.
79
87
 
80
88
  ## Common commands
81
89
 
90
+ Shell commands (inside `viberun`):
91
+
82
92
  ```bash
83
- viberun myapp
84
- viberun myapp@hostb
85
- viberun --forward-agent myapp
86
- viberun myapp shell
87
- viberun myapp snapshot
88
- viberun myapp snapshots
89
- viberun myapp restore latest
90
- viberun myapp url
91
- viberun myapp users
92
- viberun myapp --delete -y
93
- viberun myapp update
94
- viberun bootstrap [<host>]
95
- viberun proxy setup
96
- viberun users list
97
- viberun wipe
98
- viberun config --host myhost --agent codex
99
- viberun version
93
+ vibe myapp
94
+ open myapp
95
+ apps
96
+ app myapp
97
+ rm myapp
98
+ ```
99
+
100
+ CLI commands (advanced):
101
+
102
+ ```bash
103
+ viberun setup [<host>]
104
+ viberun wipe [<host>]
100
105
  ```
101
106
 
102
107
  <details>
@@ -110,7 +115,7 @@ viberun version
110
115
  - [High-level flow](#high-level-flow)
111
116
  - [Core components](#core-components)
112
117
  - [Session lifecycle](#session-lifecycle)
113
- - [Bootstrap pipeline](#bootstrap-pipeline)
118
+ - [Setup pipeline](#setup-pipeline)
114
119
  - [Networking and ports](#networking-and-ports)
115
120
  - [App URLs and proxy](#app-urls-and-proxy)
116
121
  - [Snapshots and restore](#snapshots-and-restore)
@@ -130,10 +135,10 @@ Git, SSH, and the GitHub CLI are installed in containers. viberun seeds `git con
130
135
 
131
136
  Choose one of these auth paths:
132
137
 
133
- - **SSH (agent forwarding)**: Run `viberun --forward-agent <app>`. For existing apps, run `viberun <app> update` once to recreate the container with the agent socket mounted. Then `ssh -T git@github.com` inside the container to verify access.
138
+ - **SSH (agent forwarding)**: Start viberun with `VIBERUN_FORWARD_AGENT=1 viberun`, then `vibe <app>`. For existing apps, run `app <app>` followed by `update` once to recreate the container with the agent socket mounted. Then `ssh -T git@github.com` inside the container to verify access.
134
139
  - **HTTPS (GitHub CLI)**: Run `gh auth login` and choose HTTPS, then `gh auth setup-git`. Verify with `gh auth status`.
135
140
 
136
- If you update your local Git identity later, restart the app container (or run `viberun <app> update`) to re-apply the new values on startup.
141
+ If you update your local Git identity later, restart the app container (or run `app <app>` then `update`) to re-apply the new values on startup.
137
142
 
138
143
  ## Development
139
144
 
@@ -182,23 +187,23 @@ bin/viberun-e2e-local
182
187
  bin/viberun-integration
183
188
  ```
184
189
 
185
- ### Bootstrap in development
190
+ ### Setup in development
186
191
 
187
- When you run `viberun` via `go run` (or a dev build), bootstrap defaults to staging the local server binary and building the container image locally. This is equivalent to:
192
+ When you run `viberun` via `go run` (or set `VIBERUN_DEV=1`), setup defaults to staging the local server binary and building the container image locally. Run:
188
193
 
189
194
  ```bash
190
- viberun bootstrap --local --local-image myhost
195
+ viberun
196
+ setup
191
197
  ```
192
198
 
193
- Under the hood, it builds a `viberun:dev` image for the host architecture, streams it over `ssh` with `docker save | docker load`, and tags it as `viberun:latest` on the host.
194
-
195
- If you want to explicitly pass a local server binary:
199
+ Or directly:
196
200
 
197
201
  ```bash
198
- mise exec -- go build -o /tmp/viberun-server ./cmd/viberun-server
199
- viberun bootstrap --local-path /tmp/viberun-server myhost
202
+ viberun setup myhost
200
203
  ```
201
204
 
205
+ Under the hood, it builds a `viberun:dev` image for the host architecture, streams it over `ssh` with `docker save | docker load`, and tags it as `viberun:latest` on the host.
206
+
202
207
  For the full build/test/E2E flow, see `DEVELOPMENT.md`.
203
208
 
204
209
  ## Architecture
@@ -206,16 +211,17 @@ For the full build/test/E2E flow, see `DEVELOPMENT.md`.
206
211
  ### High-level flow
207
212
 
208
213
  ```
209
- viberun <app>
210
- -> ssh <host>
211
- -> viberun-server <app>
212
- -> docker container viberun-<app>
213
- -> agent session (tmux)
214
+ viberun (shell)
215
+ -> vibe <app>
216
+ -> ssh <host>
217
+ -> viberun-server gateway (mux)
218
+ -> viberun-server <app>
219
+ -> docker container viberun-<app>
220
+ -> agent session (tmux)
214
221
 
215
222
  container port 8080
216
223
  -> host port (assigned per app)
217
- -> ssh -L localhost:<port>
218
- -> http://localhost:<port>
224
+ -> mux forward -> http://localhost:<port>
219
225
  -> (optional) host proxy (Caddy)
220
226
  -> https://<app>.<domain>
221
227
  ```
@@ -223,7 +229,7 @@ container port 8080
223
229
  ### Core components
224
230
 
225
231
  - Client: `viberun` CLI on your machine.
226
- - Server: `viberun-server` executed on the host via SSH (no long-running daemon required).
232
+ - Server: `viberun-server gateway` executed on the host via SSH (no long-running daemon required).
227
233
  - Container: `viberun-<app>` Docker container built from the `viberun:latest` image.
228
234
  - Agent: runs inside the container in a tmux session (default provider: `codex`).
229
235
  - Host RPC: local Unix socket used by the container to request snapshot/restore operations.
@@ -231,14 +237,14 @@ container port 8080
231
237
 
232
238
  ### Session lifecycle
233
239
 
234
- 1. `viberun <app>` resolves the host (from `@host` or your default config) and runs `viberun-server` over SSH.
235
- 2. The server creates the container if needed, or starts it if it already exists.
240
+ 1. `viberun` connects to the host (from your saved config) and starts the `viberun-server gateway` over SSH.
241
+ 2. `vibe <app>` creates the container if needed, or starts it if it already exists.
236
242
  3. The agent process is attached via `docker exec` inside a tmux session so it persists across disconnects.
237
- 4. `viberun` sets up a local port forward so you can open the app on `http://localhost:<port>`.
243
+ 4. `viberun` forwards app ports when the shell starts so you can open `http://localhost:<port>` immediately.
238
244
 
239
- ### Bootstrap pipeline
245
+ ### Setup pipeline
240
246
 
241
- The bootstrap script (run on the host) does the following:
247
+ The setup script (run on the host) does the following:
242
248
 
243
249
  - Verifies the host is Ubuntu.
244
250
  - Installs Docker (if missing) and enables it.
@@ -246,9 +252,9 @@ The bootstrap script (run on the host) does the following:
246
252
  - Pulls the `viberun` container image from GHCR (unless using local image mode).
247
253
  - Downloads and installs the `viberun-server` binary.
248
254
 
249
- If bootstrap is run from a TTY, it will offer to set up a public domain name (same as `viberun proxy setup`).
255
+ If setup is run from a TTY, it will offer to set up a public domain name (same as `proxy setup` in the shell).
250
256
 
251
- Useful bootstrap overrides:
257
+ Useful setup overrides:
252
258
 
253
259
  - `VIBERUN_SERVER_REPO`: GitHub repo for releases (default `shayne/viberun`).
254
260
  - `VIBERUN_SERVER_VERSION`: release tag or `latest`.
@@ -263,41 +269,41 @@ Useful bootstrap overrides:
263
269
 
264
270
  - Each app container exposes port `8080` internally.
265
271
  - The host port is assigned per app (starting at `8080`) and stored in the host server state.
266
- - `viberun` opens an SSH local forward so `http://localhost:<port>` connects to the host port.
272
+ - `viberun` forwards app ports when the shell starts so `http://localhost:<port>` connects to the host port.
267
273
  - If the proxy is configured, apps can also be served over HTTPS at `https://<app>.<domain>` (or a custom domain). Access requires login by default and can be made public per app.
268
274
 
269
275
  ### App URLs and proxy
270
276
 
271
277
  `viberun` can optionally expose apps via a host-side proxy (Caddy + `viberun-auth`).
272
- Set it up once per host:
278
+ Set it up once per host (inside the shell):
273
279
 
274
280
  ```bash
275
- viberun proxy setup [<host>]
281
+ proxy setup [<host>]
276
282
  ```
277
283
 
278
284
  You'll be prompted for a base domain and public IP (for DNS), plus a primary username/password.
279
285
  Create an A record (or wildcard) pointing to the host's public IP.
280
286
 
281
- After setup:
287
+ After setup, in the shell:
282
288
 
283
- - `viberun <app> url` shows the current URL and access status.
284
- - `viberun <app> url --make-public` or `--require-login` toggles access (default requires login).
285
- - `viberun <app> url --set-domain <domain>` or `--reset-domain` manages custom domains.
286
- - `viberun <app> url --disable` or `--enable` turns the URL off/on.
287
- - `viberun <app> url --open` opens the URL in your browser.
288
- - `viberun users ...` manages login accounts; `viberun <app> users` controls who can access the app.
289
+ - `app <app>` then `url` shows the current URL and access status.
290
+ - `url public` or `url private` toggles access (default requires login).
291
+ - `url set-domain <domain>` or `url reset-domain` manages custom domains.
292
+ - `url disable` or `url enable` turns the URL off/on.
293
+ - `url open` opens the URL in your browser.
294
+ - `users` manages login accounts; `app <app>` then `users` controls who can access the app.
289
295
 
290
- If URL settings change, run `viberun <app> update` to refresh `VIBERUN_PUBLIC_URL` and `VIBERUN_PUBLIC_DOMAIN` inside the container.
296
+ If URL settings change, run `app <app>` then `update` to refresh `VIBERUN_PUBLIC_URL` and `VIBERUN_PUBLIC_DOMAIN` inside the container.
291
297
 
292
298
  ### Snapshots and restore
293
299
 
294
300
  Snapshots are Btrfs subvolume snapshots of the app's `/home/viberun` volume (auto-incremented versions).
295
301
  On the host, each app uses a loop-backed Btrfs file under `/var/lib/viberun/apps/<app>/home.btrfs`.
296
302
 
297
- - `viberun <app> snapshot` creates the next `vN` snapshot.
298
- - `viberun <app> snapshots` lists versions with timestamps.
299
- - `viberun <app> restore <vN|latest>` restores from a snapshot (`latest` picks the highest `vN`).
300
- - `viberun <app> --delete -y` removes the container, the app volume + snapshots, and the host RPC directory.
303
+ - `app <app>` then `snapshot` creates the next `vN` snapshot.
304
+ - `app <app>` then `snapshots` lists versions with timestamps.
305
+ - `app <app>` then `restore <vN|latest>` restores from a snapshot (`latest` picks the highest `vN`).
306
+ - `rm <app>` removes the container, the app volume + snapshots, and the host RPC directory.
301
307
 
302
308
  Restore details:
303
309
  - The host stops the container (if running) to safely unmount the volume.
@@ -331,19 +337,19 @@ Supported agent providers:
331
337
  - `ampcode` (alias: `amp`)
332
338
  - `opencode`
333
339
 
334
- Custom agents can be run via `npx:<pkg>` or `uvx:<pkg>` (for example, `viberun --agent npx:@sourcegraph/amp@latest <app>`).
340
+ Custom agents can be run via `npx:<pkg>` or `uvx:<pkg>` (for example, set `config set agent npx:@sourcegraph/amp@latest` in the shell).
335
341
 
336
- Set globally with `viberun config --agent <provider>` or per-run with `viberun --agent <provider> <app>`.
337
- To forward your local SSH agent into the container, use `viberun --forward-agent <app>`. For existing apps, run `viberun <app> update` once to recreate the container with the agent socket mounted.
342
+ Set the default agent with `config set agent <provider>` in the shell.
343
+ To forward your local SSH agent into the container, start viberun with `VIBERUN_FORWARD_AGENT=1 viberun`. For existing apps, run `app <app>` then `update` once to recreate the container with the agent socket mounted.
338
344
 
339
345
  Base skills are shipped in `/opt/viberun/skills` and symlinked into each agent's skills directory. User skills can be added directly to the agent-specific skills directory under `/home/viberun`.
340
346
 
341
347
  ### Security model
342
348
 
343
- - All control traffic goes over SSH; the server is invoked on demand and does not expose a network port.
349
+ - All control traffic goes over the mux over SSH; the server is invoked on demand and does not expose a network port.
344
350
  - The host RPC socket is local-only and protected by filesystem permissions and a per-session token.
345
351
  - Containers are isolated by Docker and only the app port is exposed.
346
- - App URLs are optional: the proxy requires login by default and can be made public per app with `viberun <app> url --make-public`.
352
+ - App URLs are optional: the proxy requires login by default and can be made public per app with `app <app>` then `url public`.
347
353
 
348
354
  ### Wipe (safety)
349
355
 
@@ -372,9 +378,9 @@ Locally, it removes `~/.config/viberun/config.toml` (and legacy config if presen
372
378
 
373
379
  ### Troubleshooting
374
380
 
375
- - `unsupported OS: ... expected ubuntu`: bootstrap currently supports Ubuntu only.
376
- - `docker is required but was not found in PATH`: install Docker on the host or re-run bootstrap.
377
- - `missing btrfs on host`: rerun bootstrap to install `btrfs-progs` and ensure sudo access.
378
- - `no host provided and no default host configured`: run `viberun config --host myhost` or use `myapp@host`.
379
- - `container image architecture mismatch`: delete and recreate the app (`viberun <app> --delete -y`).
380
- - `proxy is not configured`: run `viberun proxy setup` (then retry `viberun <app> url`).
381
+ - `unsupported OS: ... expected ubuntu`: setup currently supports Ubuntu only.
382
+ - `docker is required but was not found in PATH`: install Docker on the host or rerun setup.
383
+ - `missing btrfs on host`: rerun setup to install `btrfs-progs` and ensure sudo access.
384
+ - `no host provided and no default host configured`: run `setup` in the shell or `viberun setup myhost`.
385
+ - `container image architecture mismatch`: delete and recreate the app (`rm <app>`).
386
+ - `proxy is not configured`: run `proxy setup` (then retry `app <app>` and `url`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viberun",
3
- "version": "0.3.7",
3
+ "version": "0.4.2",
4
4
  "license": "BSD-3-Clause",
5
5
  "bin": {
6
6
  "viberun": "bin/viberun.js"