@allstak/wizard 0.1.3 → 0.1.4

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/CHANGELOG.md CHANGED
@@ -4,7 +4,20 @@ All notable changes to `@allstak/wizard` will be documented here. The format
4
4
  follows [Keep a Changelog](https://keepachangelog.com/) and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
- ## [Unreleased] — 0.1.3
7
+ ## [Unreleased] — 0.1.4
8
+
9
+ ### Changed
10
+ - README rewritten to reflect the v0.1.3 beta surface (real auth, full
11
+ command list, 123 tests, telemetry contract, error catalog, current v0.2
12
+ roadmap).
13
+ - Package metadata polished for npm: tighter description, `sdk-install`
14
+ keyword consolidated to `sdk`, exports map gains `./config` and
15
+ `./errors` subpaths, `files` whitelist gains `docs/errors.md` and
16
+ `docs/beta/`.
17
+ - Scrubbed two absolute local paths from shipped content
18
+ (`docs/architecture/v02-java-host-fix-spec.md`, `src/api/types.ts`).
19
+
20
+ ## [0.1.3] — 2026-05-07
8
21
 
9
22
  ### Added
10
23
  - Privacy-safe telemetry (`src/telemetry/*`) — disabled by default until an
package/README.md CHANGED
@@ -1,79 +1,328 @@
1
1
  # @allstak/wizard
2
2
 
3
- > v0.1 — Unified installation and configuration wizard for AllStak SDKs.
3
+ > **v0.1.3 beta** — Unified installation and configuration wizard for AllStak SDKs.
4
4
 
5
- A Sentry-Wizard-style CLI that installs and configures AllStak SDKs in your project with one command. Designed to be **honest by default**: only integrations validated end-to-end against real fixture projects ship with the `VALIDATED` tag; everything else is `SCAFFOLD` and refuses to apply patches without `--experimental`.
5
+ A Sentry-Wizard-style CLI that installs and configures AllStak SDKs in
6
+ your project with one command. Designed to be **honest by default**:
7
+ integrations only graduate to `stable` after end-to-end fixture validation;
8
+ `experimental` integrations refuse to run without an explicit opt-in;
9
+ `unsupported` integrations refuse outright with a pointer to manual setup.
6
10
 
7
- ## Status
11
+ ## Status: public beta
8
12
 
9
- | Integration | Tag | Notes |
10
- |---------------|-------------|-------|
11
- | `react` | VALIDATED | Vite + plain React, AST-tested |
12
- | `next` | VALIDATED | Next 13+ app & pages router |
13
- | `js` | VALIDATED | Vanilla Node entry-point patching |
14
- | `expo` | SCAFFOLD | Config-plugin path scaffolded; native build verification deferred to v0.2 |
15
- | `react-native` | UNSUPPORTED | Bare RN intentionally refused — Podfile/Gradle patching not validated |
16
- | `nestjs` / `fastify` / `otel` / `python` / `go` / `java` / `php` / `ruby` / `dotnet` / `flutter` | SCAFFOLD | Env-var writing only; framework wiring deferred to v0.2 |
13
+ This release is **beta-ready, not stable**. Sit on it, dogfood it, file
14
+ issues — but expect the surface to wobble in patch releases until 1.0.
17
15
 
18
- Run `allstak-wizard list` to see this matrix at runtime.
16
+ | Integration | Stability | Notes |
17
+ |-------------|-----------|-------|
18
+ | `react` (Vite or CRA) | ✅ stable | Validated end-to-end; dogfooded |
19
+ | `next` (13+, app + pages router) | 🟡 beta | Implementation complete; production-build matrix in progress |
20
+ | `js` (vanilla Node) | ✅ stable | Validated end-to-end |
21
+ | `expo`, `nestjs`, `fastify`, `otel`, `python`, `go`, `java`, `php`, `ruby`, `dotnet`, `flutter` | 🟠 experimental | Install + env-var writing only; framework wiring deferred. Refuses without `--experimental`. |
22
+ | `react-native` (bare) | ❌ unsupported | Refused outright — Podfile/Gradle patching not validated. Use Expo or follow manual setup. |
19
23
 
20
- ## Install
24
+ `allstak-wizard list` prints this matrix at runtime. See
25
+ [`docs/beta/known-limitations.md`](./docs/beta/known-limitations.md) for
26
+ the full honest list.
21
27
 
22
- In v0.1 the package is not published. To run from source:
28
+ ## Install + run
23
29
 
24
30
  ```bash
25
- cd /path/to/sdks/allstak-wizard
26
- npm install
27
- npx tsx src/cli.ts --help
31
+ # Show help (also fetches and runs the package via npx).
32
+ npx @allstak/wizard@beta --help
33
+
34
+ # Authenticate against AllStak (email OTP, optional 2FA).
35
+ npx @allstak/wizard@beta login
36
+
37
+ # Configure your project (auto-detects React / Next / Node).
38
+ npx @allstak/wizard@beta -i react
39
+
40
+ # Verify with a real test event roundtrip.
41
+ npx @allstak/wizard@beta doctor --live-probe \
42
+ --api-key ask_live_... \
43
+ --project-id <project-uuid>
28
44
  ```
29
45
 
30
- ## Usage
46
+ Five-minute walkthrough: [`docs/beta/quickstart.md`](./docs/beta/quickstart.md).
47
+
48
+ ## Authentication
49
+
50
+ Real AllStak auth flow — no fake endpoints. Backed by the verified
51
+ `/api/v1/auth/*` endpoints on `api.allstak.sa`.
31
52
 
32
53
  ```bash
33
- # Auto-detect framework, interactive
34
- allstak-wizard
54
+ allstak-wizard login # email OTP → JWT pair stored in OS keychain
55
+ allstak-wizard whoami [--verify] # show current user; --verify round-trips /auth/me
56
+ allstak-wizard logout # revoke session + clear local credentials
57
+ ```
35
58
 
36
- # Explicit, non-interactive
37
- allstak-wizard -i react --api-key $ALLSTAK_API_KEY -y
59
+ Supports:
38
60
 
39
- # Self-hosted
40
- allstak-wizard -i next --host https://api.acme.allstak.com --api-key $KEY -y
61
+ - **Email OTP** primary flow (`/api/v1/auth/request-otp` → `/api/v1/auth/verify-otp`).
62
+ - **TOTP** second factor when enabled on the account.
63
+ - **JWT refresh** with proactive 60s pre-expiry refresh + token rotation.
64
+ - **CI mode** via `--api-key` / `ALLSTAK_API_KEY` (skip login entirely).
65
+ - **Cross-platform credential storage**: macOS Keychain, Linux Secret
66
+ Service (`secret-tool`), AES-256-GCM encrypted-file fallback.
41
67
 
42
- # Dry run (prints diff, writes nothing)
43
- allstak-wizard -i react --dry-run -y
68
+ `--api-key` is for project-scoped data-plane operations (sending events).
69
+ The user JWT is for control-plane operations (orgs, projects, doctor). The
70
+ two are NOT interchangeable — that mirrors the backend's design.
71
+
72
+ ## Commands
44
73
 
45
- # Other commands
46
- allstak-wizard list
47
- allstak-wizard doctor [-i react]
48
- allstak-wizard repair -i react
49
- allstak-wizard uninstall -i react -y
50
74
  ```
75
+ init [-i <integration>] [--api-key|--org|--project|--release|...] [--dry-run] [-y]
76
+ doctor [-i <integration>] [--live-probe --api-key --project-id <uuid>]
77
+ repair -i <integration> [--dry-run]
78
+ uninstall -i <integration> [-y] [--dry-run]
79
+ list
51
80
 
52
- ## Authentication (v0.1)
81
+ login [--email <e> --code <c>] [--totp <c>]
82
+ logout [--local-only]
83
+ whoami [--verify]
53
84
 
54
- Browser/device-flow login is **not** implemented in v0.1. Provide a key via `--api-key` or `ALLSTAK_API_KEY`. `allstak-wizard login` exits with a clear hint.
85
+ orgs list
86
+ projects list [--org <id>]
87
+ projects create [--name --slug --platform --with-api-key]
55
88
 
56
- ## Architecture
89
+ restore list
90
+ restore show <id|latest>
91
+ restore apply <id|latest> [--files=a,b,c] [--dry-run] [-y]
92
+ restore diff <id|latest>
57
93
 
58
- - **Registry** — every integration is an `Integration` object with `detect`, `plan`, `install`, `patch`, `validate`, `uninstall`, `repair`, `doctor` methods. New integrations register themselves; the CLI is integration-agnostic.
59
- - **Transaction** — every file mutation goes through a `Transaction` that snapshots before writing, validates syntax after writing, and rolls back the entire batch on any failure.
60
- - **Markers** — every injected region is wrapped with `>>> allstak-wizard:v1` markers. Re-runs replace the existing block (idempotent). `uninstall` removes the block cleanly.
61
- - **AST patching** — JS/TS files use `magicast` (recast under the hood) to add imports without disturbing user code; non-AST changes (provider wrap hints, Vite plugin hints) live in marker blocks.
62
- - **Dry-run** — every command supports `--dry-run`; the transaction layer captures the diff but skips disk writes.
94
+ config validate
95
+ config migrate [--dry-run]
96
+ ```
63
97
 
64
- ## Self-hosted support
98
+ Global flags:
65
99
 
66
- The wizard never assumes `api.allstak.sa`; pass `--host`, `--ingest-host`, and `--dashboard-host` to point at any AllStak deployment. Note: the Java SDK currently hardcodes its host — that's a known SDK-side bug, not a wizard bug. See the v0.1 implementation report for details.
100
+ ```
101
+ --debug verbose debug logging
102
+ --json machine-readable output to stdout (status text → stderr)
103
+ --no-telemetry disable anonymous usage telemetry for this run
104
+ --telemetry-debug print the telemetry payload to stderr without sending
105
+ ```
67
106
 
68
- ## Testing
107
+ ## Telemetry & privacy
108
+
109
+ **Default provider is `noopTelemetry`** — the wizard does not phone home in
110
+ beta. An HTTP provider exists (`httpTelemetry({ endpoint })`) for operators
111
+ to wire in once a backend telemetry endpoint is decided on.
112
+
113
+ Three independent ways to opt out, any one suffices:
114
+
115
+ ```bash
116
+ npx @allstak/wizard@beta --no-telemetry ...
117
+ ALLSTAK_WIZARD_TELEMETRY=0 npx @allstak/wizard@beta ...
118
+ # Or: leave the default noop provider in place (no operator config).
119
+ ```
120
+
121
+ Inspect what _would_ be sent:
69
122
 
70
123
  ```bash
71
- npm run test # 46 tests across markers, transaction, patchers, detect, integrations
72
- npm run type-check
124
+ npx @allstak/wizard@beta --telemetry-debug -i react --dry-run
73
125
  ```
74
126
 
75
- Tests use temp-dir fixtures (no network, no SDK install required) and validate idempotency, rollback, dry-run, and uninstall round-trips for all VALIDATED integrations.
127
+ The wizard's payload type is the entire on-the-wire contract. We do **NOT**
128
+ collect:
129
+
130
+ - API keys, DSNs, refresh tokens, OAuth secrets
131
+ - Org names, project names, project ids, org ids
132
+ - File paths (absolute or relative)
133
+ - Env-var values
134
+ - Source code, error message text, stack frames
135
+ - Email addresses, IP addresses, hostnames
136
+
137
+ We do collect: wizard version, command, integration id, stability level,
138
+ OS family + major, Node major, package manager, outcome, stage, canonical
139
+ error code (no message text), `rollbackTriggered` (boolean), `durationMs`.
140
+
141
+ Full contract: [`docs/beta/privacy.md`](./docs/beta/privacy.md).
142
+
143
+ ## Config (`allstak.config.{ts,mjs,js,cjs,json}`)
144
+
145
+ Optional project-level config so you don't repeat `--org`, `--project`,
146
+ `--host`, etc. on every wizard invocation.
147
+
148
+ ```ts
149
+ import { defineConfig } from '@allstak/wizard/config';
150
+
151
+ export default defineConfig({
152
+ schemaVersion: 1,
153
+ organization: 'my-org',
154
+ project: 'my-project',
155
+ environment: 'production',
156
+ release: process.env.GIT_SHA,
157
+ sourceMaps: {
158
+ enabled: true,
159
+ ignore: ['node_modules'],
160
+ },
161
+ selfHosted: {
162
+ apiHost: 'https://api.allstak.example',
163
+ ingestHost: 'https://api.allstak.example',
164
+ dashboardHost: 'https://app.allstak.example',
165
+ },
166
+ });
167
+ ```
168
+
169
+ **Precedence:** `CLI flag > env var > config file > built-in default`.
170
+
171
+ Validate:
172
+
173
+ ```bash
174
+ allstak-wizard config validate
175
+ ```
176
+
177
+ Migrate to a new schema version:
178
+
179
+ ```bash
180
+ allstak-wizard config migrate --dry-run # preview
181
+ allstak-wizard config migrate # rewrites .json in place
182
+ ```
183
+
184
+ Full reference: [`docs/beta/config.md`](./docs/beta/config.md).
185
+
186
+ ## Doctor (deterministic diagnostics)
187
+
188
+ ```bash
189
+ allstak-wizard doctor # offline check
190
+ allstak-wizard doctor --live-probe \ # send + verify a real event
191
+ --api-key ask_live_... --project-id <uuid>
192
+ ```
193
+
194
+ Runs seven named stages in fixed order — `auth → reachability → config →
195
+ integration → event-ingest → release-linkage → source-maps`. Each stage
196
+ reports `pass`/`warn`/`fail`/`skip` with an actionable fix. Live probe POSTs
197
+ to `/ingest/v1/errors`, polls `/api/v1/errors`, and prints the dashboard URL
198
+ of the captured event.
199
+
200
+ Full reference: [`docs/beta/doctor.md`](./docs/beta/doctor.md).
201
+
202
+ ## Restore (persistent snapshots)
203
+
204
+ Every wizard mutation is captured under
205
+ `.allstak-wizard/backups/<id>/manifest.json` plus per-file pre-images.
206
+
207
+ ```bash
208
+ allstak-wizard restore list
209
+ allstak-wizard restore show latest
210
+ allstak-wizard restore diff latest
211
+ allstak-wizard restore apply latest [--files=src/main.tsx]
212
+ ```
213
+
214
+ Full reference: [`docs/beta/restore.md`](./docs/beta/restore.md).
215
+
216
+ ## Error codes
217
+
218
+ 22 canonical error codes — stable across releases (added; never renamed).
219
+ Both human and `--json` output expose `{code, stage, subcode?, message,
220
+ hint}`. Catalog: [`docs/errors.md`](./docs/errors.md).
221
+
222
+ ```bash
223
+ $ allstak-wizard --json -i react -y --skip-deps
224
+ {
225
+ "outcome": "failure",
226
+ "errorCode": "E_AUTH_REQUIRED",
227
+ "data": { "error": {
228
+ "code": "E_AUTH_REQUIRED",
229
+ "stage": "auth",
230
+ "subcode": "E_MISSING_KEY",
231
+ "message": "...",
232
+ "hint": "Pass --api-key or run `allstak login`."
233
+ } }
234
+ }
235
+ ```
236
+
237
+ Exit codes: `0` success, `2` `WizardError`, `130` user cancellation.
238
+
239
+ ## Self-hosted
240
+
241
+ Pass `--host`, `--ingest-host`, `--dashboard-host` directly, or set
242
+ `selfHosted.*` in `allstak.config.*`. The wizard never assumes
243
+ `api.allstak.sa`.
244
+
245
+ **Caveat:** `allstak-java-sdk` currently hardcodes its host. Until that
246
+ SDK ships a configurable `host` field, the wizard's `--host` flag is a
247
+ no-op for `-i java`. Spec for the SDK fix:
248
+ [`docs/architecture/v02-java-host-fix-spec.md`](./docs/architecture/v02-java-host-fix-spec.md).
249
+
250
+ ## Architecture
251
+
252
+ - **Registry** — every integration is an `Integration` object with
253
+ `detect`, `plan`, `install`, `patch`, `validate`, `uninstall`, `repair`,
254
+ `doctor` methods. New integrations register themselves; the CLI is
255
+ integration-agnostic.
256
+ - **Transaction** — every file mutation snapshots before write, syntax-
257
+ validates after write, and rolls back the entire batch on any failure.
258
+ - **Persistent snapshots** — alongside in-memory rollback, every run
259
+ writes a backup under `.allstak-wizard/backups/<id>/` for cross-run
260
+ recovery via `restore`.
261
+ - **Markers** — every injected region wrapped with `>>> allstak-wizard:v1`
262
+ markers. Re-runs replace in place (idempotent). `uninstall` removes the
263
+ block cleanly.
264
+ - **AST patching** — `magicast` (recast under the hood) for JS/TS imports;
265
+ managed-block hints for non-AST patches (Vite plugins, Next config).
266
+ - **Dry-run** — every command supports `--dry-run`; transaction layer
267
+ captures the diff and skips disk writes.
268
+ - **Source-map providers** — pluggable abstraction (`vite`, `webpack`,
269
+ `next`, `metro`); integrations select a provider by id.
270
+ - **Lifecycle hooks** — `beforeInstall`/`afterInstall`/`beforePatch`/
271
+ `afterPatch`/`beforeRollback`/`afterRollback`/`beforeUninstall`/
272
+ `afterUninstall` for telemetry + plugin extensions.
273
+
274
+ Full design docs: [`docs/architecture/`](./docs/architecture/).
275
+
276
+ ## Development from source
277
+
278
+ ```bash
279
+ cd /path/to/sdks/allstak-wizard
280
+ npm install
281
+ npm run type-check # tsc --noEmit (clean)
282
+ npm test # 123 tests, ~3s
283
+ npm run build # emits dist/ with .d.ts + source maps
284
+ npx tsx src/cli.ts --help # run from source
285
+
286
+ # Smoke against a fixture (no network, no SDK install):
287
+ cd fixtures/react-vite
288
+ ALLSTAK_API_KEY=ask_test \
289
+ npx --prefix ../.. tsx ../../src/cli.ts -i react --dry-run -y --skip-deps
290
+ ```
291
+
292
+ ## Testing
293
+
294
+ | Status | Count |
295
+ |--------|-------|
296
+ | Type-check | clean |
297
+ | Unit + integration tests | **123 / 123** passing |
298
+ | Build | clean (.js + .d.ts + source maps) |
299
+
300
+ Tests run on temp-dir fixtures (no network, no real SDK install) and
301
+ validate idempotency, rollback, dry-run, restore round-trip, error catalog
302
+ coverage, telemetry payload contract, and config migration plumbing.
303
+
304
+ ## Roadmap (post-beta)
305
+
306
+ Beta is shipping intentionally narrow. v0.2 priorities:
307
+
308
+ 1. **Bare React Native** — Podfile + Gradle patchers + iOS/Android
309
+ validation matrix. Spec:
310
+ [`docs/architecture/v02-bare-react-native-spec.md`](./docs/architecture/v02-bare-react-native-spec.md).
311
+ 2. **Source-maps end-to-end** — upload + symbolication round-trip against
312
+ `/api/v1/sourcemaps/upload`. Spec:
313
+ [`docs/architecture/v02-sourcemaps-e2e-spec.md`](./docs/architecture/v02-sourcemaps-e2e-spec.md).
314
+ 3. **Astro support** — currently falls through to `js` (env vars only).
315
+ 4. **Java SDK host fix** — coordinate with `allstak-java-sdk` to make
316
+ host configurable.
317
+ 5. **Backend SDK framework wiring** — NestJS `main.ts`, Spring Boot
318
+ `application.yml`, Django/FastAPI/Flask/Rails/.NET/Go/PHP entry-point
319
+ patching with per-framework fixture validation.
320
+ 6. **Telemetry HTTP endpoint** — backend contract pending.
321
+
322
+ ## License
323
+
324
+ Apache-2.0 — see [`LICENSE`](./LICENSE).
76
325
 
77
- ## v0.2 roadmap
326
+ ## Issues
78
327
 
79
- See `docs/reports/allstak-unified-sdk-wizard-v0.1-implementation.md` (in the platform monorepo) for the full plan.
328
+ [github.com/allstak-io/sdks/issues](https://github.com/allstak-io/sdks/issues)
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * TypeScript shapes for the AllStak backend responses the wizard depends on.
3
3
  *
4
- * Source of truth: handler classes in `/Volumes/M.2/MyProjects/allstak/backend/`.
5
- * If a backend response shape changes incompatibly, bump `apiContractVersion`
6
- * and add a guard in src/api/http.ts.
4
+ * Source of truth: AllStak backend (`/api/v1/auth/*`, `/api/v1/projects/*`,
5
+ * `/ingest/v1/*`). If a backend response shape changes incompatibly, bump
6
+ * `apiContractVersion` and add a guard in src/api/http.ts.
7
7
  */
8
8
  export declare const apiContractVersion = "2026-05-07";
9
9
  export interface UserSummary {
package/dist/api/types.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * TypeScript shapes for the AllStak backend responses the wizard depends on.
3
3
  *
4
- * Source of truth: handler classes in `/Volumes/M.2/MyProjects/allstak/backend/`.
5
- * If a backend response shape changes incompatibly, bump `apiContractVersion`
6
- * and add a guard in src/api/http.ts.
4
+ * Source of truth: AllStak backend (`/api/v1/auth/*`, `/api/v1/projects/*`,
5
+ * `/ingest/v1/*`). If a backend response shape changes incompatibly, bump
6
+ * `apiContractVersion` and add a guard in src/api/http.ts.
7
7
  */
8
8
  export const apiContractVersion = '2026-05-07';
9
9
  //# sourceMappingURL=types.js.map
@@ -2,5 +2,5 @@
2
2
  * Single source of truth for the wizard's own version string. Bumping `package.json`
3
3
  * does NOT auto-update this constant — keep them in sync. Tests assert equality.
4
4
  */
5
- export declare const WIZARD_VERSION = "0.1.3";
5
+ export declare const WIZARD_VERSION = "0.1.4";
6
6
  //# sourceMappingURL=wizard-version.d.ts.map
@@ -2,5 +2,5 @@
2
2
  * Single source of truth for the wizard's own version string. Bumping `package.json`
3
3
  * does NOT auto-update this constant — keep them in sync. Tests assert equality.
4
4
  */
5
- export const WIZARD_VERSION = '0.1.3';
5
+ export const WIZARD_VERSION = '0.1.4';
6
6
  //# sourceMappingURL=wizard-version.js.map
@@ -22,14 +22,10 @@ SDK-side blocker."
22
22
 
23
23
  ## Required SDK-side change
24
24
 
25
- Reference the AllStak SDK workspace at:
26
-
27
- ```
28
- /Volumes/M.2/MyProjects/AllStak-Projects/sdks/allstak-java-sdk
29
- ```
30
-
31
- The change is small but needs to land in the SDK before the wizard's `java`
32
- integration can graduate from `experimental`:
25
+ Target package: `allstak-java-sdk` (the Java SDK in the AllStak SDK
26
+ monorepo, sibling of `@allstak/wizard`). The change is small but must land
27
+ in the SDK before the wizard's `java` integration can graduate from
28
+ `experimental`:
33
29
 
34
30
  ### 1. Add a `host` field to `AllStakConfig`
35
31
 
@@ -0,0 +1,17 @@
1
+ # `@allstak/wizard@beta` — public beta docs
2
+
3
+ | Doc | What it covers |
4
+ |-----|----------------|
5
+ | [quickstart](./quickstart.md) | Install + run in five minutes |
6
+ | [react](./react.md) | React (Vite or CRA) integration |
7
+ | [next](./next.md) | Next.js 13+ integration |
8
+ | [node](./node.md) | Vanilla Node.js / TypeScript |
9
+ | [doctor](./doctor.md) | Deterministic diagnostics + `--live-probe` |
10
+ | [restore](./restore.md) | Persistent snapshots + rollback |
11
+ | [config](./config.md) | `allstak.config.*` schema + precedence + migrations |
12
+ | [ci](./ci.md) | Running unattended in CI |
13
+ | [privacy](./privacy.md) | Telemetry contract — what we send and how to disable |
14
+ | [known-limitations](./known-limitations.md) | Honest list of what's NOT supported |
15
+ | [troubleshooting](./troubleshooting.md) | Common errors mapped to fixes |
16
+ | [errors](../errors.md) | Canonical error catalog |
17
+ | [architecture](../architecture/) | Internal design docs (registry, transaction, rollback, etc.) |
@@ -0,0 +1,122 @@
1
+ # Running in CI
2
+
3
+ The wizard is designed to run unattended once you've committed an
4
+ `allstak.config.*` and stashed an API key.
5
+
6
+ ## One-shot setup in a CI step
7
+
8
+ ```yaml
9
+ # .github/workflows/setup-allstak.yml (excerpt)
10
+ - name: Configure AllStak
11
+ env:
12
+ ALLSTAK_API_KEY: ${{ secrets.ALLSTAK_API_KEY }}
13
+ run: |
14
+ npx @allstak/wizard@beta -i react -y \
15
+ --skip-deps \
16
+ --release "$GITHUB_SHA"
17
+ ```
18
+
19
+ Why these flags:
20
+
21
+ - `-y`: skip the confirmation prompt. The wizard refuses with `E_USER_CANCELLED`
22
+ in non-interactive mode otherwise.
23
+ - `--skip-deps`: don't run a package install — your CI step before this
24
+ already installed dependencies.
25
+ - `--release "$GITHUB_SHA"`: stamp the deploy commit on every event.
26
+
27
+ The CLI exits 0 on success, 2 on `WizardError`, and 130 on user cancel
28
+ (impossible in `-y` mode but documented for completeness).
29
+
30
+ ## Doctor in CI (smoke check)
31
+
32
+ ```yaml
33
+ - name: Doctor
34
+ env:
35
+ ALLSTAK_API_KEY: ${{ secrets.ALLSTAK_API_KEY }}
36
+ run: |
37
+ npx @allstak/wizard@beta --json doctor \
38
+ --live-probe \
39
+ --project-id ${{ vars.ALLSTAK_PROJECT_ID }} \
40
+ > doctor.json
41
+ jq -e '.outcome == "success"' doctor.json
42
+ ```
43
+
44
+ `--live-probe` sends a real test event and polls for ingestion. Use it as
45
+ a deploy gate — if the ingestion path is broken, fail the deploy before
46
+ users hit it.
47
+
48
+ ## JSON output everywhere
49
+
50
+ `--json` writes a single JSON object to stdout (status text goes to stderr).
51
+ Pipe it to `jq` or your own parser. Shape:
52
+
53
+ ```json
54
+ {
55
+ "schemaVersion": 1,
56
+ "command": "init",
57
+ "outcome": "success",
58
+ "errorCode": null,
59
+ "durationMs": 4200,
60
+ "events": [...],
61
+ "diff": [...],
62
+ "doctor": [...],
63
+ "data": { ... }
64
+ }
65
+ ```
66
+
67
+ ## Telemetry in CI
68
+
69
+ Telemetry is on by default. To disable:
70
+
71
+ ```bash
72
+ ALLSTAK_WIZARD_TELEMETRY=0 npx @allstak/wizard@beta ...
73
+ # or
74
+ npx @allstak/wizard@beta --no-telemetry ...
75
+ ```
76
+
77
+ See [privacy.md](./privacy.md) for the exact payload shape. Telemetry
78
+ failures NEVER abort the wizard.
79
+
80
+ ## Snapshot retention in CI
81
+
82
+ Each wizard run writes a snapshot to `.allstak-wizard/backups/`. In CI the
83
+ default retention of 10 is usually fine. To disable pruning entirely
84
+ (useful when you keep a separate audit log):
85
+
86
+ ```bash
87
+ npx @allstak/wizard@beta -i react -y --snapshot-keep 0
88
+ ```
89
+
90
+ To skip persistent snapshots entirely (in-process rollback only) — not
91
+ currently supported. Plans for v0.2.
92
+
93
+ ## Self-hosted in CI
94
+
95
+ Either pass flags or commit a config:
96
+
97
+ ```bash
98
+ npx @allstak/wizard@beta \
99
+ --host https://api.allstak.acme.com \
100
+ --dashboard-host https://app.allstak.acme.com \
101
+ -i react -y
102
+ ```
103
+
104
+ ## Validating the wizard itself
105
+
106
+ The wizard ships a CI matrix workflow under `.github/workflows/ci.yml` that
107
+ runs install/repair/uninstall/restore cycles against React+Vite, Next, and
108
+ Node fixtures across Node 18/20/22. Fork the workflow if you want to
109
+ gate your own CI on it.
110
+
111
+ ## Recommended pre-deploy chain
112
+
113
+ ```bash
114
+ npm ci
115
+ npm run test
116
+ npx @allstak/wizard@beta config validate
117
+ npx @allstak/wizard@beta -i react -y --release "$GIT_SHA"
118
+ npx @allstak/wizard@beta --json doctor --live-probe \
119
+ --project-id "$ALLSTAK_PROJECT_ID" \
120
+ --api-key "$ALLSTAK_API_KEY"
121
+ npm run build
122
+ ```