@algolia/wizard 0.1.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 +69 -0
- package/dist/algolia.png +0 -0
- package/dist/main.js +3597 -0
- package/docs/algolia-sdk/README.md +36 -0
- package/docs/algolia-sdk/instantsearch-setup-angular.md +80 -0
- package/docs/algolia-sdk/instantsearch-setup-js.md +33 -0
- package/docs/algolia-sdk/instantsearch-setup-react.md +39 -0
- package/docs/algolia-sdk/instantsearch-setup-vue.md +41 -0
- package/docs/algolia-sdk/save-records-js.md +39 -0
- package/docs/algolia-sdk/search-single-index.md +42 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @algolia/wizard
|
|
2
|
+
|
|
3
|
+
A composable CLI that implements Algolia functionality directly in your codebase.
|
|
4
|
+
|
|
5
|
+
Wizard runs **workflows** — ordered sequences of steps that inspect your project, talk to Algolia APIs, and make AI-authored changes to your repo.
|
|
6
|
+
|
|
7
|
+
## Install & run
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# run the default workflow
|
|
11
|
+
npx @algolia/wizard
|
|
12
|
+
|
|
13
|
+
# run a specific workflow by id
|
|
14
|
+
npx @algolia/wizard <workflow-id>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
On first run, Wizard checks for an Algolia profile. If none exists it launches `algolia auth login` and writes a default profile.
|
|
18
|
+
|
|
19
|
+
You'll also be asked once to consent to AI-authored changes to the repository.
|
|
20
|
+
|
|
21
|
+
## Development
|
|
22
|
+
|
|
23
|
+
### Requirements
|
|
24
|
+
|
|
25
|
+
- Node 24+
|
|
26
|
+
- PNPM
|
|
27
|
+
|
|
28
|
+
### Development Commands
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm dev # run from source via tsx
|
|
33
|
+
pnpm test # vitest
|
|
34
|
+
pnpm test:tools # run tool evals (tool-evals/); pass a spec name to run one, e.g. pnpm test:tools searchFiles
|
|
35
|
+
pnpm typecheck # tsc --noEmit
|
|
36
|
+
pnpm build # bundle to dist/main.js via esbuild
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Environment
|
|
40
|
+
|
|
41
|
+
Create a `.env` with:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
PROVIDER_API_KEY=... # Algolia AI Enablers inference platform key
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Logging
|
|
48
|
+
|
|
49
|
+
Logging is configured via environment variables (see [src/lib/logger.ts](src/lib/logger.ts)):
|
|
50
|
+
|
|
51
|
+
| Variable | Default | Description |
|
|
52
|
+
| ----------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| `LOG_LEVEL` | `info` | Minimum pino level to emit: `trace`, `debug`, `info`, `warn`, `error`, `fatal`, `silent`. |
|
|
54
|
+
| `WIZARD_LOG`| `~/.algolia/<project-slug>/wizard.log` | Log file destination |
|
|
55
|
+
|
|
56
|
+
## How it works
|
|
57
|
+
|
|
58
|
+
- **Workflows** ([src/workflows/](src/workflows/)) — a `Workflow` is `{ id, title, description, steps[] }`. The registry lives in [src/workflows/index.ts](src/workflows/index.ts); the default is [src/workflows/default.ts](src/workflows/default.ts).
|
|
59
|
+
- **Steps** ([src/core/orchestrator.ts](src/core/orchestrator.ts)) — each step has a Zod `outputSchema` and a `run(ctx)` function. Output is validated and persisted before the next step runs. The `StepContext` exposes prior step outputs, `requestUserInput`, `updateAlgoliaState`, and read-only config.
|
|
60
|
+
- **State & resume** ([src/core/persistence.ts](src/core/persistence.ts), [src/core/config.ts](src/core/config.ts)) — run state and cross-workflow config live under `~/.algolia/<project-slug>/`, never in your repo's working tree. An interrupted workflow resumes from its last incomplete step.
|
|
61
|
+
- **Auth** ([src/lib/algoliaProfile.ts](src/lib/algoliaProfile.ts)) — profiles are read from the Algolia CLI's `config.toml`; the default profile (or first configured) is used as the active one.
|
|
62
|
+
- **AI** ([src/lib/agent.ts](src/lib/agent.ts)) — steps call the agent against the Algolia AI Enablers inference platform.
|
|
63
|
+
- **UI** ([src/ui/](src/ui/)) — Ink/React components for steps, progress, prompts, and the concepts tutorial. State is held in a Zustand store ([src/core/store.ts](src/core/store.ts)).
|
|
64
|
+
|
|
65
|
+
### Adding a workflow
|
|
66
|
+
|
|
67
|
+
1. Define a `Workflow` with `defineStep(...)` calls (see [src/workflows/default.ts](src/workflows/default.ts)).
|
|
68
|
+
2. Register it in [src/workflows/index.ts](src/workflows/index.ts).
|
|
69
|
+
3. Run it: `npx @algolia/wizard <your-workflow-id>`.
|
package/dist/algolia.png
ADDED
|
Binary file
|