@apex-actions/cli 0.67.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 +20 -0
- package/README.md +84 -0
- package/THIRD-PARTY-NOTICES.md +1226 -0
- package/dist/cli/actions/main.js +193 -0
- package/dist/cli/approval/main.js +76 -0
- package/dist/cli/artifact/main.js +115 -0
- package/dist/cli/cache/main.js +104 -0
- package/dist/cli/deployment/main.js +73 -0
- package/dist/cli/dispatch/main.js +47 -0
- package/dist/cli/environment/main.js +139 -0
- package/dist/cli/login/main.js +73 -0
- package/dist/cli/logout/main.js +43 -0
- package/dist/cli/logs/main.js +125 -0
- package/dist/cli/lsp/main.js +46 -0
- package/dist/cli/main.js +88 -0
- package/dist/cli/migrate/main.js +275 -0
- package/dist/cli/notify/main.js +257 -0
- package/dist/cli/oidc/main.js +103 -0
- package/dist/cli/reproduce/main.js +73 -0
- package/dist/cli/rerun/main.js +100 -0
- package/dist/cli/run/main.js +50 -0
- package/dist/cli/runner/main.js +238 -0
- package/dist/cli/schedule/main.js +54 -0
- package/dist/cli/search/main.js +123 -0
- package/dist/cli/secret/main.js +102 -0
- package/dist/cli/secret/shared.js +104 -0
- package/dist/cli/spend/main.js +81 -0
- package/dist/cli/terms/main.js +85 -0
- package/dist/cli/tests/main.js +122 -0
- package/dist/cli/timing/main.js +90 -0
- package/dist/cli/validate/main.js +48 -0
- package/dist/cli/variable/main.js +83 -0
- package/dist/cli/whoami/main.js +63 -0
- package/dist/cli/why/main.js +106 -0
- package/dist/src/application/authenticate.js +56 -0
- package/dist/src/application/dispatch-workflow.js +23 -0
- package/dist/src/application/explain-runs.js +40 -0
- package/dist/src/application/index.js +2 -0
- package/dist/src/application/inspect-runs.js +29 -0
- package/dist/src/application/manage-actions.js +26 -0
- package/dist/src/application/manage-approvals.js +24 -0
- package/dist/src/application/manage-artifacts.js +79 -0
- package/dist/src/application/manage-caches.js +41 -0
- package/dist/src/application/manage-environments.js +136 -0
- package/dist/src/application/manage-notifications.js +20 -0
- package/dist/src/application/manage-runners.js +89 -0
- package/dist/src/application/manage-secrets.js +83 -0
- package/dist/src/application/manage-terms.js +34 -0
- package/dist/src/application/read-logs.js +40 -0
- package/dist/src/application/report-spend.js +15 -0
- package/dist/src/application/rerun-runs.js +34 -0
- package/dist/src/application/resolve-run.js +19 -0
- package/dist/src/application/run-workflow.js +17 -0
- package/dist/src/application/scan-migration.js +76 -0
- package/dist/src/application/search-logs.js +24 -0
- package/dist/src/application/serve-language-server.js +15 -0
- package/dist/src/application/validate-workflows.js +12 -0
- package/dist/src/domain/credentials.js +82 -0
- package/dist/src/domain/fleet-history.js +136 -0
- package/dist/src/domain/index.js +2 -0
- package/dist/src/domain/insight.js +42 -0
- package/dist/src/domain/logsearch.js +40 -0
- package/dist/src/domain/migration.js +122 -0
- package/dist/src/domain/notify.js +64 -0
- package/dist/src/domain/outcomediff.js +40 -0
- package/dist/src/domain/provenance.js +63 -0
- package/dist/src/domain/runs.js +90 -0
- package/dist/src/domain/secrets.js +39 -0
- package/dist/src/domain/spend.js +50 -0
- package/dist/src/domain/supplychain.js +48 -0
- package/dist/src/domain/terms.js +16 -0
- package/dist/src/domain/validation.js +4 -0
- package/dist/src/infrastructure/control-plane-http.js +458 -0
- package/dist/src/infrastructure/credentials.js +134 -0
- package/dist/src/infrastructure/engine-binary.js +164 -0
- package/dist/src/infrastructure/github-api.js +154 -0
- package/dist/src/infrastructure/index.js +2 -0
- package/dist/src/infrastructure/loopback-login.js +136 -0
- package/dist/src/infrastructure/runner-binary.js +74 -0
- package/dist/src/infrastructure/secret-input.js +52 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Apex Actions Software Licence
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Apex Actions. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software is proprietary. It is licensed, not sold, under the Apex Actions
|
|
6
|
+
Software Licence, whose current text is published at
|
|
7
|
+
|
|
8
|
+
https://apexactions.com/legal/software-licence/
|
|
9
|
+
|
|
10
|
+
and is incorporated here by reference. In short: you may install and run it for
|
|
11
|
+
use with the Apex Actions hosted service, or with a deployment of the service
|
|
12
|
+
that a written agreement entitles you to operate; you may not redistribute,
|
|
13
|
+
modify, reverse engineer, or use it to build a competing service. Every right
|
|
14
|
+
not granted there is reserved.
|
|
15
|
+
|
|
16
|
+
Third-party components are included under their own licences, which this
|
|
17
|
+
licence does not restrict; their notices accompany the software.
|
|
18
|
+
|
|
19
|
+
The hosted service itself is governed by the Terms of Service at
|
|
20
|
+
https://apexactions.com/legal/terms/, not by this licence.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# cli
|
|
2
|
+
|
|
3
|
+
`apex` developer and operator CLI (TypeScript, commander).
|
|
4
|
+
|
|
5
|
+
Part of the [Apex Actions](../) superproject. Conventions, architecture, and agent context live in the `context` repository.
|
|
6
|
+
|
|
7
|
+
## Commands
|
|
8
|
+
|
|
9
|
+
| Command | Reaches | Needs |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `apex run` | the runner binary, locally | `apex-runner` on `PATH` |
|
|
12
|
+
| `apex validate` | the engine binary, locally | `apex-engine` on `PATH` |
|
|
13
|
+
| `apex migrate scan` | the engine binary + the GitHub REST API | `apex-engine` on `PATH`; `GITHUB_TOKEN` unless `--path` |
|
|
14
|
+
| `apex logs` | the control-plane REST API | the operator token (`APEX_ADMIN_TOKEN`) |
|
|
15
|
+
| `apex dispatch` | the control-plane REST API | the operator token (`APEX_ADMIN_TOKEN`) |
|
|
16
|
+
| `apex login` · `logout` · `whoami` | the browser and the control-plane REST API | nothing — `login` mints the credential |
|
|
17
|
+
| `apex secret` · `apex variable` | the control-plane REST API | a customer token (`APEX_TOKEN` or `apex login`), repository admin |
|
|
18
|
+
|
|
19
|
+
Generated reference: `docs/feature-docs/cli-commands.md` (`pnpm docs:cli`).
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
export APEX_API_URL=https://apex.example
|
|
23
|
+
export APEX_ADMIN_TOKEN=… # the operator token, not a person's session
|
|
24
|
+
|
|
25
|
+
apex dispatch .github/workflows/deploy.yml --repo octo/app --ref main --input environment=production
|
|
26
|
+
apex logs latest --repo octo/app --follow # exits non-zero if the run failed
|
|
27
|
+
apex logs '#42' --job test # one job, clean enough to pipe
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`apex migrate scan` answers "will my workflows run" before anything has moved. Every verdict comes
|
|
31
|
+
out of the engine's conformance corpus with the fixture that proves it (ADR-0002, engine ADR-0013) —
|
|
32
|
+
nothing here holds a second opinion about compatibility. It imports secret and variable **names** and
|
|
33
|
+
never values, and `--path` scans a checkout on this machine with no token and no network:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
apex migrate scan --path . # this repository, no credentials
|
|
37
|
+
apex migrate scan acme --repo acme/api --json # one repository of an organization
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Credentials
|
|
41
|
+
|
|
42
|
+
The CLI resolves one credential, in this order (control-plane ADR-0064):
|
|
43
|
+
|
|
44
|
+
1. `APEX_TOKEN` — a token minted on the dashboard (`/settings/tokens`), for CI and scripts;
|
|
45
|
+
2. the token `apex login` saved in `$XDG_CONFIG_HOME/apex/credentials` (default `~/.config`),
|
|
46
|
+
mode `0600` in a `0700` directory — a file readable by group or others is **refused**, as `ssh`
|
|
47
|
+
refuses a private key;
|
|
48
|
+
3. `APEX_ADMIN_TOKEN` — the operator's machine token, unchanged: unscoped, so treat it as a root
|
|
49
|
+
credential;
|
|
50
|
+
4. otherwise the command stops with exit 2, naming `APEX_TOKEN` and `apex login`.
|
|
51
|
+
|
|
52
|
+
`APEX_API_URL` selects the control plane (default `https://app.apexactions.com`); a saved login is
|
|
53
|
+
only ever sent to the control plane that issued it. `apex login` opens the consent page on the web
|
|
54
|
+
app — `APEX_WEB_URL`, or the API's origin — and listens on `127.0.0.1` for the loopback callback
|
|
55
|
+
(RFC 8252, PKCE). A customer token's scope is repository secrets and variables plus `/me`; every
|
|
56
|
+
other command answers with the server's 403. `apex logout` deletes the file only: a token cannot
|
|
57
|
+
revoke itself, so revoke it on the dashboard. No command prints a token.
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
apex login # once per machine
|
|
61
|
+
printf %s "$TOKEN" | apex secret set ETS_PACKAGES_TOKEN --repo acme/api --repo acme/web
|
|
62
|
+
apex secret set DEPLOY_KEY --repo acme/api --from-file ./deploy.key
|
|
63
|
+
apex variable set AWS_REGION --value eu-west-1 --repo acme/api
|
|
64
|
+
apex secret list --repo acme/api --json # names only
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`apex secret set` never takes the value from the command line — argv is visible in `ps` and saved in
|
|
68
|
+
shell history (BUG-0157) — so `--value` is refused with exit 2. Exit codes: 0 done · 1 the API
|
|
69
|
+
refused · 2 usage or configuration · 3 not found on `delete`.
|
|
70
|
+
|
|
71
|
+
## Layout
|
|
72
|
+
|
|
73
|
+
- `cli/<command>/main.ts` — one commander leaf per command (§7)
|
|
74
|
+
- `src/domain/` — pure decisions: run and job selection, input parsing, exit codes
|
|
75
|
+
- `src/application/` — use cases over ports
|
|
76
|
+
- `src/infrastructure/` — adapters: the engine and runner binaries, the REST API
|
|
77
|
+
- `docs/` — general docs (`*.md`), `adr/`, `feature-docs/`, `run-book/`
|
|
78
|
+
- `VERSION` — lockstep version, managed by the `release` library; do not edit by hand
|
|
79
|
+
|
|
80
|
+
## Licence
|
|
81
|
+
|
|
82
|
+
`@apex-actions/cli` is proprietary software, licensed under the
|
|
83
|
+
[Apex Actions Software Licence](https://apexactions.com/legal/software-licence/) — see `LICENSE`.
|
|
84
|
+
The hosted service it talks to is governed by the [terms of service](https://apexactions.com/legal/terms/).
|