nandi/oripublic Fork 0
b6cd929ab1425a4ef6073ea9c189917cca02cf3c
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

README.md · 54 lines · 3.0 KBmarkdown Blame HistoryRaw
🛟 Updated. f5c963a k33g 21h ago1# Scripts
2
3*[Version française](README.fr.md)*
4
5## `launch-ori.applescript` — start the sandbox and open ori-desktop
6
7One gesture instead of two commands: the script starts (or restarts) the `ori` sandbox, waits until the ori server answers, then opens the desktop app.
8
9What it does, in order:
10
111. Finds the repository root from its own location (`<repo>/scripts/…`). Set the `repoDirOverride` property at the top of the file if you move it elsewhere.
122. Checks that `ori-desktop/build/bin/ori-desktop.app` exists; otherwise shows how to build it (`cd ori-desktop && wails build && xattr -cr build/bin/ori-desktop.app`).
133. If `sbx ls -q` already lists a sandbox named `ori`, restarts it with `sbx run -d --name ori`. Otherwise creates it:
14 ```bash
✨ Switch the ACP adapter to @agentclientprotocol/claude-agent-acp (template 0.0.2) 5d476ff k33g 19h ago15 sbx run -d claude . --template k33g/ori:0.0.2 --kit ./kits/ori --name ori -p 5555:8888/tcp
🛟 Updated. f5c963a k33g 21h ago16 ```
174. Polls `http://localhost:5555/healthz` every 2 s, up to 90 s (`healthTimeoutSeconds`). If the server never answers it still opens the app and tells you where to look: `sbx exec ori cat /var/log/sbx-kit-startup.log`.
185. Opens `ori-desktop.app`, which auto-connects to the server URL it remembered last time (`~/Library/Application Support/ori-desktop/settings.json`, key `serverUrl`). Set it to `http://localhost:5555` on the first connection screen.
19
20Template, kit, ports, sandbox name and timeout are `property` lines at the top of the script.
21
22### Run it from a terminal
23
24```bash
25osascript scripts/launch-ori.applescript
26```
27
28### Make it double-clickable
29
30Compile the script into an application bundle:
31
32```bash
33osacompile -o "scripts/Launch Ori.app" scripts/launch-ori.applescript
34```
35
36- Double-click `scripts/Launch Ori.app` in the Finder, drag it to the Dock, or launch it from Spotlight ("Launch Ori").
37- The `.app` is a build artefact and is gitignored (`scripts/*.app/`). Rebuild it after every edit of the `.applescript`.
38- Built locally, it carries no quarantine attribute, so Gatekeeper does not block it. macOS may ask once for permission to show notifications.
39- Progress is reported with notifications; a hard failure (app not built, `sbx run` failing, usually because Docker Desktop is not running) opens an alert dialog.
40
41### Why these choices
42
43- **Finder launches get a minimal `PATH`** without `/opt/homebrew/bin`, so the script exports it before every shell command.
44- **`sbx run -d`** (detached) returns as soon as the sandbox exists, and exempts it from sbx's 30 s auto-stop. The kit then starts the ori server asynchronously, hence the health poll before opening the app.
45- **Restart instead of recreate** when the sandbox exists: re-running the create command would collide on the name, and `sbx rm` + create would lose the sandbox's Claude session.
46
47### Test the handlers without creating a sandbox
48
49```bash
50osacompile -o /tmp/launch-ori.scpt scripts/launch-ori.applescript
51osascript -e 'set s to load script POSIX file "/tmp/launch-ori.scpt"
52set s'"'"'s healthTimeoutSeconds to 4
53return s'"'"'s waitForServer("http://localhost:5555")' # false unless something answers on :5555
54```