starbridge 0.0.0-stage → 0.1.0-rc.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tom Vaucourt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,263 @@
1
- # Temporary Holding Version
1
+ # starbridge CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `starbridge` connects a machine that runs agents to your phone and browsers. Agents use it to ask
4
+ you questions and report runs, and it uploads what each AI plan has left, read from CodexBar. It
5
+ signs everything with this machine's key and encrypts it for your devices, so the server sees
6
+ ciphertext only.
7
+
8
+ ## Install
9
+
10
+ Linux, macOS or Windows. Pick one.
11
+
12
+ The install script puts the binary in `~/.local/bin`, then runs `starbridge setup` when it has a
13
+ terminal (`STARBRIDGE_NO_SETUP=1` skips it):
14
+
15
+ ```bash
16
+ curl -fsSL https://starbridge.run/install.sh | sh
17
+ ```
18
+
19
+ On Windows, the PowerShell script does the same, with `%USERPROFILE%\.local\bin`, which it adds
20
+ to your user PATH:
21
+
22
+ ```powershell
23
+ irm https://starbridge.run/install.ps1 | iex
24
+ ```
25
+
26
+ Homebrew:
27
+
28
+ ```bash
29
+ brew install T0mSIlver/starbridge/starbridge
30
+ ```
31
+
32
+ npm, with Node 22 or later:
33
+
34
+ ```bash
35
+ npm install -g starbridge
36
+ ```
37
+
38
+ After Homebrew or npm, run setup yourself:
39
+
40
+ ```bash
41
+ starbridge setup
42
+ ```
43
+
44
+ ### What setup does
45
+
46
+ Setup asks before each step except pairing and the background service, and a rerun repairs only
47
+ what is missing:
48
+
49
+ 1. It pairs the machine with your account (see [Pair](#pair)). It asks for the server only when
50
+ neither `--server` nor `STARBRIDGE_SERVER` names one.
51
+ 2. It finds CodexBar, or installs it (Linux and macOS; CodexBar has no Windows build, so a
52
+ Windows machine uploads no quotas): with Homebrew if you have it, else CodexBar's latest
53
+ release tarball from GitHub, checked against the `.sha256` that release publishes, into
54
+ `~/.local/opt/codexbar`. It installs nothing when the checksum is missing or does not match.
55
+ Then it asks which providers' quotas to upload.
56
+ 3. It installs the background service, `starbridge agent`, as a systemd user unit, a launchd
57
+ agent, or on Windows a Scheduled Task that starts at logon without administrator rights and
58
+ logs to `%LOCALAPPDATA%\starbridge\agent.log`.
59
+ 4. It installs Starbridge in each agent it finds: the Claude Code plugin at user scope, the
60
+ skill in Codex's skills folder, the Starbridge Pi package, and the skill and plugin in
61
+ opencode's config folder. A later setup updates the Codex and opencode files when the CLI
62
+ carries newer ones. The Claude Code plugin needs Claude Code 2.1.287 or later; setup says
63
+ when it is older. Claude Code, Codex and Pi may then run `starbridge ask`, `waiting`,
64
+ `working`, `wait` and `settle` without a permission prompt; `starbridge run` still asks, since
65
+ the command it wraps can be anything. For Pi, setup adds these rules only when
66
+ pi-permission-system is installed; `starbridge config permissions on` offers them later.
67
+ 5. It asks whether to send [permission prompts](#permission-prompts) to your devices. The
68
+ default is no.
69
+ 6. It uploads a first quota snapshot, then offers to send a test question to your phone and
70
+ prints your answer.
71
+
72
+ `--yes` takes every default and sends no test question. `--no-quota` skips step 2, CodexBar
73
+ included; `--no-service` skips step 3; `--no-plugin` skips step 4, for every agent.
74
+ `starbridge status` prints the same checks.
75
+
76
+ ### Update and uninstall
77
+
78
+ `starbridge update` installs the latest release over a script install, then runs `starbridge
79
+ setup --refresh` with it and updates the Claude Code plugins. `--refresh` rewrites the files
80
+ setup put into other tools (the agent's service, the Codex skill and rule, opencode's skill and
81
+ plugin) for the new version and restarts the agent. Homebrew and npm installs update through
82
+ their own manager; then run `starbridge setup --refresh`. Each of those files starts with a
83
+ `Written by starbridge <version>` line: setup replaces and uninstall removes only files that have
84
+ it, so remove the line from one to keep it as yours.
85
+
86
+ `starbridge update` then moves a CodexBar that setup installed in `~/.local/opt/codexbar` to
87
+ CodexBar's latest release, with the same checksum check; a CodexBar from Homebrew or the macOS
88
+ app is left to them (`brew upgrade codexbar`). When a CodexBar release breaks, its providers show
89
+ a quota error on your devices; `starbridge update --codexbar 0.71.1` installs that release
90
+ instead, until a later `starbridge update` moves it to the latest again.
91
+
92
+ `starbridge uninstall` removes the agent service, the plugin and the binary, and asks your
93
+ devices to revoke the machine. It deletes the keys only when you say so, or with `--purge`.
94
+
95
+ ### Check a download
96
+
97
+ The scripts and `starbridge update` install a binary only if its hash is in the release's
98
+ `SHA256SUMS` and the release key signed `SHA256SUMS.minisig`. `install.ps1` checks the signature
99
+ with minisign's own Windows build, pinned by its hash, since Windows has no Ed25519 check. The key is also in
100
+ [`minisign.pub`](minisign.pub):
101
+
102
+ ```
103
+ RWRT+qMmByDpj/1KhL5yCxdzIkVgZ3NqTrlVIIvhrezr/38FgzBIen0F
104
+ ```
105
+
106
+ To check a download by hand:
107
+
108
+ ```bash
109
+ minisign -Vm SHA256SUMS -P <key>
110
+ sha256sum -c --ignore-missing SHA256SUMS
111
+ ```
112
+
113
+ ## Use
114
+
115
+ Setup covers pairing and the agent. Agents run the other commands themselves; the Starbridge
116
+ skill tells them when. `starbridge --help` lists every flag.
117
+
118
+ ### Pair
119
+
120
+ ```bash
121
+ starbridge pair
122
+ ```
123
+
124
+ It prints a code, a link and a QR code. Open the link in a browser where you are signed in, scan
125
+ the QR code with your phone, or type the code in Settings → Devices → Add a device, on your phone
126
+ or in the web app, which works from a machine with no browser. The code expires in 10 minutes.
127
+ The machine pairs with
128
+ https://starbridge.run unless you pass `--server https://starbridge.example` or set
129
+ `STARBRIDGE_SERVER`.
130
+
131
+ ### Ask
132
+
133
+ An agent asks a question with two to four options, or none for a free-text answer:
134
+
135
+ ```bash
136
+ starbridge ask --question "Merge #12 now?" \
137
+ --option Merge --option Wait
138
+ ```
139
+
140
+ `ask` prints the question's id and how the answer will come back:
141
+
142
+ - In Claude Code, the answer arrives as the session's next prompt.
143
+ - In an interactive Codex session (Codex CLI 0.160 or later), the background service queues it
144
+ into the session.
145
+ - Anywhere else, the agent waits for it with `starbridge wait <id> --timeout 5m`, which exits
146
+ with code 2 when the time runs out.
147
+
148
+ To check the path to your phone yourself, ask and wait in one command:
149
+
150
+ ```bash
151
+ starbridge ask --question "Does this reach my phone?" --option Yes --option No --wait
152
+ ```
153
+
154
+ When the agent runs out of other work, `starbridge waiting <id>` shows "Waiting for you" on
155
+ every device and notifies you once more. `starbridge working <id>` clears it; the question stays open.
156
+ `starbridge wait <id>` marks the question waiting the same way; with `--no-mark` it only collects
157
+ the answer, for a question that blocks nothing yet.
158
+ When you snooze a question, `waiting` and `wait` tell the agent no answer comes before then, and
159
+ `wait` exits 3; nothing wakes an agent that is not asking.
160
+
161
+ ### Follow every answer
162
+
163
+ An orchestrator that supervises other sessions can follow your answers to all of them:
164
+
165
+ ```bash
166
+ starbridge answers --all --follow
167
+ ```
168
+
169
+ It prints one JSON line per answer, with the question, the session and the project that asked,
170
+ then each new one until interrupted. `--since 2h` or `--since 2026-10-06T21:00Z` skips older ones.
171
+ It only reads: each answer still comes back into the session that asked.
172
+
173
+ `starbridge decisions --open` lists the questions still open, in the same form, so an orchestrator
174
+ can check that no session already asked what it is about to ask.
175
+
176
+ ### Runs
177
+
178
+ `starbridge run` wraps a command you want to follow: a build, a release, an eval, heavy work on
179
+ your machine, or a test that takes over the screen or keyboard. Your devices show its title, its
180
+ reason, the time elapsed and its progress, then pass or fail:
181
+
182
+ ```bash
183
+ starbridge run --title "Release 1.4" \
184
+ --reason "publishes to npm and Homebrew" \
185
+ -- make release
186
+ ```
187
+
188
+ The output passes through unchanged, and `run` exits with the command's code, or 128 + n when
189
+ signal n ended it. Progress comes from what the output prints: an OSC 9;4 sequence, `[3/7]` or
190
+ `42%`. The output goes through a pipe, so tools that print progress only to a terminal show none.
191
+ If the machine is not paired or the server is down, `run` warns once and runs the command anyway.
192
+
193
+ The Starbridge skill has agents wrap, unasked, any command that blocks you or needs you at the machine. To hear about
194
+ other commands, such as local inference, say so in their instruction files
195
+ ([Agent instructions](../docs/tell-your-agents.md)).
196
+
197
+ ### Quotas
198
+
199
+ The background service runs `codexbar usage --format json` for each provider you picked and uploads a
200
+ snapshot every 5 minutes. A provider that fails is sent as an error and never stops the others.
201
+ Alerts before a window runs out are off until you turn them on for a provider in each device's
202
+ Settings: "Notify" on the web, the bell in the Android app.
203
+
204
+ To upload without the service:
205
+
206
+ ```bash
207
+ starbridge quota push --provider claude --provider codex
208
+ ```
209
+
210
+ ### Permission prompts
211
+
212
+ Permission prompts from Claude Code, opencode and Pi stay at the keyboard until you turn them on,
213
+ in setup or with:
214
+
215
+ ```bash
216
+ starbridge config permissions on
217
+ ```
218
+
219
+ Then each prompt also goes to your devices, where you allow or deny it. The prompt stays open at
220
+ the keyboard, and the first answer wins. Only prompts Claude Code still shows reach your devices:
221
+ in auto mode, its default, it settles most calls itself. When the keyboard answers first, the
222
+ device's card closes once the tool has run, since Claude Code reports the call only then.
223
+
224
+ opencode's prompts work the same way, from its TUI and `opencode serve`. `opencode run` rejects
225
+ every prompt at once, so none reaches your devices.
226
+
227
+ Pi's prompts come from pi-permission-system (`pi install npm:@gotgenes/pi-permission-system`).
228
+ With the Starbridge Pi package installed, the same command offers to add `starbridge` to its
229
+ `authorizerChain`, which it needs as well. It also offers allow rules, so that Pi reads the
230
+ Starbridge skill without a prompt; the link runs the commands above without one when they stand
231
+ alone, never chained to another command. Your devices then allow a call once
232
+ or deny it, and "Answer here" in Pi brings back pi-permission-system's own prompt. Asks from its
233
+ `path` and `external_directory` rules stay at the keyboard, since it lets no link allow those.
234
+
235
+ If you use the Claude app, turn off its "Code updates" notifications, which fire at the end of
236
+ every turn. Keep "Code permission requests" on, unless you turned on Starbridge's permission
237
+ prompts, so that one prompt doesn't notify you twice.
238
+
239
+ ### The background service
240
+
241
+ `starbridge agent` runs once per machine, as a user service. It holds the keys and the server
242
+ connection, uploads quota snapshots and hands each session its answers. The other commands go
243
+ through it when it runs, and to the server directly when it doesn't or when
244
+ `STARBRIDGE_NO_AGENT=1` is set. Its flags (`--provider`, `--interval`) override `agent.json` in
245
+ the config directory.
246
+
247
+ ### Config
248
+
249
+ Keys and state live in `~/.config/starbridge` (or `$XDG_CONFIG_HOME/starbridge`, or
250
+ `$STARBRIDGE_CONFIG_DIR`), readable only by you. `starbridge config` prints this machine's
251
+ settings.
252
+
253
+ The Claude Code plugin's hooks call `starbridge hook …`. One of them turns Claude Code's
254
+ `AskUserQuestion` into `starbridge ask`, so the question reaches you away from the terminal; if
255
+ the machine is not paired or the server doesn't answer, it lets the question through. The
256
+ opencode plugin runs `starbridge hook question --agent opencode` on each call of opencode's
257
+ `question` tool: it posts each question to your devices and prints the answers for opencode,
258
+ or nothing if the terminal answers first or the server can't be reached.
259
+
260
+ ## What agents parse
261
+
262
+ Plugins and scripts built on `starbridge` can rely on the commands and output in
263
+ [CONTRACT.md](CONTRACT.md), stable from 0.1.0.