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