@usesidekick/cli 0.1.6 → 0.2.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 +56 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,15 +10,41 @@ npx @usesidekick/cli init
|
|
|
10
10
|
|
|
11
11
|
This single command will:
|
|
12
12
|
|
|
13
|
-
1. Install `@usesidekick/react
|
|
13
|
+
1. Install `@usesidekick/react` and build plugins
|
|
14
14
|
2. Configure `.babelrc` with the Sidekick JSX runtime
|
|
15
15
|
3. Add webpack aliases to `next.config.js`
|
|
16
|
-
4. Create a
|
|
17
|
-
5.
|
|
18
|
-
6.
|
|
19
|
-
7. Analyze your components and generate `schema.json`
|
|
16
|
+
4. Create a catch-all API route (`api/sidekick/[...action]/`) with JSON file storage
|
|
17
|
+
5. Add `SidekickBootstrap` to your app layout
|
|
18
|
+
6. Analyze your components and generate `schema.json`
|
|
20
19
|
|
|
21
|
-
After init,
|
|
20
|
+
After init, add your API key and start developing:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# .env.local
|
|
24
|
+
ANTHROPIC_API_KEY=your_api_key
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Overrides are stored locally in `.sidekick/overrides.json` — no database setup required.
|
|
32
|
+
|
|
33
|
+
### Using Postgres Instead
|
|
34
|
+
|
|
35
|
+
For production deployments (e.g. Vercel) where the filesystem is read-only, use the `--postgres` flag to set up Drizzle + Neon:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @usesidekick/cli init --postgres
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This will additionally:
|
|
42
|
+
- Install `drizzle-orm`, `@neondatabase/serverless`, and `drizzle-kit`
|
|
43
|
+
- Create a database schema and connection (`lib/db/`)
|
|
44
|
+
- Create `drizzle.config.ts`
|
|
45
|
+
- Generate an API route using `createDrizzleStorage`
|
|
46
|
+
|
|
47
|
+
After init with `--postgres`:
|
|
22
48
|
|
|
23
49
|
```bash
|
|
24
50
|
# .env.local
|
|
@@ -44,6 +70,7 @@ sidekick init [options]
|
|
|
44
70
|
| Option | Default | Description |
|
|
45
71
|
|--------|---------|-------------|
|
|
46
72
|
| `-d, --dir <path>` | `.` | Target project directory |
|
|
73
|
+
| `--postgres` | `false` | Use Drizzle + Neon Postgres instead of JSON file storage |
|
|
47
74
|
|
|
48
75
|
**Detects automatically:** package manager (npm/yarn/pnpm), Next.js version, TypeScript, `src/app` vs `app` directory structure. Skips already-installed dependencies and already-configured files. Creates backups before modifying existing configs.
|
|
49
76
|
|
|
@@ -98,6 +125,26 @@ Checks for:
|
|
|
98
125
|
|
|
99
126
|
## What `init` Creates
|
|
100
127
|
|
|
128
|
+
### Default (JSON file storage)
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
your-app/
|
|
132
|
+
.babelrc # JSX runtime config
|
|
133
|
+
next.config.js # Webpack aliases (modified)
|
|
134
|
+
src/
|
|
135
|
+
components/
|
|
136
|
+
SidekickBootstrap.tsx # Provider + Panel wrapper
|
|
137
|
+
app/
|
|
138
|
+
layout.tsx # Modified to include SidekickBootstrap
|
|
139
|
+
api/sidekick/[...action]/
|
|
140
|
+
route.ts # Handler with JSON file storage
|
|
141
|
+
.sidekick/
|
|
142
|
+
schema.json # App analysis output
|
|
143
|
+
overrides.json # Override data (auto-created on first request)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### With `--postgres`
|
|
147
|
+
|
|
101
148
|
```
|
|
102
149
|
your-app/
|
|
103
150
|
.babelrc # JSX runtime config
|
|
@@ -112,18 +159,17 @@ your-app/
|
|
|
112
159
|
app/
|
|
113
160
|
layout.tsx # Modified to include SidekickBootstrap
|
|
114
161
|
api/sidekick/[...action]/
|
|
115
|
-
route.ts #
|
|
116
|
-
sidekick/
|
|
162
|
+
route.ts # Handler with Drizzle storage
|
|
163
|
+
.sidekick/
|
|
117
164
|
schema.json # App analysis output
|
|
118
|
-
overrides/ # Generated override modules
|
|
119
165
|
```
|
|
120
166
|
|
|
121
167
|
## Requirements
|
|
122
168
|
|
|
123
169
|
- **Next.js 14+** with App Router
|
|
124
170
|
- **Node.js 18+**
|
|
125
|
-
- **Neon** (or any PostgreSQL) for the overrides database
|
|
126
171
|
- **Anthropic API key** for AI generation
|
|
172
|
+
- **Neon** (or any PostgreSQL) only when using `--postgres`
|
|
127
173
|
|
|
128
174
|
## License
|
|
129
175
|
|