@azx-pbc/helix-cli 0.4.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.
Files changed (3) hide show
  1. package/README.md +37 -3
  2. package/dist/helix.js +784 -174
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -67,6 +67,8 @@ helix versions # list versions
67
67
  helix promote <number> # make a version live
68
68
  helix rollback [number] # revert the live pointer
69
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
70
72
  ```
71
73
 
72
74
  `deploy` uploads the bundle as a **preview**; `--promote` flips it live in the
@@ -80,6 +82,36 @@ in. It needs no app slug or `helix.json`, only a portal URL and a token. Default
80
82
  `./SKILL.md`; `--path .claude/skills/helix/SKILL.md` drops it where a Claude Code
81
83
  agent reads it off disk.
82
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
+
83
115
  > **Breaking in 0.2.0:** the `private` visibility mode was renamed to `internal`.
84
116
  > It never checked _which_ user signed in, only that someone had. Passing the old
85
117
  > value now **errors** rather than mapping to the new one, deliberately: the name
@@ -91,9 +123,11 @@ agent reads it off disk.
91
123
  Two paths, in precedence order:
92
124
 
93
125
  1. **Static token** — `HELIX_TOKEN` / `--token`. Sends the value as a bearer
94
- token verbatim. This is the CI/scripts path, and also how the portal's
95
- dev-token stub keeps working (`HELIX_TOKEN=$PORTAL_DEV_TOKEN`). It is never
96
- 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).
97
131
  2. **`helix login`** — the OIDC device flow. The CLI asks the portal
98
132
  (`GET /api/v1/auth/config`) which issuer to use (the local dev IdP on
99
133
  `:3002` in dev; Entra later), prints a verification URL + code, and polls