@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.
Files changed (81) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +84 -0
  3. package/THIRD-PARTY-NOTICES.md +1226 -0
  4. package/dist/cli/actions/main.js +193 -0
  5. package/dist/cli/approval/main.js +76 -0
  6. package/dist/cli/artifact/main.js +115 -0
  7. package/dist/cli/cache/main.js +104 -0
  8. package/dist/cli/deployment/main.js +73 -0
  9. package/dist/cli/dispatch/main.js +47 -0
  10. package/dist/cli/environment/main.js +139 -0
  11. package/dist/cli/login/main.js +73 -0
  12. package/dist/cli/logout/main.js +43 -0
  13. package/dist/cli/logs/main.js +125 -0
  14. package/dist/cli/lsp/main.js +46 -0
  15. package/dist/cli/main.js +88 -0
  16. package/dist/cli/migrate/main.js +275 -0
  17. package/dist/cli/notify/main.js +257 -0
  18. package/dist/cli/oidc/main.js +103 -0
  19. package/dist/cli/reproduce/main.js +73 -0
  20. package/dist/cli/rerun/main.js +100 -0
  21. package/dist/cli/run/main.js +50 -0
  22. package/dist/cli/runner/main.js +238 -0
  23. package/dist/cli/schedule/main.js +54 -0
  24. package/dist/cli/search/main.js +123 -0
  25. package/dist/cli/secret/main.js +102 -0
  26. package/dist/cli/secret/shared.js +104 -0
  27. package/dist/cli/spend/main.js +81 -0
  28. package/dist/cli/terms/main.js +85 -0
  29. package/dist/cli/tests/main.js +122 -0
  30. package/dist/cli/timing/main.js +90 -0
  31. package/dist/cli/validate/main.js +48 -0
  32. package/dist/cli/variable/main.js +83 -0
  33. package/dist/cli/whoami/main.js +63 -0
  34. package/dist/cli/why/main.js +106 -0
  35. package/dist/src/application/authenticate.js +56 -0
  36. package/dist/src/application/dispatch-workflow.js +23 -0
  37. package/dist/src/application/explain-runs.js +40 -0
  38. package/dist/src/application/index.js +2 -0
  39. package/dist/src/application/inspect-runs.js +29 -0
  40. package/dist/src/application/manage-actions.js +26 -0
  41. package/dist/src/application/manage-approvals.js +24 -0
  42. package/dist/src/application/manage-artifacts.js +79 -0
  43. package/dist/src/application/manage-caches.js +41 -0
  44. package/dist/src/application/manage-environments.js +136 -0
  45. package/dist/src/application/manage-notifications.js +20 -0
  46. package/dist/src/application/manage-runners.js +89 -0
  47. package/dist/src/application/manage-secrets.js +83 -0
  48. package/dist/src/application/manage-terms.js +34 -0
  49. package/dist/src/application/read-logs.js +40 -0
  50. package/dist/src/application/report-spend.js +15 -0
  51. package/dist/src/application/rerun-runs.js +34 -0
  52. package/dist/src/application/resolve-run.js +19 -0
  53. package/dist/src/application/run-workflow.js +17 -0
  54. package/dist/src/application/scan-migration.js +76 -0
  55. package/dist/src/application/search-logs.js +24 -0
  56. package/dist/src/application/serve-language-server.js +15 -0
  57. package/dist/src/application/validate-workflows.js +12 -0
  58. package/dist/src/domain/credentials.js +82 -0
  59. package/dist/src/domain/fleet-history.js +136 -0
  60. package/dist/src/domain/index.js +2 -0
  61. package/dist/src/domain/insight.js +42 -0
  62. package/dist/src/domain/logsearch.js +40 -0
  63. package/dist/src/domain/migration.js +122 -0
  64. package/dist/src/domain/notify.js +64 -0
  65. package/dist/src/domain/outcomediff.js +40 -0
  66. package/dist/src/domain/provenance.js +63 -0
  67. package/dist/src/domain/runs.js +90 -0
  68. package/dist/src/domain/secrets.js +39 -0
  69. package/dist/src/domain/spend.js +50 -0
  70. package/dist/src/domain/supplychain.js +48 -0
  71. package/dist/src/domain/terms.js +16 -0
  72. package/dist/src/domain/validation.js +4 -0
  73. package/dist/src/infrastructure/control-plane-http.js +458 -0
  74. package/dist/src/infrastructure/credentials.js +134 -0
  75. package/dist/src/infrastructure/engine-binary.js +164 -0
  76. package/dist/src/infrastructure/github-api.js +154 -0
  77. package/dist/src/infrastructure/index.js +2 -0
  78. package/dist/src/infrastructure/loopback-login.js +136 -0
  79. package/dist/src/infrastructure/runner-binary.js +74 -0
  80. package/dist/src/infrastructure/secret-input.js +52 -0
  81. 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/).