@alter-ai/cli 0.7.0 → 0.8.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alter AI, Inc.
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
@@ -14,8 +14,11 @@ alter --version
14
14
  ## Sign in
15
15
 
16
16
  ```bash
17
- alter auth login # interactive browser flow
18
- ALTER_PAT=alter_pat_... alter apps list # headless / CI
17
+ alter auth login # interactive browser flow
18
+ alter auth login --token-stdin # pre-minted PAT; prompts, input hidden
19
+
20
+ # CI: configure a masked ALTER_PAT secret in the provider, then run normally
21
+ alter apps list
19
22
  ```
20
23
 
21
24
  ## Commands
@@ -24,16 +27,17 @@ ALTER_PAT=alter_pat_... alter apps list # headless / CI
24
27
  auth login | status | logout
25
28
  apps list | create | show | update | archive | unarchive | delete
26
29
  keys list | statistics | mint | show | rotate | revoke | rename
27
- agents list | create | show | update | revoke | audit |
30
+ agents list | create | show | update | suspend | resume | revoke | audit |
28
31
  registry-list | registry-show |
29
32
  (+ mint-key, list-keys, revoke-key, deprecate-key, undeprecate-key)
30
33
  providers list | list-catalog | create | show | update | delete
34
+ spec {list, status} | operations {list, get}
31
35
  identity-providers create | discover | webhook {enable, disable, rotate, status}
32
36
  managed-secrets list | show | create | rotate | delete | templates | access |
33
37
  set-delegation-policy | set-allowed-hosts | users |
34
38
  grants {list, list-for-agent, create, update, revoke} |
35
39
  groups {list, show}
36
- policy show-app | rules {create, list, get, update, delete}
40
+ policy show-app | simulate | rules {create, list, get, update, delete}
37
41
  audit list | show | explain | portal-actions | grant-events | traces |
38
42
  threads | thread | agents | agent | integrity-check
39
43
  grants list | revoke
@@ -41,17 +45,38 @@ analytics summary | dashboard | api-calls | by-provider | by-app |
41
45
  policy | latency | errors
42
46
  end-users list | show
43
47
  branding get | set | reset
44
- approvals defaults
48
+ approvals defaults | list | show
45
49
  pats whoami
46
50
  link / unlink pin an app to the current directory
47
51
  design / verify design-doc gate | code + runtime verification
48
52
  init / doctor project scaffolding | environment diagnosis
49
53
  completion install | print
50
54
  self-update --to <v>
51
- sdk-passthrough request <grant-id> --url <url>
55
+ sdk-passthrough request <grant-id> --url <url> | resolve-identity
56
+ ```
57
+
58
+ Data-returning commands expose `--output=json|table|jsonl`. For single-object
59
+ reports (including `design`, `verify`, and `doctor`), `jsonl` falls back to
60
+ pretty-printed JSON. `--fields a,b,c` is global but only affects JSON / JSONL
61
+ emitted through the shared output formatter; it is inert for table output and
62
+ commands that print confirmation text. See
63
+ [scripting](https://docs.alterauth.com/reference/cli/scripting) for exit codes
64
+ and CI patterns, and
65
+ [authentication](https://docs.alterauth.com/reference/cli/authentication) for
66
+ token storage details.
67
+
68
+ Agent scope updates use optimistic concurrency because `--scopes` replaces the
69
+ complete provider allowlist. Read the current `version`, then include it in the
70
+ update so a concurrent operator change is rejected instead of overwritten:
71
+
72
+ ```bash
73
+ alter agents show --app "$APP_ID" --agent "$AGENT_ID" --output=json
74
+ alter agents update --app "$APP_ID" --agent "$AGENT_ID" \
75
+ --scopes '{"github":["read:user"]}' --expected-version 7
52
76
  ```
53
77
 
54
- All commands accept `--output=json|table|jsonl` and `--fields a,b,c`. See [scripting](https://docs.alterauth.com/reference/cli/scripting) for exit codes and CI patterns, and [authentication](https://docs.alterauth.com/reference/cli/authentication) for token storage details.
78
+ A concurrent change exits with code `5` and a safe conflict message. Fetch the
79
+ agent again, reconcile the desired scopes, and retry with its new `version`.
55
80
 
56
81
  ## License
57
82
 
@@ -0,0 +1,11 @@
1
+ Third-Party Notices
2
+
3
+ This distribution may include:
4
+
5
+ - Commander.js, Copyright (c) 2011 TJ Holowaychuk, MIT License.
6
+ - PostHog Node SDK, Copyright PostHog, Inc., MIT License.
7
+ - node-keytar, Copyright (c) 2013 GitHub, Inc., MIT License.
8
+ - @alter-ai/alter-sdk, Copyright (c) 2026 Alter AI, MIT License.
9
+
10
+ The complete corresponding license texts are available in the installed package metadata and
11
+ the upstream projects. These notices do not modify the Alter CLI's MIT License.
package/dist/cli.d.ts CHANGED
@@ -62,11 +62,20 @@
62
62
  *
63
63
  * Scope: this pre-parser ONLY touches argv when the ``self-update``
64
64
  * subcommand is present. Every other subcommand sees argv verbatim.
65
- * The rewrite handles both ``--version <value>`` (space form) and
66
- * ``--version=<value>`` (equals form). A bare ``--version`` without a
67
- * follow-up value is LEFT ALONE — that's the legitimate "print CLI
68
- * version" invocation, and rewriting it to ``--to`` (which requires a
69
- * value) would surface a confusing error.
65
+ * The rewrite handles every form the legacy flag was typed in:
66
+ * ``--version <value>`` (space), ``--version=<value>`` (equals), and
67
+ * bare ``--version`` with no value.
68
+ *
69
+ * The bare form used to be left alone so Commander's program-wide
70
+ * ``-V/--version`` would service it as a "print CLI version" request.
71
+ * It no longer can: ``buildProgram`` confines each command's option
72
+ * scan to its own argv, so a flag typed after ``self-update`` belongs
73
+ * to ``self-update`` — which is what ``gh``, ``git``, ``docker``, and
74
+ * ``kubectl`` all do with a post-subcommand ``--version``. Rewriting
75
+ * the bare form keeps the deprecation path pointing operators at
76
+ * ``--to`` (``option '--to <version>' argument missing``) instead of
77
+ * dead-ending them on ``unknown option '--version'``. The CLI's own
78
+ * version stays one token away, at ``alter --version``.
70
79
  *
71
80
  * Returns the (possibly rewritten) argv array. Pure function modulo
72
81
  * the stderr write on rewrite; safe to call on every CLI startup.