@standardagents/cli 0.45.3 → 0.45.5

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,70 @@
1
+ PROPRIETARY SOFTWARE LICENSE
2
+
3
+ Copyright (c) 2024-2025 FormKit Inc. All Rights Reserved.
4
+
5
+ This software and associated documentation files (the "Software") are the sole
6
+ and exclusive property of FormKit Inc., a Delaware C corporation, doing
7
+ business as Standard Agents ("Standard Agents").
8
+
9
+ LICENSE GRANT
10
+
11
+ Subject to the terms of this license, Standard Agents grants you a limited,
12
+ non-exclusive, non-transferable, revocable license to install and use the
13
+ Software:
14
+
15
+ 1. for local development and testing; and
16
+ 2. in production only on hosting that Standard Agents operates ("Standard
17
+ Agents Hosting").
18
+
19
+ USE RESTRICTIONS
20
+
21
+ The Software is proprietary. Except as stated in the LICENSE GRANT, NO
22
+ PERMISSION is granted to use, copy, modify, merge, publish, distribute,
23
+ sublicense, and/or sell copies of the Software, or to permit persons to whom
24
+ the Software is furnished to do so, under any circumstances, without prior
25
+ written authorization from Standard Agents. No permission is granted to host,
26
+ deploy, or run the Software in production anywhere other than Standard Agents
27
+ Hosting.
28
+
29
+ YOUR AGENTS
30
+
31
+ This license applies to the Software. It does not apply to the agents,
32
+ prompts, tools, and other definitions that you write ("Your Agents"). This
33
+ license does not restrict where you run Your Agents. You may run Your Agents
34
+ on any runtime that conforms to the Standard Agent Specification. This section
35
+ grants no right to run the Software outside the LICENSE GRANT.
36
+
37
+ UNAUTHORIZED USE PROHIBITED
38
+
39
+ Any use of this Software outside the LICENSE GRANT without a valid, written
40
+ license agreement signed by authorized officers of FormKit Inc. is strictly
41
+ prohibited and constitutes unauthorized use and infringement of Standard
42
+ Agents' intellectual property rights.
43
+
44
+ LICENSING INQUIRIES
45
+
46
+ Organizations interested in licensing this Software for other uses should
47
+ contact:
48
+ enterprise@formkit.com
49
+
50
+ A written license agreement must be executed before any use of this Software
51
+ outside the LICENSE GRANT is authorized.
52
+
53
+ NO WARRANTY
54
+
55
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
58
+ FORMKIT INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
59
+ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
60
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61
+
62
+ GOVERNING LAW
63
+
64
+ This license shall be governed by and construed in accordance with the laws
65
+ of the jurisdiction in which FormKit Inc. is incorporated, without regard to
66
+ its conflict of law provisions.
67
+
68
+ FormKit Inc., doing business as Standard Agents
69
+ https://formkit.com
70
+ enterprise@formkit.com
package/README.md CHANGED
@@ -39,6 +39,9 @@ This command will:
39
39
  The init command stays attached to the dev server. Press Ctrl-C in that terminal to stop it.
40
40
  The dev server listens on `127.0.0.1` only, both on this first start and on a later `npm run dev`.
41
41
  The success output includes the commands that start it again later.
42
+ If the dev server does not start, or exits with an error, `init` exits with
43
+ code 1. Your project stays cloned and configured, and the output ends with the
44
+ commands that start the server again.
42
45
 
43
46
  `init` needs an interactive terminal. Without one it exits with a message
44
47
  before it contacts the platform. To sign in from another device, or to run it
@@ -92,7 +95,7 @@ Do not run manual npm publishes to test this flow.
92
95
  - `--no-open` - Print the sign-in URL without opening a browser
93
96
  - `--no-dev` - Clone and configure the project without starting the dev server
94
97
  - `--package-manager <manager>` - Override package manager detection (`npm`, `pnpm`, `yarn`, or `bun`)
95
- - `--api-url <url>` - Platform API URL. Also available through `STANDARD_AGENTS_API_URL` or `PLATFORM_ENDPOINT`
98
+ - `--api-url <url>` - Platform API URL. See [Platform API URL](#platform-api-url) for the environment variables
96
99
 
97
100
  Set `STANDARD_AGENTS_BROWSER="Google Chrome"` or another macOS browser app name when you need the browser handoff to use a specific browser during local development. Set `STANDARD_AGENTS_BROWSER=none` for headless verification.
98
101
 
@@ -108,9 +111,52 @@ Adds Standard Agents to an existing Vite project. The command updates
108
111
  documentation files. The Standard Agents Builder plugin generates the Cloudflare Worker entry
109
112
  and binding config at build time.
110
113
 
111
- ### Deploy From Artifacts Git
114
+ The command keeps your application files, and it keeps an existing
115
+ `AGENTS.md`.
116
+
117
+ **Options:**
118
+ - `--force` - Reset the `builder()` entry in `vite.config` to the default `builder()`, and replace existing `AGENTS.md` guides with the current versions. The command prints each replacement before it writes. It changes nothing else.
119
+ - `--json` - Print one JSON result on stdout. Progress lines go to stderr.
120
+
121
+ The command runs five stages: `vite-config`, `package-json`, `registry-pin`,
122
+ `guides`, and `tsconfig`. When a stage fails, the other stages still run and
123
+ their changes stay. The command names the failed stage, prints the command
124
+ that resumes it, and exits with code 1.
125
+
126
+ ```json
127
+ {
128
+ "command": "scaffold",
129
+ "ok": false,
130
+ "stages": [
131
+ { "stage": "vite-config", "status": "failed", "message": "No vite.config found. ..." },
132
+ { "stage": "package-json", "status": "ok", "message": "Updated package.json with current Standard Agents dependencies" },
133
+ { "stage": "registry-pin", "status": "ok", "message": "The @standardagents scope installs from public npm" },
134
+ { "stage": "guides", "status": "ok", "message": "Agent directories and AGENTS.md guides are in place" },
135
+ { "stage": "tsconfig", "status": "skipped", "message": "No tsconfig.json found, so there is no TypeScript configuration to update" }
136
+ ],
137
+ "resume": "npx @standardagents/cli@latest scaffold",
138
+ "replaced": []
139
+ }
140
+ ```
141
+
142
+ A stage `status` is `ok`, `skipped`, or `failed`. `resume` is `null` when no
143
+ stage failed. `replaced` lists the guides that `--force` replaced.
144
+ `agents support-files` accepts `--json` with the same shape and the stages
145
+ `support-files` and `registry-pin`.
146
+
147
+ ### Credential Files
148
+
149
+ The CLI writes credentials into two project files: `.dev.vars` and
150
+ `.agents/bootstrap-session.json`. Before each write, it adds `.dev.vars` and
151
+ `.agents` to your `.gitignore` when Git does not ignore them. When Git tracks
152
+ one of these files, the command stops and prints the `git rm --cached` command
153
+ that stops the tracking. `agents logout` still removes credentials from a
154
+ tracked `.dev.vars`.
155
+
156
+ ### Deploy From Git
112
157
 
113
- Deployments are triggered by pushes to the platform-owned Artifacts repository:
158
+ The platform builds and deploys a project from pushes to its Standard Agents
159
+ git repository:
114
160
 
115
161
  ```bash
116
162
  git push origin main
@@ -118,9 +164,155 @@ git push origin main
118
164
  agents deploy
119
165
  ```
120
166
 
121
- `agents deploy` is a convenience wrapper around `git push origin HEAD:<branch>`.
122
- It does not run a local build or upload bundles; the platform build runner
123
- deploys from the Artifacts push event.
167
+ `agents deploy` runs `git push origin HEAD:refs/heads/<branch>`, then follows
168
+ the platform build of that commit and reports the result. It does not run a
169
+ local build or upload bundles.
170
+
171
+ - `Push accepted` means git stored the commit. It is not a deployment.
172
+ - When the remote branch already has the commit, nothing is pushed. The
173
+ command says that no build was started and reports the existing build.
174
+ - When the platform answers the push with a `remote: Standard Agents:` notice,
175
+ it stored the push and started no build. The command exits 4 when the notice
176
+ asks for the terms, else 1.
177
+ - Following a build uses your sign-in from `agents login` or
178
+ `agents git-login`, or the project API key that `init` saved in
179
+ `.dev.vars`. With neither, `deploy` says `Only the push was verified`,
180
+ prints how to check the result, and exits 0.
181
+ - A failed build prints the platform's error, the last 20 log lines, and the
182
+ `builds logs` and `builds retry` commands.
183
+
184
+ | Option | Effect |
185
+ | --- | --- |
186
+ | `--no-wait` | Push and return |
187
+ | `--timeout <seconds>` | How long to follow the build (default 900); then exit 5 |
188
+ | `--remote <name>` | Git remote to push to (default `origin`) |
189
+ | `--branch <name>` | Remote branch to push to (default: the checked-out branch) |
190
+ | `--json` | Print one JSON document on standard output; every other line goes to standard error |
191
+ | `--project <id>` | Project ID, instead of matching the remote |
192
+ | `--endpoint <url>` | Platform API endpoint |
193
+
194
+ The remote must be `https://git.standardagents.ai` (or the earlier
195
+ `https://git.standardagentbuilder.com`), the hosts that the git credential
196
+ helper authenticates. Printed remote URLs never include credentials.
197
+
198
+ ### Read, Retry, And Roll Back Builds
199
+
200
+ ```bash
201
+ agents builds # recent builds, newest first
202
+ agents builds status # the build of the checked-out commit
203
+ agents builds status --commit <sha>
204
+ agents builds status <build> --wait
205
+ agents builds logs <build> # the build transcript
206
+ agents builds logs <build> --follow
207
+ agents builds retry [build] # re-run a failed build without a new commit
208
+ agents rollback --yes # make the earlier production build live again
209
+ agents redeploy # deploy the live production build again
210
+ ```
211
+
212
+ `<build>` is a build ID, or a unique prefix of an ID or commit. Without it the
213
+ command uses the newest build of the checked-out commit, else the newest
214
+ build. Every command accepts `--json`, `--project <id>` (when the project
215
+ cannot be found from the `origin` remote), and `--endpoint <url>`. These
216
+ commands use the same sign-in or project API key as `deploy`, and read builds
217
+ only for projects of that account. `rollback` and `redeploy` change what
218
+ production serves, so they need an owner or admin sign-in (`agents login`);
219
+ the project API key is refused there with exit code 3.
220
+
221
+ - `builds status`, `builds retry`, and `rollback` accept `--wait` and
222
+ `--timeout <seconds>` (default 900). A wait follows the platform's project
223
+ events socket; nothing is re-read on a timer.
224
+ - `agents builds retry` without a build retries the newest build of the
225
+ checked-out branch when it failed. When that build did not fail, the command
226
+ says that no build waits for a retry, starts nothing, and exits 0. After you
227
+ accept the terms, this command starts the deploy that waited.
228
+ - `agents rollback [build]` applies to production only. Without a build it
229
+ targets the production build that was live before the current one. It asks
230
+ for confirmation on a terminal and needs `--yes` when none is attached.
231
+ - `agents redeploy` deploys the live production build's stored bundle again,
232
+ so changed environment values take effect. It runs no build.
233
+ - `builds logs --follow --json` shows the log on standard error as it arrives,
234
+ then prints one JSON document with the whole log and the final build.
235
+ - None of the commands prompts, except `rollback` on a terminal without `--yes`.
236
+
237
+ When a deploy fails: read `agents builds logs <build>`, fix the cause, and push
238
+ a new commit. For a failure that needs no code change, run
239
+ `agents builds retry <build>`.
240
+
241
+ Exit codes are the same for `deploy`, `builds`, `rollback`, and `redeploy`:
242
+
243
+ | Code | Meaning |
244
+ | --- | --- |
245
+ | 0 | Done. For a wait: the commit was deployed (the build is `live`, or was live and is `superseded`). A plain `builds status` or `builds logs` read also exits 0 |
246
+ | 1 | The build failed or was cancelled, no build started, or the platform refused the request |
247
+ | 2 | The command line, the checkout, or the named build is not usable |
248
+ | 3 | Not signed in, or the sign-in expired. Run `agents login` |
249
+ | 4 | The platform refused a build until the terms are accepted (`error_code` `legal_acceptance_required`). A refused build that a retry later started is listed as `retried` and needs no action. The platform's message is printed, then `Run: npx @standardagents/cli terms accept` and the `builds retry` command that starts the waiting deploy |
250
+ | 5 | The time limit passed while the build was still in progress |
251
+
252
+ With `--json`, a failure before any result prints
253
+ `{ "error": { "message", "fix", "exit_code" } }`.
254
+
255
+ ### Read And Accept The Terms
256
+
257
+ ```bash
258
+ npx @standardagents/cli@latest terms
259
+ npx @standardagents/cli@latest terms accept
260
+ ```
261
+
262
+ `terms` shows the Terms of Service and the Privacy Policy that are in force:
263
+ each title, version, and URL, and whether you accepted that version.
264
+
265
+ `terms accept` shows the same documents and the acknowledgement sentence from
266
+ the platform, then asks `Do you accept? [y/N]`.
267
+
268
+ An acceptance starts no build. After you accept, the command lists each deploy
269
+ that the platform refused for the terms and that is still the newest build of
270
+ its branch. It asks `Start this deploy now? [y/N]` and, after a yes, starts
271
+ each one through the retry route. With `--agree` it starts them with no second
272
+ question, because you approved each deploy when you pushed it. It reports each
273
+ result and follows none of them; read one with `agents builds status <build>`.
274
+ When a retry is refused, the command prints the platform's reason (for
275
+ example, "Push again to deploy"), states that your acceptance is recorded, and
276
+ exits with code 1. To start a waiting deploy later, run `agents builds retry`
277
+ in its project.
278
+
279
+ Both commands use your saved sign-in. Run `agents login` in your project, or
280
+ `agents git-login` once per machine, before you use them. An API key cannot
281
+ accept terms, because acceptance belongs to a person.
282
+
283
+ Without a terminal, `terms accept` records nothing and exits with code 2. It
284
+ prints the two links, the acknowledgement sentence, and the command that
285
+ accepts those versions:
286
+
287
+ ```bash
288
+ npx @standardagents/cli@latest terms accept --agree --terms-version <version> --privacy-version <version>
289
+ ```
290
+
291
+ `--agree` needs both version options. The command accepts only when the two
292
+ versions match the current documents. When a document changed after you
293
+ reviewed it, the command records nothing, exits with code 2, and prints the
294
+ current documents with a new command.
295
+
296
+ If your coding agent runs the command, it must show you the two links and the
297
+ acknowledgement sentence. It runs the printed command only after you say yes
298
+ to those versions.
299
+
300
+ #### Options
301
+
302
+ - `--json` - Print one JSON object and never prompt. `terms accept --json` still needs `--agree`. A code 2 result holds the command in `accept_command`. An accepted result holds `refused_builds` (the deploys that waited) and `retried` (`{ build_id, ok, status, started_build_id }`, or `{ build_id, ok: false, error }`)
303
+ - `--agree` - Accept without a prompt (`terms accept` only). It needs `--terms-version` and `--privacy-version`
304
+ - `--terms-version <version>` - With `--agree`: the Terms of Service version you reviewed
305
+ - `--privacy-version <version>` - With `--agree`: the Privacy Policy version you reviewed
306
+ - `--endpoint <url>` - Platform API endpoint. The default is the endpoint of your saved sign-in
307
+
308
+ #### Exit codes
309
+
310
+ | Code | Meaning |
311
+ |------|---------|
312
+ | 0 | Success, including "already accepted" and "no terms to accept" |
313
+ | 1 | Failure. This includes a waiting deploy that did not start after a recorded acceptance |
314
+ | 2 | Confirmation needed; nothing was recorded |
315
+ | 3 | Not signed in |
124
316
 
125
317
  ### Install The Standard Agents Builder Skill
126
318
 
@@ -153,6 +345,59 @@ npx @standardagents/cli skill --agent agents
153
345
  npx @standardagents/cli skill --agent claude
154
346
  ```
155
347
 
348
+ ### Sign In And Out
349
+
350
+ ```bash
351
+ npx @standardagents/cli@latest login
352
+ npx @standardagents/cli@latest login --bootstrap <code>
353
+ npx @standardagents/cli@latest git-login
354
+ npx @standardagents/cli@latest logout
355
+ ```
356
+
357
+ `login` signs the current project in to your Standard Agents account. It opens
358
+ the browser sign-in page and never creates a project. The setup command on a
359
+ project's Overview page (`login --bootstrap <code>`) also fetches the project
360
+ API key that account sign-in to the local instance needs.
361
+
362
+ `git-login` signs Git in on this machine for Standard Agents repositories.
363
+
364
+ Both commands print the sign-in URL, open your browser, and wait until you
365
+ approve the sign-in. Press Ctrl-C to cancel; the pending sign-in is cancelled
366
+ on the platform too. Neither command asks for typed input.
367
+ `--no-open` prints the sign-in URL and waits without opening a browser on this
368
+ machine, for sign-in from another device, a container, or a script.
369
+ `STANDARD_AGENTS_BROWSER=none` has the same effect.
370
+ Without a terminal, `login` and `git-login` exit with code 1 before they
371
+ contact the platform unless you pass `--no-open` or `--bootstrap <code>`,
372
+ which needs no browser.
373
+
374
+ `logout` removes every stored credential: the Git login, the project session,
375
+ and `STANDARD_AGENTS_API_KEY` in `.dev.vars`. It revokes the Git API key and
376
+ the account session on the platform, which also signs you out of the
377
+ dashboard. It then lists what still works. The project API key cannot be
378
+ revoked from the CLI, and credentials set in your shell environment stay until
379
+ you unset them. `logout` exits 1 when a credential on this machine still works
380
+ or a revocation failed.
381
+
382
+ `logout --json` prints only the result on stdout:
383
+ `{ "ok", "removed": [...], "revoked": [...], "remaining": [{ "message", "blocking" }] }`.
384
+ `ok` is `false` exactly when the exit code is 1.
385
+
386
+ ### Platform API URL
387
+
388
+ `init`, `login`, `git-login`, `logout`, `builds`, and the Git credential helper
389
+ resolve the platform API URL in one order:
390
+
391
+ 1. The command's flag (`--api-url` for `init`, `--endpoint` for the others)
392
+ 2. `STANDARD_AGENTS_API_URL`
393
+ 3. `PLATFORM_ENDPOINT`
394
+ 4. `STANDARD_AGENTS_PLATFORM_URL`
395
+ 5. `https://api.standardagents.ai`
396
+
397
+ The Git credential helper and `builds` read the same three variables from your
398
+ project's `.dev.vars` after the environment. `logout` revokes each credential
399
+ at the platform that issued it.
400
+
156
401
  ### Read The Curated Current Models Guide
157
402
 
158
403
  ```bash
@@ -162,20 +407,45 @@ pnpm exec agents current-models
162
407
  This fetches the live markdown guide from the Standard Agents spec site and
163
408
  prints it to stdout.
164
409
 
165
- ### List Available Models From A Configured Provider
410
+ ### List Available Models From A Provider
166
411
 
167
412
  ```bash
168
413
  pnpm exec agents available-models --provider=cerebras
169
414
  ```
170
415
 
171
- The CLI reads your current project's installed provider packages plus the env
172
- keys in `.env`, `.env.local`, `.dev.vars`, `.dev.vars.local`, and `process.env`.
173
- If multiple providers are configured, specify one with `--provider`.
416
+ The CLI reads your current project's installed provider packages, the
417
+ providers defined in `agents/providers/`, and the env keys in `.env`,
418
+ `.env.local`, `.dev.vars`, `.dev.vars.local`, and `process.env`.
419
+ If more than one provider is usable, specify one with `--provider`.
420
+
421
+ A project linked to a Standard Agents account needs no provider key. When a
422
+ provider's own key is not set, the command lists its models with the
423
+ project's account key (`STANDARD_AGENTS_API_KEY`), through the same platform
424
+ route the running project uses. A provider's own key takes precedence and goes
425
+ to the provider directly. A provider from `agents/providers/` always uses the
426
+ key and base URL its definition declares; the account key does not cover it.
427
+
428
+ The command exits 1 with the cause when a key is missing, the request fails,
429
+ or the provider returns no models.
174
430
 
175
431
  The command walks every provider page until it has the full model list, then
176
432
  prints a markdown table containing the exact `model` strings to use in
177
433
  `defineModel({ model: ... })`.
178
434
 
435
+ ### Pack And Unpack Agents
436
+
437
+ ```bash
438
+ npx @standardagents/cli pack my_agent
439
+ npx @standardagents/cli list-packed
440
+ npx @standardagents/cli unpack standardagent-my-agent
441
+ ```
442
+
443
+ Run these from the project root. They use the Standard Agents Builder installed in the project, so install the project's dependencies first. A project without it gets the install command and exit code 1.
444
+
445
+ `pack` writes the package to `agents/packed/` and then removes the original files that only the packed agent uses. Files that another agent shares are kept. It lists the files before it removes them. Pass `--no-remove` to keep every original; `unpack` restores them from the package.
446
+
447
+ Without a terminal, or with `--no-interactive`, `pack` never prompts. When the project has several agents, name the one to pack; otherwise the command lists the agents and exits with code 1.
448
+
179
449
  ## Manual Configuration
180
450
 
181
451
  For new projects, manual Cloudflare configuration is not required. Add
@@ -178,7 +178,7 @@ export function Login() {
178
178
  <p className="text-center text-xs text-[var(--text-muted)] mt-6">
179
179
  Powered by{' '}
180
180
  <a
181
- href="https://standardagentbuilder.com"
181
+ href="https://standardagents.ai"
182
182
  target="_blank"
183
183
  rel="noopener noreferrer"
184
184
  className="text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors"