@sentientui/cli 0.2.1 → 0.2.3

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 (2) hide show
  1. package/README.md +36 -0
  2. package/package.json +17 -2
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @sentientui/cli
2
+
3
+ Sets up [SentientUI](https://sentient-ui.com) adaptive UI in an existing React app.
4
+
5
+ ```bash
6
+ npx @sentientui/cli init
7
+ ```
8
+
9
+ ## What `init` does
10
+
11
+ 1. **Detects your framework** (Next.js App/Pages Router, Vite, Remix, CRA) and package manager (pnpm, yarn, bun, npm).
12
+ 2. **Installs `@sentientui/react`** with your package manager.
13
+ 3. **Writes `.env.local`** with the right variable for your framework (`NEXT_PUBLIC_SENTIENT_API_KEY` or `VITE_SENTIENT_API_KEY`). Never clobbers: if the variable is already assigned — even empty — the file is left untouched.
14
+ 4. **Scaffolds `components/adaptive-example.tsx`** (or `src/components/` when your app uses `src/`) — a working style-rung hero using `useAdaptiveTokens`. Skipped if the file already exists.
15
+ 5. **Prints the wrap instructions** for your framework: the `<AdaptiveRoot>` / provider snippet to add to your layout, and what to do next.
16
+
17
+ ## What it does NOT do
18
+
19
+ `init` **never edits your layout or any existing file.** Nothing adapts until you do the wrap-and-mount step it prints — add the provider snippet to your root layout and mount the example component yourself.
20
+
21
+ ## Flags
22
+
23
+ | Flag | Description |
24
+ |------|-------------|
25
+ | `--key pk_...` | Your public API key, written into `.env.local`. Omit it to leave the value empty — the SDK then runs in keyless local mode (decisions simulated on-device, nothing sent), so you can build and style before creating an account. |
26
+ | `--yes` / `-y` | Accepted for npx muscle memory; `init` has no prompts, so this is already the default behavior. |
27
+
28
+ ## After init
29
+
30
+ Run your dev server and preview personas locally with `?sentient_persona=buyer` (or `researcher` / `deal_seeker` / `browser`) — this override works in keyless local mode.
31
+
32
+ Full component and hook reference: the [`@sentientui/react` README](https://www.npmjs.com/package/@sentientui/react).
33
+
34
+ ## License
35
+
36
+ MIT
package/package.json CHANGED
@@ -1,7 +1,22 @@
1
1
  {
2
2
  "name": "@sentientui/cli",
3
- "version": "0.2.1",
4
- "description": "SentientUI CLI — `npx @sentientui/cli init` adds adaptive UI to an existing app in one command",
3
+ "version": "0.2.3",
4
+ "description": "SentientUI CLI — `npx @sentientui/cli init` sets up adaptive UI in an existing React app (installs the SDK, writes env config, scaffolds an example, and prints the wrap instructions)",
5
+ "homepage": "https://sentient-ui.com",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/casancam/SentientUI.git",
9
+ "directory": "packages/cli"
10
+ },
11
+ "keywords": [
12
+ "cli",
13
+ "sentientui",
14
+ "sentient-ui",
15
+ "personalization",
16
+ "react",
17
+ "scaffolding",
18
+ "conversion-optimization"
19
+ ],
5
20
  "type": "module",
6
21
  "bin": {
7
22
  "sentientui": "./dist/index.js"