@action-intelligence/cli 0.1.0 → 0.1.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 (3) hide show
  1. package/README.md +90 -80
  2. package/action.mjs +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # Action CLI
2
2
 
3
- The Action CLI is the Git-friendly, headless authoring surface for workflows. It talks only to
4
- the public `/v1` API: project files never reach into Action's database, Pierre, Nango, or runtime
5
- providers directly.
3
+ The Action CLI is the Git-friendly, headless authoring surface for workflows. It connects to Action
4
+ through the public API and browser-based sign-in flow.
6
5
 
7
- The server can gate the public workflow API per environment. When it is disabled, CLI remote
8
- commands fail without changing the local project.
6
+ If Action's remote API is unavailable, CLI remote commands fail without changing the local project.
9
7
 
10
8
  ## Install
11
9
 
12
- Node.js 20 or newer is required for the public package:
10
+ Node.js 20 or newer is required. The supported public distribution is
11
+ [`@action-intelligence/cli`](https://www.npmjs.com/package/@action-intelligence/cli) on npm:
13
12
 
14
13
  ```sh
15
14
  npm install --global @action-intelligence/cli
@@ -19,55 +18,67 @@ action auth login
19
18
 
20
19
  For a one-off invocation, use `npx @action-intelligence/cli`. The same package supports macOS, Linux, and
21
20
  Windows. Human sessions use macOS Keychain, Linux Secret Service, or Windows Credential Manager.
21
+ Linux human login requires a working Secret Service and the `secret-tool` executable, commonly
22
+ provided by the `libsecret` tools package.
22
23
 
23
- ## Run from this repository
24
+ ## Authentication and context
24
25
 
25
- The repository pins Bun in the root `package.json`.
26
+ For an interactive session, use:
26
27
 
27
28
  ```sh
28
- bun install --frozen-lockfile
29
- bun run --cwd apps/action-cli typecheck
30
- bun run --cwd apps/action-cli test
31
- bun run --cwd apps/action-cli build
32
- node apps/action-cli/dist/index.js --help
29
+ action auth login
33
30
  ```
34
31
 
35
- The installed package exposes the executable as `action`.
36
-
37
- ## Authentication and context
32
+ The CLI opens Action's sign-in flow. If your account can access more than one organization, login
33
+ asks you to choose one. `--organization <id-or-key>` makes that choice explicit.
38
34
 
39
- For an interactive session, use:
35
+ One profile retains one selected organization. To keep contexts for multiple organizations, use a
36
+ separate named profile for each one:
40
37
 
41
38
  ```sh
42
- action auth login
39
+ action --profile customer-a auth login --organization <id-or-key>
40
+ action --profile customer-b auth login --organization <id-or-key>
43
41
  ```
44
42
 
45
- The CLI discovers Action's public AuthKit configuration, opens the WorkOS device flow, and resolves
46
- the signed-in user to an eligible Action organization. Existing Action members and active Directory
47
- Sync users can both sign in; a directory-only user is provisioned on first login. If the identity is
48
- eligible for multiple organizations, login prompts for one. `--organization <id-or-key>` makes that
49
- choice explicit.
50
-
51
- Refreshable credentials are stored in the operating system credential store, never in profile or
43
+ Your sign-in is stored in the operating system's secure credential store, never in profile or
52
44
  project files. macOS Keychain, Linux Secret Service, and Windows Credential Manager are supported.
53
- The non-secret profile retains the discovered AuthKit client ID and issuer plus the selected Action organization. The
54
- `ACTION_AUTHKIT_CLIENT_ID` and `ACTION_AUTHKIT_ISSUER` overrides remain available for local or
55
- self-hosted development, but normal users do not need them.
45
+ Profiles contain only non-secret connection settings and your organization and space choices.
56
46
 
57
- Automation can provide one of these environment variables:
47
+ After login, inspect the available spaces in the selected organization and select the one the
48
+ profile should use:
58
49
 
59
- - `ACTION_TOKEN`: a short-lived WorkOS M2M or other accepted bearer token.
60
- - `ACTION_API_KEY`: an Action organization API key.
50
+ ```sh
51
+ action auth status
52
+ action context list
53
+ action context use <space-id-or-key>
54
+ action context show
55
+ ```
56
+
57
+ Use `action auth logout` when the stored session should be removed.
58
+
59
+ The CLI also accepts these machine-credential environment variables:
60
+
61
+ - `ACTION_TOKEN`: an accepted short-lived bearer token.
62
+ - `ACTION_API_KEY`: an organization API key enabled for Action automation.
61
63
 
62
64
  `ACTION_TOKEN` takes precedence when both are present. Put either value in a CI secret manager;
63
65
  do not write it to `action.json`, `.action/lock.json`, or the non-secret profile file.
64
-
65
- Profiles retain the API origin, WorkOS issuer/client ID, selected organization, and selected space.
66
- Use `action context list`, `action context show`, and `action context use` to inspect or change the
67
- remote context. `--profile`, `--api-url`, and `--space` provide per-command overrides. Stored human
68
- sessions are origin-bound: an `--api-url` override to a different origin requires an explicit
69
- `ACTION_TOKEN` or `ACTION_API_KEY`. Login, refresh-token rotation, and logout are serialized per
70
- profile so concurrent CLI processes cannot overwrite a newer session.
66
+ Machine credentials are not self-service in the initial release. Contact Action to enable a
67
+ credential for the target organization and space. Interactive human login is the supported default
68
+ for ordinary users.
69
+
70
+ Profiles retain the API URL, selected organization, and selected space. Use `action context list`,
71
+ `action context show`, and `action context use` to inspect or change the space within that
72
+ organization. `--profile`, `--api-url`, and `--space` provide per-command overrides. A signed-in
73
+ profile can only be used with the API URL it was created for; using a different URL requires an
74
+ explicit `ACTION_TOKEN` or `ACTION_API_KEY`. Concurrent login, credential refresh, and logout
75
+ operations are handled safely per profile.
76
+
77
+ `ACTION_PROFILE` selects a named profile, and `ACTION_SPACE_ID` overrides its selected space.
78
+ `ACTION_API_URL` supplies the API URL when no selected profile already provides one; use `--api-url`
79
+ for a per-command override. `ACTION_ORGANIZATION_ID` checks that the selected space belongs to the
80
+ expected organization; it does not change the organization you signed in to. When initializing
81
+ without a profile-selected space, pair it with `--space` or `ACTION_SPACE_ID`.
71
82
 
72
83
  ## Workflow project
73
84
 
@@ -86,10 +97,8 @@ workflows/
86
97
  - `action.json` identifies the schema version.
87
98
  - `workflow.json` contains stable workflow metadata and input/output schemas.
88
99
  - `index.mjs` contains ECMAScript source. Extra or symbolic-link source files are rejected.
89
- - `.action/lock.json` records the origin, space, workflow IDs, revision bases, content digests, the
90
- last successfully validated revision, and non-secret retry state for an interrupted publication.
91
- It contains no credentials and is intended to travel with the project so collaborators share the
92
- same optimistic-concurrency base.
100
+ - `.action/lock.json` records non-secret remote workflow and synchronization state. It contains no
101
+ credentials and should be committed so collaborators share the same synchronization point.
93
102
 
94
103
  Tracked JSON is canonicalized, source uses LF line endings with a final newline, and unchanged pulls
95
104
  are byte-stable.
@@ -99,31 +108,51 @@ are byte-stable.
99
108
  ```sh
100
109
  action workflows pull
101
110
  action workflows status
102
- action workflows diff
111
+ action workflows diff <workflow-key>
103
112
  action workflows validate
104
113
  action workflows push
105
114
  ```
106
115
 
107
116
  The default pull retrieves the latest authoring revision, including drafts. A published-only pull is
108
117
  for inspection and does not move the normal authoring base. Pull refuses to overwrite local changes
109
- unless the caller explicitly selects an overwrite strategy.
118
+ unless the caller explicitly selects an overwrite strategy. Use `--force` only when intentionally
119
+ discarding local divergence.
110
120
 
111
- Historical published exports contain the exact versioned source and input/output schemas. Because
112
- display names and descriptions are workflow-level mutable labels rather than revision data, those
113
- exports use the stable workflow key as the name and omit the current description instead of mixing
114
- current labels into historical code.
121
+ Historical published exports contain the source and input/output schemas from that exact version.
122
+ They use the stable workflow key as the name and omit the current description so current labels are
123
+ not mixed into historical code.
115
124
 
116
125
  Push creates or updates draft revisions only. It never publishes, and removing a local workflow
117
126
  directory never archives its remote workflow. Multi-workflow pushes report each result; successful
118
- drafts remain recorded in the lockfile if another workflow conflicts.
127
+ drafts remain recorded in the lockfile if another workflow conflicts. Push also asks the server to
128
+ validate each exact draft revision it creates. `action workflows validate --remote` can revalidate
129
+ the matching locked remote revision; it skips remote validation when local files have diverged from
130
+ that revision.
119
131
 
120
- Production effects are explicit and revision-specific:
132
+ Inspect a published snapshot without moving the normal authoring base by writing it to a separate
133
+ directory:
134
+
135
+ ```sh
136
+ action workflows pull --published --output ./published-snapshot
137
+ ```
138
+
139
+ Publishing and archival are explicit and prompt for confirmation:
121
140
 
122
141
  ```sh
123
142
  action workflows publish <workflow-key> --revision <revision-id>
124
143
  action workflows archive <workflow-key>
125
144
  ```
126
145
 
146
+ Omitting `--revision` publishes the latest revision recorded in the project lockfile. Supplying an
147
+ earlier revision performs a rollback by moving the published pointer; the server revalidates the
148
+ target revision at publication time, and publication does not rewrite history. Non-interactive
149
+ callers must provide both the global mode and explicit confirmation:
150
+
151
+ ```sh
152
+ action --non-interactive workflows publish <workflow-key> --revision <revision-id> --yes
153
+ action --non-interactive workflows archive <workflow-key> --yes
154
+ ```
155
+
127
156
  Use `action workflows list` and `action workflows revisions <workflow-key>` to inspect remote state.
128
157
  Application actions, required scopes, and connected accounts can be discovered without a project
129
158
  checkout. Supplying an application filter requests its full action schemas:
@@ -156,6 +185,9 @@ action workflows run <workflow-key> --input '{"ticketId":"T-123"}'
156
185
  action workflows run <workflow-key> --input-file run-input.json --wait
157
186
  ```
158
187
 
188
+ `action workflows run` starts a production invocation immediately and does not prompt for
189
+ confirmation. Use a controlled workflow and input when testing this command.
190
+
159
191
  Inspect or control a production run through its stable run ID:
160
192
 
161
193
  ```sh
@@ -167,7 +199,8 @@ action workflows runs cancel <run-id>
167
199
  ```
168
200
 
169
201
  Watch cursors are opaque and resumable. Ctrl-C stops only the local watch; it does not cancel the
170
- remote run. Use the explicit cancel command for that.
202
+ remote run. Use the explicit cancel command for that. Cancellation is submitted immediately and
203
+ does not prompt for confirmation.
171
204
 
172
205
  `--jsonl` emits each event as `{"type":"event","event":{...}}`, followed by one terminal
173
206
  `{"type":"summary","eventCount":...,"nextCursor":...,"run":...,"stopped":...}` record. Consumers
@@ -176,9 +209,11 @@ option.
176
209
 
177
210
  ## Automation output
178
211
 
179
- Every remote command supports `--json`. JSON mode writes a single machine-readable result to stdout
180
- and keeps progress noise out of the stream. `--non-interactive` disables prompts; a destructive
181
- operation must also receive its explicit confirmation option.
212
+ Result-producing commands support the global `--json` option. JSON mode writes a single
213
+ machine-readable result to stdout and keeps progress noise out of the stream; interactive
214
+ `action auth login` rejects JSON and non-interactive mode. `--non-interactive` disables prompts.
215
+ Commands that normally prompt for production confirmation—currently publish and archive—must also
216
+ receive `--yes`.
182
217
 
183
218
  Stable process exit codes are:
184
219
 
@@ -194,29 +229,4 @@ Stable process exit codes are:
194
229
  | 7 | Other remote API failure |
195
230
  | 8 | Partial multi-workflow result |
196
231
 
197
- API errors are normalized and redact credential-bearing headers and query parameters before output.
198
-
199
- ## Build distributable artifacts
200
-
201
- `bun run --cwd apps/action-cli release:package` assembles the dependency-free npm payload in
202
- `dist/npm`. `bun run --cwd apps/action-cli release:binaries` cross-compiles standalone executables
203
- for macOS, Linux, and Windows on x64 and ARM64. Once binary artifacts have been assembled beside one
204
- another, produce their deterministic integrity manifest with:
205
-
206
- ```sh
207
- bun run --cwd apps/action-cli release:checksums -- dist/release/action-*
208
- ```
209
-
210
- The command writes a conventional, sorted `SHA256SUMS` file beside the artifacts. A `cli-vX.Y.Z`
211
- tag whose commit is on `main` validates the package on macOS, Linux, and Windows, publishes the
212
- public npm package through short-lived OIDC credentials, and retains checksummed standalone build
213
- artifacts for release validation. npm is the supported public installation channel.
214
-
215
- ## Extension model
216
-
217
- - Add API shapes to OpenAPI and regenerate `@action/workflows-client`; do not hand-maintain a second
218
- transport client.
219
- - Keep command routing, remote API adaptation, local project state, authentication, and rendering in
220
- separate modules.
221
- - Add new product areas as sibling command namespaces instead of importing workflow internals.
222
- - Preserve canonical project serialization and stable JSON output as compatibility contracts.
232
+ API error output omits recognized sensitive fields, raw transport errors, and request URLs.