@shardflux/cli 0.14.5 → 0.15.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +76 -12
  3. package/dist/account-args.js +31 -10
  4. package/dist/account-commands.d.ts +2 -0
  5. package/dist/account-commands.js +158 -14
  6. package/dist/acp-catalog.js +2 -2
  7. package/dist/acp-login.d.ts +20 -0
  8. package/dist/acp-login.js +122 -0
  9. package/dist/acp.js +36 -13
  10. package/dist/agent-commands.js +71 -6
  11. package/dist/agent-git-commands.js +2 -1
  12. package/dist/agent-reachability.js +1 -1
  13. package/dist/agent-target-commands.d.ts +14 -0
  14. package/dist/agent-target-commands.js +79 -13
  15. package/dist/agent-targets.d.ts +7 -0
  16. package/dist/agent-targets.js +44 -32
  17. package/dist/args.d.ts +3 -1
  18. package/dist/args.js +21 -9
  19. package/dist/browser-login.d.ts +35 -0
  20. package/dist/browser-login.js +145 -0
  21. package/dist/codex-cloud.d.ts +49 -0
  22. package/dist/codex-cloud.js +157 -0
  23. package/dist/command-center-actions.js +7 -0
  24. package/dist/command-center-renderer.d.ts +3 -0
  25. package/dist/command-center-renderer.js +42 -38
  26. package/dist/command-center.js +65 -11
  27. package/dist/conversation-terminal.js +19 -0
  28. package/dist/conversations.d.ts +1 -1
  29. package/dist/conversations.js +21 -8
  30. package/dist/credential-prompts.d.ts +4 -2
  31. package/dist/credential-prompts.js +38 -16
  32. package/dist/device-bridge.d.ts +13 -0
  33. package/dist/device-bridge.js +14 -4
  34. package/dist/device-helper.js +2 -1
  35. package/dist/errors.d.ts +9 -0
  36. package/dist/errors.js +15 -2
  37. package/dist/format.js +3 -1
  38. package/dist/handlers.js +2 -1
  39. package/dist/initial-prompt.d.ts +26 -0
  40. package/dist/initial-prompt.js +196 -0
  41. package/dist/legal.d.ts +36 -0
  42. package/dist/legal.js +44 -0
  43. package/dist/main.js +6 -2
  44. package/dist/menubar.d.ts +8 -0
  45. package/dist/menubar.js +9 -1
  46. package/dist/onboarding-app/AGENTS.md +19 -0
  47. package/dist/onboarding-app/CLAUDE.md +19 -0
  48. package/dist/onboarding-app/README.md +12 -0
  49. package/dist/onboarding-app/dev.mjs +18 -0
  50. package/dist/onboarding-app/index.html +25 -0
  51. package/dist/onboarding-app/package.json +12 -0
  52. package/dist/onboarding-app/server.mjs +41 -0
  53. package/dist/onboarding-sample.d.ts +3 -0
  54. package/dist/onboarding-sample.js +29 -0
  55. package/dist/onboarding.d.ts +258 -0
  56. package/dist/onboarding.js +371 -0
  57. package/dist/terminal-brand.d.ts +5 -0
  58. package/dist/terminal-brand.js +18 -0
  59. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,74 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.1
4
+
5
+ - `shard setup`, `shard signup` and `shard api-keys create` make keys with every workspace tool, `computer` included, so the saved key can watch and screenshot a workspace's desktop (`shard ws computer stream`, `screenshot`), as the first-run demo does. `shard setup` replaces a saved key from an earlier setup (every tool but `computer`) with one that has every tool; the old key keeps working until revoked. `--tool` lists `computer`.
6
+
7
+ - `shard agents open --in auto` opens a Claude conversation where you work: in Claude Desktop when it is installed (its own session, `claude://code/<session>`), else Claude Code in this terminal. With `--json` it prints `{target: "claude-desktop", url, app_bundle_id}` or `{target: "terminal", command}`. claude.ai opens with `--in web` (or a saved web target). Codex conversations open in the Codex app as before.
8
+
9
+ - `shard setup` and `shard signup` print "Starting your Codex remote device…" while they wait for it.
10
+
11
+ ## 0.15.0
12
+
13
+ - The onboarding activity report includes the conversation's turn state for Claude and Codex, including while its VM is suspended.
14
+
15
+ - `shard setup --inspect`: a new Codex remote device reads as connecting while it finishes starting, instead of offering Retry. The live activity report lists only the ports the agent opened, not the computer's own services.
16
+
17
+ - The terms: `shard signup`, `shard auth register` and `shard auth login --codex` (which can create an account) need the agreement to the Terms of Service and Privacy Policy before they send anything: `--accept-terms`, `SHARDFLUX_ACCEPT_TERMS=1`, or "Continue? [Y/n]" on a terminal. Without it they stop with `terms_not_accepted` (exit 2; `details`: `terms_url`, `privacy_url`, `flag`). The account records the agreement. Signing in shows the same line, and `--json` sign-in and sign-up outputs carry `terms_url` and `privacy_url`.
18
+
19
+ - `shard ./` and `shard agents new` accept `--image <file|->` with an initial prompt: attach up to five PNG, JPEG, GIF or WebP images (10 MiB each) to the first message. Images are validated before the VM is created, written privately into the conversation VM under `/home/user/.shardflux/attachments/`, and named in the first message, so Claude Code attaches them natively and Codex opens them with its image viewer. `--image -` reads one image, or PNG images back to back, from standard input, so the menu bar's screen captures never touch the Mac's disk.
20
+
21
+ - `shard auth login --browser` signs in on the web: it opens the sign-in page with a code (`--no-open` prints the link), you sign in or create your account there, check the code and approve, and the session is saved as with a password. `--client-name` names the computer on the page. It prints the terms notice (Terms of Service, Privacy Policy) before the browser opens. `--json` prints NDJSON events for apps: `open` (link, code, `expires_in`, `terms_url`, `privacy_url`), then `signed_in` (email) or `error` (`access_denied`, `expired_token`, ...; exit 4). On a terminal, `shard auth login` without `--email` or `--codex`, and `shard signup` without a Codex login or `--email`, use the browser.
22
+
23
+ - `shard acp` signs in from the editor: it offers T3 Code and other ACP clients a "Sign in to Shardflux" method that runs in the editor's own terminal (`shard acp --login`). One step creates or signs in to the account with this Mac's Codex login (else an email), makes the API key, copies the Codex login and connects Claude Code. Signed out, `shard acp` answers ACP `auth_required`, so the editor offers it.
24
+
25
+ - T3 Code's provider probe and its post-sign-in check open no VM, and a conversation started from the probe's first model choice (`Codex · Default`, `Claude Code · Default`) opens on that app's own default model.
26
+
27
+ - `shard agents open` on a Claude conversation this computer just started returns its Remote Control URL as soon as Claude publishes it, waiting up to 30 s (or `--wake-timeout`, if shorter) while Claude registers.
28
+
29
+ - Resume an ACP conversation after its journal is reconstructed on the same VM: reset the old journal cursor when the native supervisor changes, while preserving the native session id.
30
+
31
+ - Keep legacy workspace opens, explicit terminal/T3 launches and template-copy launches on their existing paths; prepare local Git before Codex Cloud enrollment.
32
+
33
+ - Claude conversations wake from claude.ai or the Claude app at any time. `--reachable` (`agent_reachable_seconds` on the wire) is deprecated and ignored; the option remains accepted and is hidden from help.
34
+
35
+ - Idle Codex Cloud MCP sessions no longer keep the VM awake. Stdio servers retain their process and memory in the VM behind request-scoped HTTP, so normal adaptive suspend and wake preserve their state.
36
+ - New Codex Cloud threads receive the VM’s configured MCP servers and Shardflux computer, conversation and credential tools through the native remote executor. No separate connector setup is required.
37
+ - New Codex conversations from `shard ./` and `shard agents new --app codex --path <dir>` open genuine Codex Cloud threads under one account executor. `agents open` reopens Cloud history without waking its VM. Setup copies the existing Codex login and registers the billed account executor; `agents codex status|enable|disable` manages it. Existing local conversations retain their original route.
38
+
39
+ - Add `credentials approve --scope ask|project|machine` and scoped `credentials forget`. Share machine vault choices across projects in the current account/profile, with project choices taking precedence. Remember only the requested fields at the selected scope.
40
+
41
+ - Simplify the terminal command center to one-line live conversations, collapsed done sessions, and a contextual actions menu. New conversation asks for a task and project, then starts Claude or Codex with that first message. Existing open, target, log, workspace and Git actions remain available.
42
+
43
+ - Give the menu bar structured device approval details (exact argv, canonical path, file direction and port mapping) while retaining the summary for older clients. Outside-conversation requests still require one-time approval.
44
+
45
+ - Fresh conversations accept `--prompt` or `--prompt-file <path|->` as their first native user-authored message. Validate before allocation, deliver through acknowledged native terminal input, and preserve the created workspace key on a delivery failure. Prepare fresh Codex worktrees to avoid startup trust/update dialogs and use a usable terminal type for detached launchers.
46
+ - Emit device approval resolution events so the menu removes completed requests immediately.
47
+
48
+ - `agents new --path` starts a fresh conversation; named and `--like` agent flows keep their existing behavior.
49
+ - `agents open --in auto --json` returns the remembered desktop target or the agent app destination (`url` or `app_bundle_id`) for launchers such as menu bar 0.3.0.
50
+
51
+ - First run: `shard setup --inspect [--json] [--apps claude,codex] [--connect]` checks every connection live and
52
+ reports it: the Shardflux account, Claude (Claude itself accepts the account login) and Codex (the login is copied and
53
+ the account's Codex remote device is connected), for the apps you pick, or the ones found on this Mac. `--connect`
54
+ also copies this Mac's Codex login and enables the Codex remote device; `--retry-codex` starts a remote device that
55
+ failed or is stuck starting again, once (as `agents codex enable` now does). The Codex row reads its remote device as
56
+ connecting, connected, failed (its VM failed) or stuck (starting for more than five minutes). The apps checked are
57
+ `--apps`, else your saved pick, else the ones found on this Mac, including in their install folders (`~/.local/bin`
58
+ and others) when the PATH is minimal. Ready means signed in with at least one
59
+ agent app connected. When T3 Code is installed the report adds an optional `t3` entry: an ACP-capable build has
60
+ Shardflux as a provider (connected once signed in; its provider's Sign in finishes it otherwise), stable 0.0.45 is
61
+ set up per project over SSH (`agents new --in t3 --path <project>`) and names the environment to add. The report
62
+ lists the steps (sign in, connect, try it once on Daylight, your own project). `--prepare-sample` copies the Daylight sample app into a new local Git project,
63
+ "Daylight (sample)"; `--activity --workspace <key|conv_id>` lists a running VM's current commands and when they
64
+ started, listening ports, packages installed with sudo since it was created, its desktop's size and browser window,
65
+ and what changed in its repositories, without waking it.
66
+ - `agents new --computer` (and `shard <path> --computer`) gives the new conversation a desktop with a browser its agent
67
+ drives, for Claude and Codex conversations.
68
+ - A long first prompt (`--prompt`, `--prompt-file`) is submitted even when its start scrolls out of the agent's input box.
69
+ - `agents open --in web` (and `--in auto` for Claude) waits up to 20 seconds for a new conversation's Remote Control link
70
+ instead of failing in the first seconds after the conversation starts.
71
+
3
72
  ## 0.14.5
4
73
 
5
74
  - An agent terminal no longer keeps its workspace awake. `shard ./` and `shard agents open` attach passively: while the agent waits, its workspace parks and suspends under the open terminal. Once it has gone to sleep, the terminal shows `asleep. Type to wake it.`, and your next keystroke wakes it and reaches the agent. A dropped connection reattaches without waking the workspace.
package/README.md CHANGED
@@ -24,6 +24,14 @@ For usage, account, billing, or private support, email [shardflux@heliosone.fi](
24
24
  Report vulnerabilities through [private security reporting](https://github.com/shardfluxdev/community/security/advisories/new).
25
25
  See the [support guide](https://github.com/shardfluxdev/community/blob/main/SUPPORT.md) for all reporting options.
26
26
 
27
+ ## Command center (0.15.0+)
28
+
29
+ Run `shard` in a terminal to see live conversations. Press **Enter** to open the selected one, **/** to search,
30
+ **D** to expand or collapse finished conversations, and **?** for targets, logs, fork, park and Git actions.
31
+ Press **n** to start a conversation: describe the task, confirm a local project folder, then choose Claude or Codex.
32
+ Both the task and project are required, and the task becomes the first user-authored message. **Esc** cancels;
33
+ **q** returns to your shell. The command center calls the same `shard agents new --path ... --prompt ...` path.
34
+
27
35
  ## Reverse tunnels (0.11.0+)
28
36
 
29
37
  Run a foreground TCP tunnel from a workspace to a service on this machine:
@@ -67,7 +75,10 @@ time `shard` runs, with launch at login enabled; `shard menubar stop` turns it o
67
75
 
68
76
  T3 Code uses one **Shardflux** provider; choose a Claude Code or Codex model to start that agent in the cloud.
69
77
  Model choices come from your cloud agent's session and use the same coding tools and settings as its terminal.
70
- The provider is registered automatically when T3 Code is installed. Use a T3 build that supports ACP providers.
78
+ The provider is registered automatically when T3 Code is installed. Choose **Sign in** on its card in T3's provider
79
+ settings: T3 runs `shard acp --login` in its own terminal, which creates or signs in to your account (with this Mac's
80
+ Codex login, or your email) and connects Claude Code and Codex, skipping every step that is already done (0.15.0+).
81
+ With T3 Code 0.0.45, `shard agents new --in t3` adds the project as an SSH environment instead.
71
82
 
72
83
  Git fetch and push use the coding guest’s platform transport when available, preserving Git’s binary packets (0.14.0+). Older guests retain their existing transport.
73
84
 
@@ -79,7 +90,7 @@ shard conversations try <conversation>
79
90
 
80
91
  Your branch opens in `.shard/worktrees/<name>`, syncs both ways, and its dev servers appear at localhost.
81
92
  Ctrl-C stops local sync. Your main checkout stays available for your own work.
82
- Device tools ask Allow once or Always for this project on your Mac before preparing the conversation’s local worktree. Live transcripts stay in
93
+ Device tools ask for approval on your Mac before preparing the conversation’s local worktree. With CLI 0.15.0 and menu bar 0.3.0, Review shows the exact command, file direction, paths or port mapping; access outside the conversation folder only offers Allow once. Live transcripts stay in
83
94
  `~/.config/shardflux/conversations/`; ended sessions enter Claude Code’s or Codex’s native history. Transcript files up to 64 MiB are supported (0.14.0+).
84
95
  From 0.14.3, transcript copying runs independently of device approvals. Unknown entries are skipped, and failed copies retry with backoff; diagnostics name the conversation and affected entry.
85
96
 
@@ -136,14 +147,19 @@ npm test 2>&1 | tail -n 60 | shard feedback --category bug --workspace acme/demo
136
147
  `shard` is built to be driven by an agent: no browser, no prompts when standard input is not a
137
148
  terminal, `--json` on every command, secrets only on standard input, and documented exit codes.
138
149
 
139
- 1. **Account (0.9.0+):** `shard signup --json`. With the Codex CLI signed in with ChatGPT on the
150
+ 1. **Account (0.9.0+):** show your person the [Terms of Service](https://shardflux.dev/terms) and the
151
+ [Privacy Policy](https://shardflux.dev/privacy); once they agree, `shard signup --accept-terms --json` (0.15.0+:
152
+ without `--accept-terms` or a terminal to ask on, it stops before sending anything with `terms_not_accepted`, exit 2,
153
+ and the two links in `details`). With the Codex CLI signed in with ChatGPT on the
140
154
  machine it signs up (or signs in) verified by that login; otherwise pass `--email <email>` and the
141
155
  account works at once on the Free plan. It then runs `shard setup`: an organization, a project and
142
156
  an API key with every workspace tool, saved in the credentials file. With two-factor authentication
143
157
  it exits 4 with `mfa_required`: ask the person for the code, then `shard auth mfa --code <code>`.
144
158
  2. **Verify the email** (an `--email` signup, to start the trial): `shard verify --json` emails a
145
159
  6-digit code; ask the person for it, then `shard verify <code>`. Nothing is signed out.
146
- 3. **Set up again any time:** `shard setup --json` is idempotent.
160
+ 3. **Set up again any time:** `shard setup --json` is idempotent. `shard setup --inspect --json --apps claude,codex`
161
+ (0.15.0+) checks every connection live (your account, Claude, Codex) and says what to do for any that is not ready;
162
+ `--connect` also finishes the Codex connection.
147
163
  4. **Work:** `shard exec <key> --template default -- <cmd>` creates the workspace on first use and runs the command
148
164
  (0.10.0+); later commands reuse it. `shard ws open <key> --template <slug> --json`, `shard files ...` use the saved
149
165
  key too.
@@ -164,10 +180,11 @@ What a person does: entering a card in Stripe Checkout, the authenticator app's
164
180
  ## Accounts and sign-in (0.5.0+)
165
181
 
166
182
  ```sh
167
- shard signup [--email you@example.com] [--name "Ada Lovelace"] [--no-codex] [--no-setup] # 0.9.0+
183
+ shard signup [--email you@example.com] [--name "Ada Lovelace"] [--no-codex] [--no-setup] [--accept-terms] # 0.9.0+
168
184
  shard verify [<code>] # 0.9.0+: emails a 6-digit code, then confirms it
169
- shard auth login --codex # 0.9.0+: sign in with the Codex login on this machine
170
- printf '%s\n' "$PASSWORD" | shard auth register --email you@example.com [--name "Ada Lovelace"]
185
+ shard auth login --browser [--no-open] # 0.15.0+: approve this computer on the sign-in page
186
+ shard auth login --codex [--accept-terms] # 0.9.0+: sign in with the Codex login on this machine
187
+ printf '%s\n' "$PASSWORD" | shard auth register --email you@example.com [--name "Ada Lovelace"] [--accept-terms]
171
188
  shard auth verify-email '<link from the email>' # or just the token in it
172
189
  shard auth resend-verification # signed in, email not verified yet
173
190
  printf '%s\n' "$PASSWORD" | shard auth login --email you@example.com [--code 123456 | --recovery-code X]
@@ -193,6 +210,24 @@ shard auth totp recovery-codes
193
210
  already uses that ChatGPT identity or email is signed in instead. Without a Codex login, `--email`
194
211
  creates an account that works at once on the Free plan; `shard verify` starts the trial.
195
212
  `--no-codex` uses `--email` even when Codex is signed in; `--no-setup` skips `shard setup`.
213
+ - **`shard auth login --browser`** (0.15.0+) opens the sign-in page (`https://app.shardflux.dev/cli?code=XXXX-XXXX`)
214
+ in the default browser and prints the link and the code. Sign in or create your account on the page, check that it
215
+ shows the same code, and approve: `shard` saves the session like a password sign-in, and two-factor accounts use
216
+ their code on the page. `--no-open` only prints the link; `--client-name` sets the name the page shows (default
217
+ `shard CLI on <hostname>`). The code expires after 10 minutes. On a terminal, `shard auth login` without `--email`
218
+ or `--codex`, and `shard signup` without a Codex login or `--email`, sign in this way. With `--json` it prints one
219
+ JSON object per line: `{"event":"open","verification_uri_complete":"…","user_code":"ABCD-EFGH","expires_in":600,
220
+ "terms_url":"https://shardflux.dev/terms","privacy_url":"https://shardflux.dev/privacy"}`, then
221
+ `{"event":"signed_in","email":"…"}`, or `{"event":"error","code":"access_denied","message":"…"}` (also
222
+ `expired_token`, exit 4). Before the browser opens it prints the terms notice: by continuing you agree to the
223
+ Terms of Service and acknowledge the Privacy Policy.
224
+ - **The terms (0.15.0+):** the commands that can create an account (`signup`, `auth register`,
225
+ `auth login --codex`) need your agreement to the [Terms of Service](https://shardflux.dev/terms) and the
226
+ [Privacy Policy](https://shardflux.dev/privacy): `--accept-terms` (or `SHARDFLUX_ACCEPT_TERMS=1`), or "Continue?
227
+ [Y/n]" on a terminal. Without either they stop before sending anything: `terms_not_accepted`, exit 2, with
228
+ `terms_url`, `privacy_url` and `flag` in `details`. The account records the agreement. Signing in only shows the
229
+ line (`terms_url` and `privacy_url` in `--json`); so does `auth login --browser`, which needs no flag: an account
230
+ created on the sign-in page agrees there.
196
231
  - **Passwords never come from arguments** (`--password` is refused). On a terminal `shard` asks without
197
232
  echo (a new password twice); otherwise it reads standard input, one line per secret: `auth password
198
233
  change` reads the current password, then the new one. Emailed links and tokens are single-use
@@ -223,10 +258,12 @@ shard auth totp recovery-codes
223
258
  "&lt;your name&gt;'s organization" (`--org-name` to choose); with several it lists them;
224
259
  2. the project: `--project`, the saved default, or the organization's only one; with none it creates
225
260
  "Default" (`--project-name`);
226
- 3. an API key with every workspace tool (`--tool` repeatable to narrow it), named
261
+ 3. an API key with every workspace tool, `computer` included (0.15.1+; `--tool` repeatable to narrow it), named
227
262
  `shard-cli <hostname>` (`--key-name`), saved in the credentials file and checked against the API.
228
263
 
229
- It is idempotent: a saved key that still works is kept (`--new-key` makes a new one). It prints what
264
+ It is idempotent: a saved key that still works is kept (`--new-key` makes a new one). A saved key from an earlier
265
+ `shard setup` (every tool but `computer`) is replaced with one that has every tool (0.15.1+); the old key keeps working
266
+ until you revoke it. It prints what
230
267
  it found or created and the next command. The key is never printed; `shard env` prints it for tools
231
268
  that read `SHARDFLUX_API_KEY`:
232
269
 
@@ -980,7 +1017,7 @@ printf %s "$NEW_KEY" | shard secrets rotate OPENAI_API_KEY
980
1017
  - Account commands (0.5.0+) print the API's objects too: lists are `{data, next_cursor}` (with
981
1018
  `default_organization_id`, `default_project_id` or `saved_api_key_id` where a default applies);
982
1019
  `auth login`/`auth mfa` print `{status, user, session: {expires_at, credentials_file}, organizations,
983
- next}` (never the token); `auth status` prints `{api_url, credentials_file, session, api_key, defaults}`;
1020
+ next}` (never the token; `auth login --browser` prints NDJSON events instead, see above); `auth status` prints `{api_url, credentials_file, session, api_key, defaults}`;
984
1021
  `setup` prints `{organization, project, api_key: {id, key_id, name, project_id, tool_permissions},
985
1022
  created: {organization, project, api_key}, credentials_file, next}`; `api-keys create` prints
986
1023
  `{api_key, secret, saved: false}` (or `{api_key, saved: true, credentials_file}` with `--save`);
@@ -1009,7 +1046,7 @@ printf %s "$NEW_KEY" | shard secrets rotate OPENAI_API_KEY
1009
1046
  | 1 | error: an API refusal such as `conflict`, `quota_exceeded` or `workspace_not_running`, or a network or protocol failure |
1010
1047
  | 2 | usage error: bad arguments, or input the API rejected as `validation_failed` |
1011
1048
  | 3 | not found: workspace, operation or route |
1012
- | 4 | authentication or authorization: missing, malformed, revoked or insufficient key or session; `step_up_required` (run `shard auth step-up`), `mfa_required` (a sign-in waiting for its code), `email_unverified`, `invalid_credentials` |
1049
+ | 4 | authentication or authorization: missing, malformed, revoked or insufficient key or session; `step_up_required` (run `shard auth step-up`), `mfa_required` (a sign-in waiting for its code), `email_unverified`, `invalid_credentials`; `access_denied` or `expired_token` from `auth login --browser` (0.15.0+) |
1013
1050
  | 5 | timeout: waiting gave up (`--timeout`, or `--wake-timeout` while waking a workspace); the operation continues server side (`shard operations wait <id>`), up to a queued start's 15-minute deadline. `executions get` (0.5.0+): the execution is still queued or running. `ws exec-read` (0.8.0+): the background command still runs. `billing upgrade --wait` (0.5.0+): nobody paid in time (the checkout stays open) |
1014
1051
  | 6 | the awaited operation ended `failed` or `canceled` (also a resume or open that failed while waking a workspace). `retryable=true` in the error means a retry can succeed (`capacity_unavailable`). Also a file-first execution that ended `failed` or `lost` (0.5.0+): nothing was published. `exec` (0.5.1+): the command could not start (`exec_failed_to_start`). `billing upgrade --wait` (0.5.0+): the checkout expired or was canceled (`checkout_ended`) |
1015
1052
  | 130 | interrupted (Ctrl-C). Waits stop at once, and exec sends a cancel to the session. A file-first execution runs to completion, and the error names the `shard executions get` command for its result. |
@@ -1148,7 +1185,7 @@ Template services accept `initialized_cpu` with `compatibility`, `reset`, and `t
1148
1185
 
1149
1186
  ### Waiting agent reachability (0.13.2+)
1150
1187
 
1151
- Set `--reachable 30m` when opening a workspace to choose how long waiting agents stay reachable through connections they opened. See [reachability settings](https://docs.shardflux.dev/limits#cloud-agent-reachability). Incoming replies wake the parked workspace, which answers them and parks again. These wakes count as parked time; agent work counts as awake time.
1188
+ A message from claude.ai or the Claude app wakes a waiting Claude conversation at any time. Reply-traffic wakes count as parked time; agent work counts as awake time. The reachability duration is deprecated and ignored (0.15.0+).
1152
1189
 
1153
1190
 
1154
1191
  ## Cloud agents (0.13.2+)
@@ -1180,6 +1217,8 @@ Imported secrets: stored encrypted with AWS KMS; only this project's workspaces
1180
1217
  Vault fills: sent end to end from your vault to the workspace; Shardflux only relays encrypted bytes.
1181
1218
  Remembered credentials: stored encrypted with AWS KMS and filled straight into the page; agents never see it, and every use is logged.
1182
1219
 
1220
+ CLI 0.15.0 adds `credentials approve <request> --from keychain --item <name> --scope ask|project|machine`. The default still asks each time; `--always` retains its project-only behavior. Machine permission is shared across projects in the current account/profile, with project choices taking precedence. Add `--remember` to save only requested fields for unattended sign-in: `ask` saves for the conversation, `project` for the project template, and `machine` for the machine template. Remove a saved copy with `credentials forget <workspace> <site> --scope conversation|project|machine`. Without `--scope`, remember/forget retain the legacy project storage. Conversation and machine copies require the scoped-credentials API.
1221
+
1183
1222
  [Start a cloud agent](https://docs.shardflux.dev/guides/cloud-agents) ·
1184
1223
  [Machine and template](https://docs.shardflux.dev/guides/machine-and-template) ·
1185
1224
  [Credentials](https://docs.shardflux.dev/guides/credentials)
@@ -1208,3 +1247,28 @@ Open that project connection to start conversations and return to their saved th
1208
1247
  Conversation JSON includes `join_mode` and the worktree used by reviewers and workers.
1209
1248
 
1210
1249
  `shard conversations resume <id>` continues a saved conversation in a fresh VM under the same identity (0.14.0+). `shard ./ --resume` uses this same path. `shard conversations reader <project-id>` opens a small read-only workspace for saved branches and transcripts; the Mac transcript mirror opens it automatically when no project VM is live. Adaptive idle reclaims the reader.
1250
+
1251
+ ### Menu bar conversation shortcut (0.15.0+)
1252
+
1253
+ The macOS menu bar's **New conversation** action (menu bar 0.3.0+) opens the same launcher as **Option-Shift-Space**. It requires a task and project, remembers Claude/Codex, and invokes the commands below. Configure the hotkey in the macOS Settings window (⌘,), with conflict detection and a fallback.
1254
+
1255
+ ```sh
1256
+ shard agents new --app claude --path ./ --prompt "Review the billing changes" --json
1257
+ shard agents new --app codex --path ./ --prompt-file task.txt --json
1258
+ cat task.txt | shard agents new --app codex --path ./ --prompt-file - --json
1259
+ shard agents new --app claude --path ./ --prompt "What is wrong on this page?" --image page.png --json
1260
+ ```
1261
+
1262
+ `--prompt` or `--prompt-file` submits one initial user-authored message to the native agent. Codex Cloud accepts it into the durable conversation inbox with one idempotency key; `initial_prompt.submitted` confirms that acceptance, not a completed provider turn. Text is limited to 256 KiB and may include file, branch and link context. These options apply to fresh conversations and cannot be combined with resume or named/like legacy agent flows. Omit them to start interactively as before. JSON includes `initial_prompt.submitted: true` after native input is accepted. If delivery cannot be confirmed, `initial_prompt_failed` includes `details.workspace_key` and `details.submitted`; open that conversation before creating another.
1263
+
1264
+ `--image <file|->` (0.15.0+, repeatable) attaches up to five PNG, JPEG, GIF or WebP images of up to 10 MiB each to that first message. They are written into the conversation VM under `/home/user/.shardflux/attachments/` and named in the message: Claude Code attaches them as images and Codex opens them with its image viewer. `--image -` reads one image, or PNG images back to back, from standard input; use a file for `--prompt-file` when images come from standard input.
1265
+
1266
+ Use `shard agents open <workspace> --in auto --json` to resolve where a conversation opens: a saved target first; then, for Claude (0.15.1+), the conversation itself in Claude Desktop when it is installed (`{"target":"claude-desktop","url":"claude://code/session_…","app_bundle_id":…}`), else Claude Code in the terminal (`{"target":"terminal","command":["shard","agents","open","<workspace>"]}`; without `--json` it attaches in this terminal). Codex opens its Cloud thread in the Codex app. claude.ai opens with `--in web`. The caller opens the `url` or app, or runs the command in a terminal. Explicit `--in terminal` retains terminal attachment. The menu uses this resolver for new and existing conversations, without provider URLs in Swift.
1267
+
1268
+ ## Codex Cloud (0.15.0+, unreleased)
1269
+
1270
+ New Codex conversations use `shard agents new --app codex --path <directory>` or `shard ./ codex`. Each gets a fresh conversation VM and a genuine Codex Cloud thread. `shard agents open <conversation-id>` opens the existing thread without waking its VM. These paths create no SSH device entries and need no pairing.
1271
+
1272
+ `shard setup` uses your existing Codex ChatGPT login to register one executor for the account. Its small connector workspace stays resident and is billed as ordinary workspace memory/CPU usage, including while conversations wait. Use `--no-codex` to skip setup, `shard agents codex status` to inspect it, or `shard agents codex disable` to remove the executor and release its residency. Conversation VMs wake for tools and follow the normal adaptive idle policy afterwards.
1273
+
1274
+ Explicit `agents new --in terminal`, `--in t3`, and `--like` launches keep their existing VM routes. Local Git is prepared and validated before Cloud enrollment. This branch's Cloud feature is awaiting release. Existing local-mode conversations keep their original route. Cloud uses OpenAI's model/configuration capabilities; local app-server plugins and settings are not automatically transferred.
@@ -4,6 +4,13 @@ const ORG = {
4
4
  const PROJECT = {
5
5
  project: { type: 'string', value: '<project>', description: 'Project: id or slug. Default: the saved one (shard projects use), else the organization’s only project.' },
6
6
  };
7
+ /** Commands that can create an account (0.15.0+): the agreement to the terms, without a prompt. */
8
+ const ACCEPT_TERMS = {
9
+ 'accept-terms': {
10
+ type: 'boolean',
11
+ description: 'Agree to the Terms of Service (https://shardflux.dev/terms) and acknowledge the Privacy Policy (https://shardflux.dev/privacy) without the "Continue? [Y/n]" prompt (0.15.0+; also SHARDFLUX_ACCEPT_TERMS=1). Without a terminal, creating an account needs it: otherwise the command stops before it sends anything (terms_not_accepted, exit 2).',
12
+ },
13
+ };
7
14
  const SECOND_FACTOR = {
8
15
  code: { type: 'string', value: '<totp>', description: 'Current 6-digit code of your authenticator app (two-factor accounts).' },
9
16
  'recovery-code': { type: 'string', value: '<code>', description: 'A one-time recovery code instead of --code.' },
@@ -51,10 +58,11 @@ export const ACCOUNT_COMMANDS = [
51
58
  name: { type: 'string', value: '<display name>', description: 'Your name as others see it (setup names the organization after it).' },
52
59
  codex: { type: 'boolean', description: 'Use the Codex login on this machine (default; --no-codex signs up with --email).' },
53
60
  setup: { type: 'boolean', description: 'Run shard setup afterwards (default; --no-setup skips it).' },
54
- tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the saved API key may use (repeatable; exec, files, pty, process, git, browser). Default: all.' },
61
+ tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the saved API key may use (repeatable; exec, files, pty, process, git, browser, computer). Default: all.' },
62
+ ...ACCEPT_TERMS,
55
63
  ...SECOND_FACTOR,
56
64
  },
57
- examples: ['shard signup', 'shard signup --email you@example.com', 'shard signup --no-codex --email you@example.com --name "Ada Lovelace"'],
65
+ examples: ['shard signup', 'shard signup --accept-terms --json', 'shard signup --email you@example.com', 'shard signup --no-codex --email you@example.com --name "Ada Lovelace"'],
58
66
  },
59
67
  {
60
68
  path: ['verify'],
@@ -73,6 +81,7 @@ export const ACCOUNT_COMMANDS = [
73
81
  options: {
74
82
  email: { type: 'string', value: '<email>', description: 'Your email address (required).' },
75
83
  name: { type: 'string', value: '<display name>', description: 'Your name as others see it (default: none; setup names the organization after it).' },
84
+ ...ACCEPT_TERMS,
76
85
  },
77
86
  examples: [`printf '%s\\n' "$PASSWORD" | shard auth register --email you@example.com --name "Ada Lovelace"`, 'shard auth register --email you@example.com # prompts for the password'],
78
87
  },
@@ -87,15 +96,19 @@ export const ACCOUNT_COMMANDS = [
87
96
  { path: ['auth', 'resend-verification'], summary: 'Email a new verification link (signed in, email not verified yet)', positionals: [], options: {} },
88
97
  {
89
98
  path: ['auth', 'login'],
90
- summary: 'Sign in: saves a session for this API in the credentials file (the password is read from standard input or a prompt)',
91
- description: 'Two-factor accounts: pass --code (or --recovery-code), or type the code at the prompt; without either the pending sign-in is saved and "shard auth mfa --code <code>" completes it within 10 minutes (exit 4 until then). Prints who you are, your organizations and the next step. A session lasts 30 days of use (90 at most). SHARDFLUX_SESSION_TOKEN, when set, is used instead of the saved session.',
99
+ summary: 'Sign in: saves a session for this API in the credentials file (in the browser, or with a password from standard input or a prompt)',
100
+ description: '--browser (0.15.0+) opens the sign-in page with a code: sign in or create your account there, check that the page shows the same code, and approve; the session is saved here (the page link is printed too, and --no-open only prints it). On a terminal, "shard auth login" without --email or --codex signs in with the browser. --json prints one JSON object per line: {"event":"open",...} with the link and the code, then {"event":"signed_in","email":...} or {"event":"error","code":...,"message":...}. With a password, two-factor accounts pass --code (or --recovery-code), or type the code at the prompt; without either the pending sign-in is saved and "shard auth mfa --code <code>" completes it within 10 minutes (exit 4 until then). Prints who you are, your organizations and the next step. A session lasts 30 days of use (90 at most). SHARDFLUX_SESSION_TOKEN, when set, is used instead of the saved session.',
92
101
  positionals: [],
93
102
  options: {
94
- email: { type: 'string', value: '<email>', description: 'Your email address (required without --codex).' },
95
- codex: { type: 'boolean', description: 'Sign in with the Codex login on this machine instead of a password (0.9.0+; creates the account when there is none).' },
103
+ browser: { type: 'boolean', description: 'Sign in in the browser: open the sign-in page, approve this computer there (0.15.0+). An account created there agrees to the terms on the sign-up page, so --browser needs no --accept-terms.' },
104
+ open: { type: 'boolean', description: 'With --browser: open the page in the default browser (default; --no-open only prints the link).' },
105
+ 'client-name': { type: 'string', value: '<name>', description: 'With --browser: the name the sign-in page shows for this computer (default "shard CLI on <hostname>").' },
106
+ email: { type: 'string', value: '<email>', description: 'Your email address, to sign in with a password.' },
107
+ codex: { type: 'boolean', description: 'Sign in with the Codex login on this machine instead of a password (0.9.0+; creates the account when there is none, so it needs --accept-terms like shard signup).' },
108
+ ...ACCEPT_TERMS,
96
109
  ...SECOND_FACTOR,
97
110
  },
98
- examples: [`printf '%s\\n' "$PASSWORD" | shard auth login --email you@example.com`, `printf '%s\\n' "$PASSWORD" | shard auth login --email you@example.com --code 123456`, 'shard auth login --codex'],
111
+ examples: ['shard auth login --browser', 'shard auth login --browser --no-open --json', `printf '%s\\n' "$PASSWORD" | shard auth login --email you@example.com`, `printf '%s\\n' "$PASSWORD" | shard auth login --email you@example.com --code 123456`, 'shard auth login --codex'],
99
112
  },
100
113
  {
101
114
  path: ['auth', 'mfa'],
@@ -187,13 +200,21 @@ export const ACCOUNT_COMMANDS = [
187
200
  options: {
188
201
  ...ORG,
189
202
  ...PROJECT,
203
+ 'prepare-sample': { type: 'boolean', description: 'Copy the Daylight sample app into a new local Git project, "Daylight (sample)", for the first-run demo; prints its path.' },
204
+ activity: { type: 'boolean', description: 'With --inspect: the current commands, listening ports, sudo installs and browser window of --workspace, without waking it.' },
205
+ workspace: { type: 'string', value: '<key|conv_id>', description: 'The workspace or conversation to inspect for live onboarding activity.' },
206
+ inspect: { type: 'boolean', description: 'Report the onboarding steps and verify every connection live (account, Claude, Codex) without changing anything.' },
207
+ apps: { type: 'string', multiple: true, value: '<claude,codex>', description: 'The apps to verify (default: the ones found on this Mac). Repeatable or comma separated.' },
208
+ connect: { type: 'boolean', description: 'With --inspect: also copy this Mac’s Codex login and enable the account’s Codex remote device when Codex is picked.' },
209
+ 'retry-codex': { type: 'boolean', description: 'With --inspect --connect: start a Codex remote device that failed or is stuck starting again, once.' },
190
210
  'org-name': { type: 'string', value: '<name>', description: 'Name of the organization to create when you have none.' },
191
211
  'project-name': { type: 'string', value: '<name>', description: 'Name of the project to create when the organization has none (default Default).' },
192
212
  'key-name': { type: 'string', value: '<name>', description: 'Name of the API key (default "shard-cli <hostname>").' },
193
- tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the key may use (repeatable; exec, files, pty, process, git, browser). Default: all.' },
213
+ tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the key may use (repeatable; exec, files, pty, process, git, browser, computer). Default: all.' },
194
214
  'new-key': { type: 'boolean', description: 'Create and save a new key even when the saved one works (the old key stays valid until revoked).' },
215
+ codex: { type: 'boolean', description: 'Set up the account Codex Cloud executor with this machine’s Codex login (default when signed in); --no-codex skips it.' },
195
216
  },
196
- examples: ['shard setup', 'shard setup --org acme --project web --tool exec --tool files'],
217
+ examples: ['shard setup', 'shard setup --json --inspect --apps claude,codex', 'shard setup --org acme --project web --tool exec --tool files'],
197
218
  },
198
219
  {
199
220
  path: ['env'],
@@ -260,7 +281,7 @@ export const ACCOUNT_COMMANDS = [
260
281
  description: 'Owners and admins grant workspace tools; billing members create keys without tools. The secret cannot be shown again.',
261
282
  positionals: [{ name: 'name', required: true }],
262
283
  options: {
263
- tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the key may use (repeatable). Default: all six.' },
284
+ tool: { type: 'string', multiple: true, value: '<tool>', description: 'Workspace tool the key may use (repeatable; exec, files, pty, process, git, browser, computer). Default: all.' },
264
285
  'read-only': { type: 'boolean', description: 'No workspace tools (read-only API use).' },
265
286
  expires: { type: 'string', value: '<30d|90d|365d|never>', description: 'Expiry (default never).' },
266
287
  save: { type: 'boolean', description: 'Save it in the credentials file for the workspace commands instead of printing it.' },
@@ -1,5 +1,7 @@
1
1
  import type { Handler } from './commands.js';
2
2
  export declare const DEFAULT_API_URL = "https://api.shardflux.dev";
3
+ /** What `shard setup` gave a key before 0.15.1: every tool but `computer`. Such a saved key is replaced with a full one. */
4
+ export declare function outdatedDefaultKey(permissions: readonly string[]): boolean;
3
5
  /**
4
6
  * The organization name setup creates: "<display name or email local part>'s organization", within the API's rules
5
7
  * for names (1-200 characters, no control characters or line breaks).