|
1 | 1 | # Installing Microbridge |
2 | 2 |
|
3 | 3 | Microbridge is a local daemon plus an optional companion UI. There is **no |
4 | | -network** and **no cloud account** — install puts binaries on your machine and |
5 | | -(on macOS) a per-user launchd agent. |
| 4 | +cloud account** — install puts binaries on your machine and runs a user-level |
| 5 | +service. |
6 | 6 |
|
7 | | -## Requirements |
8 | | - |
9 | | -| Piece | Need | |
10 | | -|---|---| |
11 | | -| Daemon | Rust stable (`rustup`), macOS 13+ or Linux | |
12 | | -| Companion UI (optional) | Node ≥ 20; full `.app` also needs Xcode CLT | |
13 | | -| Hardware LEDs | Codex Micro over USB (HID packing still landing — mock works without hardware) | |
| 7 | +## Recommended on macOS: Homebrew (with updates) |
14 | 8 |
|
15 | | -## Quick install (macOS, from source) |
| 9 | +This is the easy path. You do **not** need to clone the repo. Homebrew owns |
| 10 | +install, upgrades, and the launchd service. |
16 | 11 |
|
17 | 12 | ```sh |
18 | | -git clone https://github.com/DevVig/microbridge.git |
19 | | -cd microbridge |
20 | | -./scripts/install.sh |
| 13 | +brew tap DevVig/microbridge https://github.com/DevVig/microbridge |
| 14 | +brew install microbridge |
| 15 | +brew services start microbridge |
| 16 | +microbridgectl status |
21 | 17 | ``` |
22 | 18 |
|
23 | | -This will: |
24 | | - |
25 | | -1. `cargo build --release` for `microbridged` and `microbridgectl` |
26 | | -2. Install them to `~/.local/bin` (override with `MICROBRIDGE_BIN=…`) |
27 | | -3. Ensure `~/.local/bin` is on your PATH (prints a hint if not) |
28 | | -4. Install and start the launchd agent `ai.microbridge.daemon` |
29 | | -5. Write config defaults under `~/.microbridge/` |
30 | | - |
31 | | -Verify: |
| 19 | +### Updates |
32 | 20 |
|
33 | 21 | ```sh |
34 | | -microbridgectl status |
35 | | -# or: |
36 | | -tail -f ~/.microbridge/daemon.log |
| 22 | +brew update && brew upgrade microbridge |
| 23 | +brew services restart microbridge |
37 | 24 | ``` |
38 | 25 |
|
39 | | -### Optional companion UI |
| 26 | +Optional **background** upgrades (Homebrew’s autoupdate): |
40 | 27 |
|
41 | 28 | ```sh |
42 | | -./scripts/install.sh --with-ui |
43 | | -# web preview during development: |
44 | | -cd apps/microbridge-ui && npm install && npm run dev |
| 29 | +brew autoupdate start --upgrade --cleanup --immediate |
| 30 | +# later: brew autoupdate status / brew autoupdate stop |
45 | 31 | ``` |
46 | 32 |
|
47 | | -`--with-ui` installs frontend deps and, when Tauri/Xcode tooling is available, |
48 | | -attempts `npm run tauri build`. You can always run the Vite UI against a live |
49 | | -daemon without bundling an `.app`. |
| 33 | +Private tap note: if the GitHub repo is private, authenticate once |
| 34 | +(`gh auth login` or a `HOMEBREW_GITHUB_API_TOKEN`) so `brew` can fetch the |
| 35 | +tarball. |
50 | 36 |
|
51 | | -## Linux (from source) |
| 37 | +Uninstall: |
52 | 38 |
|
53 | 39 | ```sh |
54 | | -./scripts/install.sh --no-launchd |
55 | | -# run in the foreground, or add your own systemd --user unit: |
56 | | -microbridged |
| 40 | +brew services stop microbridge |
| 41 | +brew uninstall microbridge |
| 42 | +# optional: brew untap DevVig/microbridge |
57 | 43 | ``` |
58 | 44 |
|
59 | | -A sample user unit is in [`scripts/microbridge.service`](scripts/microbridge.service). |
| 45 | +Governance / why this path: [docs/governance.md](docs/governance.md). |
60 | 46 |
|
61 | | -## Homebrew (skeleton) |
| 47 | +--- |
| 48 | + |
| 49 | +## Requirements |
| 50 | + |
| 51 | +| Piece | Need | |
| 52 | +|---|---| |
| 53 | +| Daemon (Homebrew) | Homebrew; Rust pulled in as a build dependency | |
| 54 | +| Daemon (from source) | Rust stable (`rustup`), macOS 13+ or Linux | |
| 55 | +| Companion UI (optional) | Node ≥ 20; full `.app` also needs Xcode CLT | |
| 56 | +| Hardware LEDs | Codex Micro over USB (HID packing still landing — mock works without hardware) | |
| 57 | + |
| 58 | +## From source (developers) |
62 | 59 |
|
63 | 60 | ```sh |
64 | | -brew install --build-from-source ./Formula/microbridge.rb |
65 | | -brew services start microbridge # when using the formula's service block |
| 61 | +git clone https://github.com/DevVig/microbridge.git |
| 62 | +cd microbridge |
| 63 | +./scripts/install.sh # macOS: binaries + launchd |
| 64 | +# ./scripts/install.sh --with-ui |
| 65 | +# ./scripts/install-linux-systemd.sh |
| 66 | +microbridgectl status |
66 | 67 | ``` |
67 | 68 |
|
68 | | -A published tap/bottle is not available yet — use `./scripts/install.sh` for |
69 | | -day-to-day installs. |
70 | | - |
71 | | -## Install from a GitHub Release |
| 69 | +Uninstall: `./scripts/uninstall.sh` (add `--purge` to remove `~/.microbridge`). |
72 | 70 |
|
73 | | -When a `v*` tag is pushed, CI attaches platform archives. Then: |
| 71 | +### Optional companion UI |
74 | 72 |
|
75 | 73 | ```sh |
76 | | -./scripts/install-from-release.sh v0.0.1 |
77 | | -# or latest: |
78 | | -./scripts/install-from-release.sh |
| 74 | +./scripts/install.sh --with-ui |
| 75 | +# or during development: |
| 76 | +cd apps/microbridge-ui && npm install && npm run dev |
79 | 77 | ``` |
80 | 78 |
|
81 | | -## Uninstall |
| 79 | +## Linux |
82 | 80 |
|
83 | 81 | ```sh |
84 | | -./scripts/uninstall.sh |
| 82 | +./scripts/install-linux-systemd.sh |
| 83 | +# or: |
| 84 | +./scripts/install.sh --no-launchd && microbridged |
85 | 85 | ``` |
86 | 86 |
|
87 | | -Removes the launchd agent, binaries from `MICROBRIDGE_BIN` / `~/.local/bin`, |
88 | | -and optionally (`--purge`) `~/.microbridge/` (config, socket, logs). |
| 87 | +Sample unit: [`scripts/microbridge.service`](scripts/microbridge.service). |
| 88 | + |
| 89 | +## Install from a GitHub Release (binaries) |
| 90 | + |
| 91 | +When a `v*` tag is published, CI attaches platform archives: |
| 92 | + |
| 93 | +```sh |
| 94 | +./scripts/install-from-release.sh # latest |
| 95 | +./scripts/install-from-release.sh v0.0.1 |
| 96 | +``` |
89 | 97 |
|
90 | 98 | ## Layout after install |
91 | 99 |
|
92 | 100 | | Path | Purpose | |
93 | 101 | |---|---| |
94 | | -| `~/.local/bin/microbridged` | Daemon | |
95 | | -| `~/.local/bin/microbridgectl` | CLI | |
96 | | -| `~/Library/LaunchAgents/ai.microbridge.daemon.plist` | macOS autostart | |
| 102 | +| `$(brew --prefix)/bin/microbridged` | Daemon (Homebrew) | |
| 103 | +| `~/.local/bin/microbridged` | Daemon (source install script) | |
97 | 104 | | `~/.microbridge/microbridged.sock` | Local NDJSON socket | |
98 | 105 | | `~/.microbridge/config.toml` | Key source, lighting, appearance | |
99 | | -| `~/.microbridge/daemon.log` | launchd stdout/stderr | |
| 106 | +| `~/.microbridge/daemon.log` | launchd / service logs | |
100 | 107 |
|
101 | 108 | ## Troubleshooting |
102 | 109 |
|
103 | | -**`microbridgectl: connect …`** — daemon not running. On macOS: |
104 | | -`launchctl kickstart -k gui/$(id -u)/ai.microbridge.daemon`. |
| 110 | +**`microbridgectl: connect …`** — daemon not running. |
| 111 | + |
| 112 | +```sh |
| 113 | +brew services restart microbridge |
| 114 | +# or: |
| 115 | +launchctl kickstart -k "gui/$(id -u)/ai.microbridge.daemon" |
| 116 | +``` |
105 | 117 |
|
106 | 118 | **LEDs stay dark** — HID packing is still best-effort; ChatGPT desktop may |
107 | | -also own the device. Pause that app or use Settings → Pause LEDs while testing |
108 | | -the mock path (`microbridgectl status` still works). |
| 119 | +also own the device. |
109 | 120 |
|
110 | | -**PATH** — add `export PATH="$HOME/.local/bin:$PATH"` to your shell rc if |
111 | | -`microbridgectl` is not found. |
| 121 | +**Homebrew can’t fetch (private repo)** — `gh auth login`, or set |
| 122 | +`HOMEBREW_GITHUB_API_TOKEN` to a PAT with `repo` scope. |
0 commit comments