@avocadostudio-ai/cli 0.1.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 ADDED
@@ -0,0 +1,59 @@
1
+ # @avocadostudio-ai/cli
2
+
3
+ Self-host launcher for the Avocado Studio editor UI. Serves a prebuilt editor bundle and points it at any [Avocado Studio orchestrator](https://github.com/avocadostudio-ai/avocado) you control.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ npx @avocadostudio-ai/cli start --orchestrator https://your-orchestrator.example.com
9
+ ```
10
+
11
+ The editor will be available at `http://127.0.0.1:4100`. Open it in your browser and it will connect to the orchestrator URL you passed.
12
+
13
+ If your preview site lives somewhere other than `http://localhost:3000`, pass `--preview <url>` too:
14
+
15
+ ```bash
16
+ npx @avocadostudio-ai/cli start \
17
+ --orchestrator https://orch.example.com \
18
+ --preview https://my-site.example.com
19
+ ```
20
+
21
+ ## What You Need
22
+
23
+ - An Avocado Studio orchestrator running and reachable from your browser. See the [orchestrator setup docs](https://github.com/avocadostudio-ai/avocado/tree/main/apps/orchestrator).
24
+ - A site that integrates the [`@ai-site-editor/site-sdk`](https://github.com/avocadostudio-ai/avocado/tree/main/packages/site-sdk) so the editor can load, edit, and publish to it.
25
+ - Node.js 22+.
26
+
27
+ ## Flags
28
+
29
+ | Flag | Env var | Default | Purpose |
30
+ |---|---|---|---|
31
+ | `--orchestrator <url>` | `AVOCADO_ORCHESTRATOR_URL` | `http://localhost:4200` | Orchestrator base URL the editor talks to |
32
+ | `--preview <url>` | `AVOCADO_SITE_ORIGIN` | `http://localhost:3000` | Default preview site origin (can be overridden per-session via `?previewUrl=`) |
33
+ | `--publish-token <tok>` | `AVOCADO_PUBLISH_TOKEN` | _unset_ | Forwarded as `x-publish-token` on publish requests |
34
+ | `--port <n>` | `PORT` | `4100` | Port for the editor server |
35
+ | `--host <addr>` | `HOST` | `127.0.0.1` | Bind address. Use `0.0.0.0` for LAN access |
36
+
37
+ Run `avocadostudio --help` for the up-to-date list.
38
+
39
+ ## How Configuration Reaches the Editor
40
+
41
+ The CLI serves the editor as a static SPA and injects a small `<script>` into `<head>` that sets `window.__AVOCADO_CONFIG__` before the app boots. The editor reads from this object first, falling back to its build-time defaults.
42
+
43
+ This means the same prebuilt bundle works against any orchestrator — no rebuild needed per deployment. If you want to embed the editor inside your own Next.js app instead of running this CLI, mount the bundle yourself and inject the same `__AVOCADO_CONFIG__` shape; the keys are `orchestratorUrl`, `siteOrigin`, and `publishToken`.
44
+
45
+ ## Compatibility
46
+
47
+ The CLI ships a frozen editor build that speaks postMessage protocol `site-editor/v1`. On startup it probes the orchestrator's `/health` endpoint and warns if the reported `protocolVersion` does not match. The warning does not block startup — the editor may still work if the protocol changes were backwards-compatible.
48
+
49
+ Pin the CLI version to your orchestrator deployment if you want strict compatibility. Use `npx @avocadostudio-ai/cli@0.1.0 start ...` to lock to a specific version.
50
+
51
+ ## What This Is Not
52
+
53
+ - **Not an auth layer.** The orchestrator handles auth via its `/auth/status` and `/auth/verify` routes; set `ACCESS_PASSWORD_HASH` on the orchestrator side. The CLI doesn't proxy or gate requests.
54
+ - **Not a managed service.** No telemetry is sent anywhere. If you want the hosted Avocado Studio with managed orchestrator + eval pipeline, see the project homepage.
55
+ - **Not bundled with an orchestrator.** You run the orchestrator separately (Render, Fly, Docker, your own box). This CLI is just the editor UI.
56
+
57
+ ## License
58
+
59
+ Apache-2.0. See the repository root for full license text.