@azx-pbc/helix-cli 0.3.0 → 0.5.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/README.md +51 -11
- package/dist/helix.js +1872 -592
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -21,17 +21,23 @@ is wherever you're standing.
|
|
|
21
21
|
Each setting is resolved **flags → environment → `helix.json` → built-in default**
|
|
22
22
|
(first match wins):
|
|
23
23
|
|
|
24
|
-
| Setting
|
|
25
|
-
|
|
|
26
|
-
| App slug
|
|
27
|
-
| Portal URL
|
|
28
|
-
| Build dir
|
|
29
|
-
| Auth token
|
|
24
|
+
| Setting | Flag | Env | `helix.json` key | Default |
|
|
25
|
+
| ----------- | --------------- | ------------------ | ---------------- | -------------------------- |
|
|
26
|
+
| App slug | `--slug` | — | `slug` | _(required)_ |
|
|
27
|
+
| Portal URL | `--portal-url` | `HELIX_PORTAL_URL` | `portalUrl` | `http://localhost:3001` |
|
|
28
|
+
| Build dir | `--dir` | — | `dir` | `dist` |
|
|
29
|
+
| Auth token | `--token` | `HELIX_TOKEN` | — | _(`helix login` if unset)_ |
|
|
30
|
+
| Description | `--description` | — | `description` | — |
|
|
30
31
|
|
|
31
32
|
A `helix.json` looks like:
|
|
32
33
|
|
|
33
34
|
```json
|
|
34
|
-
{
|
|
35
|
+
{
|
|
36
|
+
"slug": "my-app",
|
|
37
|
+
"dir": "dist",
|
|
38
|
+
"portalUrl": "https://portal.example.com",
|
|
39
|
+
"description": "Tracks Q3 cloud spend by team."
|
|
40
|
+
}
|
|
35
41
|
```
|
|
36
42
|
|
|
37
43
|
**`portalUrl` is the one you cannot leave to the default.** `http://localhost:3001`
|
|
@@ -55,12 +61,14 @@ would be wrong for every deployment but one — so to deploy an example, add
|
|
|
55
61
|
helix login # browser sign-in (OIDC device flow)
|
|
56
62
|
helix logout # forget the cached tokens
|
|
57
63
|
helix whoami # who the portal thinks you are
|
|
58
|
-
helix create [--display-name <name>] [--visibility <v>] # register the app
|
|
64
|
+
helix create [--display-name <name>] [--description <text>] [--visibility <v>] # register the app
|
|
59
65
|
helix deploy [--dir <dir>] [--bundle <zip>] [--promote] # upload a version
|
|
60
66
|
helix versions # list versions
|
|
61
67
|
helix promote <number> # make a version live
|
|
62
68
|
helix rollback [number] # revert the live pointer
|
|
63
69
|
helix skill [--path <file>] # write this deployment's agent skill to disk
|
|
70
|
+
helix ci init [--repo <owner/name>] [--branch <b>] [--reusable] [--force] # deploy from GitHub Actions
|
|
71
|
+
helix ci show | helix ci remove # the app's repo binding
|
|
64
72
|
```
|
|
65
73
|
|
|
66
74
|
`deploy` uploads the bundle as a **preview**; `--promote` flips it live in the
|
|
@@ -74,6 +82,36 @@ in. It needs no app slug or `helix.json`, only a portal URL and a token. Default
|
|
|
74
82
|
`./SKILL.md`; `--path .claude/skills/helix/SKILL.md` drops it where a Claude Code
|
|
75
83
|
agent reads it off disk.
|
|
76
84
|
|
|
85
|
+
### Deploying from GitHub Actions
|
|
86
|
+
|
|
87
|
+
`helix ci init`, run signed in from the app's directory in its repo checkout,
|
|
88
|
+
connects the app to the repo and branch. The repo comes from `origin`; the
|
|
89
|
+
branch is the remote's default branch. `--repo` and `--branch` override either.
|
|
90
|
+
It then writes `.github/workflows/helix-deploy.yml` and merges `slug`,
|
|
91
|
+
`portalUrl` and `dir` into `helix.json`, or into a legacy `azx.json` if that's
|
|
92
|
+
the file in use. Commit both. Each push to the branch then lands a preview
|
|
93
|
+
(ADR-0051). Re-running it keeps any environment or workflow limit set on the
|
|
94
|
+
Repository tab, and refuses to replace a workflow pin unless you pass `--force`.
|
|
95
|
+
|
|
96
|
+
The generated workflow has two jobs. `build` installs and builds with no
|
|
97
|
+
`id-token` permission. `deploy` downloads the output and runs only the pinned
|
|
98
|
+
CLI. Code from the repo or its dependencies never runs where it could mint a
|
|
99
|
+
deploy token.
|
|
100
|
+
|
|
101
|
+
The workflow needs no secret. Inside GitHub Actions, when `HELIX_TOKEN` is not
|
|
102
|
+
set and the job has `permissions: id-token: write`, `helix deploy` asks GitHub
|
|
103
|
+
for an OIDC token whose audience is the portal (read from `GET /api/v1/config`)
|
|
104
|
+
and uploads to `POST /api/v1/apps/:slug/ci/versions`. CI deploys always land as
|
|
105
|
+
a preview, so `--promote` is refused there. It refuses to send the token to a
|
|
106
|
+
plain-`http` portal other than one on `localhost`.
|
|
107
|
+
|
|
108
|
+
`--reusable` writes a caller of the public reusable workflow
|
|
109
|
+
(`AZX-PBC-OSS/helix-actions`, source in `integrations/helix-actions/`) instead
|
|
110
|
+
of a self-contained one. It also pins the binding to that workflow, so no other
|
|
111
|
+
workflow on the branch can deploy. `helix ci show` prints the binding,
|
|
112
|
+
including the repo ids pinned by the first deploy. `helix ci remove` disconnects
|
|
113
|
+
the app.
|
|
114
|
+
|
|
77
115
|
> **Breaking in 0.2.0:** the `private` visibility mode was renamed to `internal`.
|
|
78
116
|
> It never checked _which_ user signed in, only that someone had. Passing the old
|
|
79
117
|
> value now **errors** rather than mapping to the new one, deliberately: the name
|
|
@@ -85,9 +123,11 @@ agent reads it off disk.
|
|
|
85
123
|
Two paths, in precedence order:
|
|
86
124
|
|
|
87
125
|
1. **Static token** — `HELIX_TOKEN` / `--token`. Sends the value as a bearer
|
|
88
|
-
token verbatim. This is the
|
|
89
|
-
dev-token stub keeps working (`HELIX_TOKEN=$PORTAL_DEV_TOKEN`).
|
|
90
|
-
accepted by a production portal.
|
|
126
|
+
token verbatim. This is the local scripts path, and also how the portal's
|
|
127
|
+
dev-token stub keeps working (`HELIX_TOKEN=$PORTAL_DEV_TOKEN`). The dev token
|
|
128
|
+
is never accepted by a production portal. A stored token is not a supported
|
|
129
|
+
way to deploy from CI; repo-backed deploys use the workflow's GitHub Actions
|
|
130
|
+
OIDC token instead (ADR-0051).
|
|
91
131
|
2. **`helix login`** — the OIDC device flow. The CLI asks the portal
|
|
92
132
|
(`GET /api/v1/auth/config`) which issuer to use (the local dev IdP on
|
|
93
133
|
`:3002` in dev; Entra later), prints a verification URL + code, and polls
|