agentlink-sh 0.26.1 → 0.30.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 +90 -94
- package/dist/{chunk-DM6KG5YU.js → chunk-KECTTRCF.js} +59 -3
- package/dist/{chunk-4CW46BPC.js → chunk-KRE7FEMO.js} +446 -83
- package/dist/{cloud-ZXVJMV5Q.js → cloud-OZQOOVJO.js} +16 -4
- package/dist/index.js +8255 -2090
- package/dist/{oauth-JGWRORJM.js → oauth-52Q6XDJL.js} +3 -5
- package/package.json +3 -2
- package/dist/chunk-7NV5CYOF.js +0 -1064
- package/dist/chunk-IV5ZSOKF.js +0 -194
- package/dist/chunk-MHI6VJ75.js +0 -27
- package/dist/constants-PWT7TUWD.js +0 -27
- package/dist/db-DNK3TD5Y.js +0 -31
- package/dist/utils-7LT4QSYL.js +0 -27
package/README.md
CHANGED
|
@@ -4,68 +4,64 @@ Teach AI agents the right way to build on Supabase.
|
|
|
4
4
|
|
|
5
5
|
[Agent Link](https://agentlink.sh) is an opinionated skill set for Claude Code — and this CLI is how you start a project with it. One command scaffolds a Supabase backend with schema isolation, RPC-first data access, row-level security, multi-tenancy, and edge functions already wired up — plus a frontend (React + Vite or Next.js) with auth, theming, and shadcn/ui ready to go. Your agent doesn't have to figure out the architecture — it's already there. From that foundation, five domain skills give it one clear path for every decision: how to structure tables, write RLS policies, expose APIs, handle background work, and connect a frontend. No ambiguity, no wrong turns. First-try results.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Run
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm i -g agentlink-sh@latest
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Or run directly with npx (requires Node.js 18+):
|
|
9
|
+
Run directly with `npx` (requires Node.js 18+):
|
|
16
10
|
|
|
17
11
|
```bash
|
|
18
12
|
npx agentlink-sh@latest
|
|
19
13
|
```
|
|
20
14
|
|
|
15
|
+
`npx` always pulls the latest version. There's no global install step — every command below is prefixed with `npx agentlink-sh@latest`.
|
|
16
|
+
|
|
21
17
|
## Quick start
|
|
22
18
|
|
|
23
19
|
```bash
|
|
24
20
|
# Create a new project (cloud by default)
|
|
25
|
-
agentlink my-app
|
|
21
|
+
npx agentlink-sh@latest my-app
|
|
26
22
|
|
|
27
23
|
# With a prompt for Claude Code
|
|
28
|
-
agentlink my-app --prompt "Build a project management tool with kanban boards"
|
|
24
|
+
npx agentlink-sh@latest my-app --prompt "Build a project management tool with kanban boards"
|
|
29
25
|
|
|
30
26
|
# Interactive wizard
|
|
31
|
-
agentlink
|
|
27
|
+
npx agentlink-sh@latest
|
|
32
28
|
```
|
|
33
29
|
|
|
34
30
|
## Commands
|
|
35
31
|
|
|
36
|
-
### `agentlink [name]`
|
|
32
|
+
### `npx agentlink-sh@latest [name]`
|
|
37
33
|
|
|
38
34
|
Interactive wizard that scaffolds a new project or updates an existing one. Uses Supabase Cloud by default — region is auto-detected from your timezone, all recommended skills are installed automatically.
|
|
39
35
|
|
|
40
36
|
```bash
|
|
41
37
|
# Interactive wizard
|
|
42
|
-
agentlink
|
|
38
|
+
npx agentlink-sh@latest
|
|
43
39
|
|
|
44
40
|
# With project name
|
|
45
|
-
agentlink my-app
|
|
41
|
+
npx agentlink-sh@latest my-app
|
|
46
42
|
|
|
47
43
|
# With prompt (passed to Claude Code on launch)
|
|
48
|
-
agentlink my-app --prompt "Build a project management tool"
|
|
44
|
+
npx agentlink-sh@latest my-app --prompt "Build a project management tool"
|
|
49
45
|
|
|
50
46
|
# Local Docker mode (instead of cloud)
|
|
51
|
-
agentlink my-app --local
|
|
47
|
+
npx agentlink-sh@latest my-app --local
|
|
52
48
|
|
|
53
49
|
# NextJS instead of React + Vite
|
|
54
|
-
agentlink my-app --nextjs
|
|
50
|
+
npx agentlink-sh@latest my-app --nextjs
|
|
55
51
|
|
|
56
52
|
# Backend only (no frontend)
|
|
57
|
-
agentlink my-app --no-frontend
|
|
53
|
+
npx agentlink-sh@latest my-app --no-frontend
|
|
58
54
|
|
|
59
55
|
# Skip companion skills
|
|
60
|
-
agentlink my-app --no-skills
|
|
56
|
+
npx agentlink-sh@latest my-app --no-skills
|
|
61
57
|
|
|
62
58
|
# Scaffold files only — no Supabase setup. Run `env add dev` later in a
|
|
63
59
|
# terminal to finish the env. Use when an agent scaffolds without browser
|
|
64
60
|
# access and hands off to the user.
|
|
65
|
-
agentlink my-app --skip-env
|
|
61
|
+
npx agentlink-sh@latest my-app --skip-env
|
|
66
62
|
|
|
67
63
|
# Non-interactive (CI-friendly)
|
|
68
|
-
agentlink my-app --yes --non-interactive --token $SUPABASE_TOKEN --org $ORG_ID --region us-east-1
|
|
64
|
+
npx agentlink-sh@latest my-app --yes --non-interactive --token $SUPABASE_TOKEN --org $ORG_ID --region us-east-1
|
|
69
65
|
```
|
|
70
66
|
|
|
71
67
|
**Options:**
|
|
@@ -89,26 +85,26 @@ agentlink my-app --yes --non-interactive --token $SUPABASE_TOKEN --org $ORG_ID -
|
|
|
89
85
|
| `--non-interactive` | Error instead of prompting when info is missing |
|
|
90
86
|
| `--link` | Link to an existing Supabase project (with `--project-ref` + connection flags) |
|
|
91
87
|
|
|
92
|
-
### `agentlink sb login`
|
|
88
|
+
### `npx agentlink-sh@latest sb login`
|
|
93
89
|
|
|
94
90
|
Authenticate with Supabase via OAuth (opens browser). Tokens are cached per-org in `~/.config/agentlink/credentials.json` and auto-refreshed.
|
|
95
91
|
|
|
96
92
|
```bash
|
|
97
|
-
agentlink sb login
|
|
93
|
+
npx agentlink-sh@latest sb login
|
|
98
94
|
```
|
|
99
95
|
|
|
100
|
-
> The top-level `
|
|
96
|
+
> The top-level `login` / `token` commands still work but print a deprecation warning. The top-level `login` namespace is reserved for future Agent Link accounts.
|
|
101
97
|
|
|
102
|
-
### `agentlink sb token`
|
|
98
|
+
### `npx agentlink-sh@latest sb token`
|
|
103
99
|
|
|
104
100
|
Show or set the Supabase personal access token (PAT) used for non-interactive CI/CD.
|
|
105
101
|
|
|
106
102
|
```bash
|
|
107
|
-
agentlink sb token show # Print the current token and its source
|
|
108
|
-
agentlink sb token set sbp_... # Save a new token
|
|
103
|
+
npx agentlink-sh@latest sb token show # Print the current token and its source
|
|
104
|
+
npx agentlink-sh@latest sb token set sbp_... # Save a new token
|
|
109
105
|
```
|
|
110
106
|
|
|
111
|
-
### `agentlink env`
|
|
107
|
+
### `npx agentlink-sh@latest env`
|
|
112
108
|
|
|
113
109
|
Manage project environments. Agent Link enforces a fixed `local → dev → prod` model — no custom names (`staging`, `dev2`, etc. are rejected).
|
|
114
110
|
|
|
@@ -117,17 +113,17 @@ Manage project environments. Agent Link enforces a fixed `local → dev → prod
|
|
|
117
113
|
Add a cloud environment and (by default) deploy the current schema + functions to it. If `[name]` is omitted, a picker shows `dev` / `prod` with a `— linked to <projectRef>` / `— not linked` hint per row.
|
|
118
114
|
|
|
119
115
|
```bash
|
|
120
|
-
agentlink env add # Interactive picker
|
|
121
|
-
agentlink env add dev # Connect the dev cloud environment
|
|
122
|
-
agentlink env add prod # Connect production. Does NOT touch .env.local.
|
|
123
|
-
agentlink env add dev --no-deploy # Register the env but skip the initial deploy
|
|
124
|
-
agentlink env add dev --setup-ci # Also scaffold a GitHub Actions workflow
|
|
116
|
+
npx agentlink-sh@latest env add # Interactive picker
|
|
117
|
+
npx agentlink-sh@latest env add dev # Connect the dev cloud environment
|
|
118
|
+
npx agentlink-sh@latest env add prod # Connect production. Does NOT touch .env.local.
|
|
119
|
+
npx agentlink-sh@latest env add dev --no-deploy # Register the env but skip the initial deploy
|
|
120
|
+
npx agentlink-sh@latest env add dev --setup-ci # Also scaffold a GitHub Actions workflow
|
|
125
121
|
```
|
|
126
122
|
|
|
127
123
|
If the environment already exists, `env add` prompts with a 3-way menu:
|
|
128
124
|
|
|
129
125
|
```
|
|
130
|
-
If you just changed schemas or functions, cancel and run `agentlink env deploy <name>` instead.
|
|
126
|
+
If you just changed schemas or functions, cancel and run `npx agentlink-sh@latest env deploy <name>` instead.
|
|
131
127
|
|
|
132
128
|
? Environment "dev" already exists. What would you like to do?
|
|
133
129
|
❯ Re-apply full setup — schemas, functions, secrets, PostgREST + auth config
|
|
@@ -142,10 +138,10 @@ If the environment already exists, `env add` prompts with a 3-way menu:
|
|
|
142
138
|
Switch the active environment. Rewrites the managed block in `.env.local` and updates `manifest.cloud.default`. If `[name]` is omitted, a picker lists `dev` / `prod` (and `local` when the project is local-only or already on local) with a ✓ next to the active env.
|
|
143
139
|
|
|
144
140
|
```bash
|
|
145
|
-
agentlink env use # Interactive picker
|
|
146
|
-
agentlink env use dev # Switch to dev
|
|
147
|
-
agentlink env use local # Switch to local Docker
|
|
148
|
-
agentlink env use prod # Switch to prod (requires y/N confirmation)
|
|
141
|
+
npx agentlink-sh@latest env use # Interactive picker
|
|
142
|
+
npx agentlink-sh@latest env use dev # Switch to dev
|
|
143
|
+
npx agentlink-sh@latest env use local # Switch to local Docker
|
|
144
|
+
npx agentlink-sh@latest env use prod # Switch to prod (requires y/N confirmation)
|
|
149
145
|
```
|
|
150
146
|
|
|
151
147
|
`env use prod` prints an amber warning and requires explicit confirmation before writing `.env.local` — any app or test you run locally will hit production data. After confirming, subsequent `env deploy` / `db apply` / `db sql` / `db rebuild` invocations print an `▲ Active env: prod` banner as a reminder.
|
|
@@ -155,11 +151,11 @@ agentlink env use prod # Switch to prod (requires y/N confirmation)
|
|
|
155
151
|
Apply schemas (`db apply`) and deploy edge functions to the chosen env. Idempotent. Does NOT mutate `manifest.cloud.default` — deploy is a one-shot action, so `env use dev && env deploy prod` stays on dev afterwards.
|
|
156
152
|
|
|
157
153
|
```bash
|
|
158
|
-
agentlink env deploy # Interactive picker (preselects cloud.default)
|
|
159
|
-
agentlink env deploy dev # Deploy to dev
|
|
160
|
-
agentlink env deploy prod # Deploy to prod (requires y/N confirmation)
|
|
161
|
-
agentlink env deploy prod --yes # Skip the confirmation (for CI)
|
|
162
|
-
agentlink env deploy dev --dry-run # Print the target without applying
|
|
154
|
+
npx agentlink-sh@latest env deploy # Interactive picker (preselects cloud.default)
|
|
155
|
+
npx agentlink-sh@latest env deploy dev # Deploy to dev
|
|
156
|
+
npx agentlink-sh@latest env deploy prod # Deploy to prod (requires y/N confirmation)
|
|
157
|
+
npx agentlink-sh@latest env deploy prod --yes # Skip the confirmation (for CI)
|
|
158
|
+
npx agentlink-sh@latest env deploy dev --dry-run # Print the target without applying
|
|
163
159
|
```
|
|
164
160
|
|
|
165
161
|
Auth providers / PostgREST config / vault secrets are NOT touched by `env deploy` — those are configured during initial `env add`. If any of those changed, use `env add <name> → Re-apply full setup` instead.
|
|
@@ -171,7 +167,7 @@ Generated CI workflows (`env add --setup-ci`) call `env deploy <name> --yes --no
|
|
|
171
167
|
Show all configured environments with their org, project ref, and which one is currently active.
|
|
172
168
|
|
|
173
169
|
```bash
|
|
174
|
-
agentlink env list
|
|
170
|
+
npx agentlink-sh@latest env list
|
|
175
171
|
```
|
|
176
172
|
|
|
177
173
|
#### `env remove <name>`
|
|
@@ -179,31 +175,31 @@ agentlink env list
|
|
|
179
175
|
Remove an environment from `agentlink.json`. Offers to also wipe the stored DB password for that project.
|
|
180
176
|
|
|
181
177
|
```bash
|
|
182
|
-
agentlink env remove prod
|
|
183
|
-
agentlink env remove prod -y # Skip confirmations
|
|
178
|
+
npx agentlink-sh@latest env remove prod
|
|
179
|
+
npx agentlink-sh@latest env remove prod -y # Skip confirmations
|
|
184
180
|
```
|
|
185
181
|
|
|
186
|
-
> The previous `
|
|
182
|
+
> The previous `env relink <name>` command still works but prints a deprecation warning — use `env add <name>` (with the env already registered) and pick **Relink to a different Supabase project**. The top-level `deploy` command has been removed entirely; use `env deploy` instead.
|
|
187
183
|
|
|
188
|
-
### `agentlink check`
|
|
184
|
+
### `npx agentlink-sh@latest check`
|
|
189
185
|
|
|
190
186
|
Verify project setup. Outputs JSON with diagnostic info: `ready`, `supabase_running`, database state (extensions, queues, functions, secrets, api_schema), and file checks.
|
|
191
187
|
|
|
192
188
|
```bash
|
|
193
|
-
agentlink check
|
|
194
|
-
agentlink check --env prod # Check a specific cloud env
|
|
189
|
+
npx agentlink-sh@latest check
|
|
190
|
+
npx agentlink-sh@latest check --env prod # Check a specific cloud env
|
|
195
191
|
```
|
|
196
192
|
|
|
197
|
-
### `agentlink info [name]`
|
|
193
|
+
### `npx agentlink-sh@latest info [name]`
|
|
198
194
|
|
|
199
195
|
Show documentation about scaffolded components. Without a name, lists all components. With a name, shows type, summary, description, signature, and related components.
|
|
200
196
|
|
|
201
197
|
```bash
|
|
202
|
-
agentlink info # List all components
|
|
203
|
-
agentlink info tenant_select # Detail for one component
|
|
198
|
+
npx agentlink-sh@latest info # List all components
|
|
199
|
+
npx agentlink-sh@latest info tenant_select # Detail for one component
|
|
204
200
|
```
|
|
205
201
|
|
|
206
|
-
### `agentlink db`
|
|
202
|
+
### `npx agentlink-sh@latest db`
|
|
207
203
|
|
|
208
204
|
Database operations. Every subcommand targets the active cloud env (`manifest.cloud.default`) unless `--env <name>` or `--db-url <url>` is passed.
|
|
209
205
|
|
|
@@ -212,10 +208,10 @@ Database operations. Every subcommand targets the active cloud env (`manifest.cl
|
|
|
212
208
|
Apply all schema files in `supabase/schemas/` to the database using pg-delta declarative apply. Generates TypeScript types afterwards unless `--skip-types` is set.
|
|
213
209
|
|
|
214
210
|
```bash
|
|
215
|
-
agentlink db apply
|
|
216
|
-
agentlink db apply --skip-types
|
|
217
|
-
agentlink db apply --env prod
|
|
218
|
-
agentlink db apply --db-url postgresql://...
|
|
211
|
+
npx agentlink-sh@latest db apply
|
|
212
|
+
npx agentlink-sh@latest db apply --skip-types
|
|
213
|
+
npx agentlink-sh@latest db apply --env prod
|
|
214
|
+
npx agentlink-sh@latest db apply --db-url postgresql://...
|
|
219
215
|
```
|
|
220
216
|
|
|
221
217
|
#### `db migrate <name>`
|
|
@@ -223,8 +219,8 @@ agentlink db apply --db-url postgresql://...
|
|
|
223
219
|
Generate a migration file from the diff between the current database state and the schema files. Intended for creating auditable deployment artifacts — `env deploy` does NOT generate migrations.
|
|
224
220
|
|
|
225
221
|
```bash
|
|
226
|
-
agentlink db migrate add_charts_table
|
|
227
|
-
agentlink db migrate add_charts_table --env prod
|
|
222
|
+
npx agentlink-sh@latest db migrate add_charts_table
|
|
223
|
+
npx agentlink-sh@latest db migrate add_charts_table --env prod
|
|
228
224
|
```
|
|
229
225
|
|
|
230
226
|
#### `db sql <query>`
|
|
@@ -232,9 +228,9 @@ agentlink db migrate add_charts_table --env prod
|
|
|
232
228
|
Run ad-hoc SQL against the active database. Uses `psql` locally, Management API for cloud.
|
|
233
229
|
|
|
234
230
|
```bash
|
|
235
|
-
agentlink db sql "SELECT count(*) FROM public.profiles"
|
|
236
|
-
agentlink db sql "SELECT * FROM api.chart_list()" --json
|
|
237
|
-
agentlink db sql "..." --env prod
|
|
231
|
+
npx agentlink-sh@latest db sql "SELECT count(*) FROM public.profiles"
|
|
232
|
+
npx agentlink-sh@latest db sql "SELECT * FROM api.chart_list()" --json
|
|
233
|
+
npx agentlink-sh@latest db sql "..." --env prod
|
|
238
234
|
```
|
|
239
235
|
|
|
240
236
|
#### `db types`
|
|
@@ -242,8 +238,8 @@ agentlink db sql "..." --env prod
|
|
|
242
238
|
Regenerate `src/types/database.ts` (Vite) or `types/database.ts` (Next.js) from the `api` schema.
|
|
243
239
|
|
|
244
240
|
```bash
|
|
245
|
-
agentlink db types
|
|
246
|
-
agentlink db types --output custom/path.ts
|
|
241
|
+
npx agentlink-sh@latest db types
|
|
242
|
+
npx agentlink-sh@latest db types --output custom/path.ts
|
|
247
243
|
```
|
|
248
244
|
|
|
249
245
|
#### `db rebuild`
|
|
@@ -251,7 +247,7 @@ agentlink db types --output custom/path.ts
|
|
|
251
247
|
Nuke `supabase/migrations/*`, re-apply schemas, and regenerate a single baseline migration. Recovery path when migration state gets broken early in a project.
|
|
252
248
|
|
|
253
249
|
```bash
|
|
254
|
-
agentlink db rebuild
|
|
250
|
+
npx agentlink-sh@latest db rebuild
|
|
255
251
|
```
|
|
256
252
|
|
|
257
253
|
#### `db url [--fix]`
|
|
@@ -259,8 +255,8 @@ agentlink db rebuild
|
|
|
259
255
|
Show the correct pooler DB URL for the active cloud env. `--fix` updates `.env.local` if the current value is stale.
|
|
260
256
|
|
|
261
257
|
```bash
|
|
262
|
-
agentlink db url
|
|
263
|
-
agentlink db url --fix
|
|
258
|
+
npx agentlink-sh@latest db url
|
|
259
|
+
npx agentlink-sh@latest db url --fix
|
|
264
260
|
```
|
|
265
261
|
|
|
266
262
|
#### `db password [value]`
|
|
@@ -268,8 +264,8 @@ agentlink db url --fix
|
|
|
268
264
|
Show or set the stored DB password for the active cloud env's project.
|
|
269
265
|
|
|
270
266
|
```bash
|
|
271
|
-
agentlink db password # Prompt (masked) + save
|
|
272
|
-
agentlink db password "new-password" # Set directly
|
|
267
|
+
npx agentlink-sh@latest db password # Prompt (masked) + save
|
|
268
|
+
npx agentlink-sh@latest db password "new-password" # Set directly
|
|
273
269
|
```
|
|
274
270
|
|
|
275
271
|
#### `db backup`
|
|
@@ -279,14 +275,14 @@ Snapshot the current env's database into three SQL files following Supabase's re
|
|
|
279
275
|
On first run, `supabase/backups/` is appended to the project's root `.gitignore` under an "Agent Link — database backups" comment. Idempotent on re-runs. Snapshots may contain real production data, so they're gitignored by default.
|
|
280
276
|
|
|
281
277
|
```bash
|
|
282
|
-
agentlink db backup # Active env (cloud.default, or local if none)
|
|
283
|
-
agentlink db backup --env prod # Target prod explicitly (shows ▲ Active env: prod if active)
|
|
284
|
-
agentlink db backup --db-url "postgresql://..." # Override URL entirely
|
|
278
|
+
npx agentlink-sh@latest db backup # Active env (cloud.default, or local if none)
|
|
279
|
+
npx agentlink-sh@latest db backup --env prod # Target prod explicitly (shows ▲ Active env: prod if active)
|
|
280
|
+
npx agentlink-sh@latest db backup --db-url "postgresql://..." # Override URL entirely
|
|
285
281
|
```
|
|
286
282
|
|
|
287
283
|
Works on cloud envs, local Docker, and bare projects — doesn't require `supabase/schemas/` or any scaffolded files, just a reachable DB. Read-only; no cloud mutation.
|
|
288
284
|
|
|
289
|
-
### `agentlink env config [subcommand] [env-name]`
|
|
285
|
+
### `npx agentlink-sh@latest env config [subcommand] [env-name]`
|
|
290
286
|
|
|
291
287
|
Apply one or more server-side config sections to a cloud env. The three subsystems are **independent** — run just the one that drifted, or `all` for a full re-apply. Same primitives used by `env add`'s initial bootstrap, so there's no config drift between first-time setup and re-applies.
|
|
292
288
|
|
|
@@ -300,27 +296,27 @@ Apply one or more server-side config sections to a cloud env. The three subsyste
|
|
|
300
296
|
Both positionals are optional — omit either (or both) for an interactive picker:
|
|
301
297
|
|
|
302
298
|
```bash
|
|
303
|
-
agentlink env config # Pick subcommand + env interactively
|
|
304
|
-
agentlink env config secrets # Secrets; env picker
|
|
305
|
-
agentlink env config prod # Env=prod; subcommand picker
|
|
306
|
-
agentlink env config secrets prod # Both specified
|
|
307
|
-
agentlink env config auth prod # Just auth, against prod (confirms)
|
|
308
|
-
agentlink env config all dev --yes # Full re-apply to dev, no prompts
|
|
309
|
-
agentlink env config secrets --env prod # --env flag accepted for CI scripts
|
|
299
|
+
npx agentlink-sh@latest env config # Pick subcommand + env interactively
|
|
300
|
+
npx agentlink-sh@latest env config secrets # Secrets; env picker
|
|
301
|
+
npx agentlink-sh@latest env config prod # Env=prod; subcommand picker
|
|
302
|
+
npx agentlink-sh@latest env config secrets prod # Both specified
|
|
303
|
+
npx agentlink-sh@latest env config auth prod # Just auth, against prod (confirms)
|
|
304
|
+
npx agentlink-sh@latest env config all dev --yes # Full re-apply to dev, no prompts
|
|
305
|
+
npx agentlink-sh@latest env config secrets --env prod # --env flag accepted for CI scripts
|
|
310
306
|
```
|
|
311
307
|
|
|
312
308
|
Idempotent. Works on bare projects (no `supabase/schemas` required). Cloud-only — `env config all local` is rejected.
|
|
313
309
|
|
|
314
|
-
### `agentlink frontend <name>`
|
|
310
|
+
### `npx agentlink-sh@latest frontend <name>`
|
|
315
311
|
|
|
316
312
|
Scaffold only the frontend template (no Supabase setup).
|
|
317
313
|
|
|
318
314
|
```bash
|
|
319
|
-
agentlink frontend my-app # React + Vite
|
|
320
|
-
agentlink frontend my-app --nextjs # NextJS
|
|
315
|
+
npx agentlink-sh@latest frontend my-app # React + Vite
|
|
316
|
+
npx agentlink-sh@latest frontend my-app --nextjs # NextJS
|
|
321
317
|
```
|
|
322
318
|
|
|
323
|
-
> `
|
|
319
|
+
> `frontend` replaces the previous `template` command, which still works but prints a deprecation warning.
|
|
324
320
|
|
|
325
321
|
## Typical workflows
|
|
326
322
|
|
|
@@ -328,44 +324,44 @@ agentlink frontend my-app --nextjs # NextJS
|
|
|
328
324
|
|
|
329
325
|
```bash
|
|
330
326
|
# 1. Scaffold a cloud dev project
|
|
331
|
-
agentlink my-app --prompt "build a project tracker"
|
|
327
|
+
npx agentlink-sh@latest my-app --prompt "build a project tracker"
|
|
332
328
|
|
|
333
329
|
# 2. Agent builds — you iterate locally, `db apply` runs against dev.
|
|
334
330
|
|
|
335
331
|
# 3. Connect prod (creates a separate Supabase project)
|
|
336
332
|
cd my-app
|
|
337
|
-
agentlink env add prod
|
|
333
|
+
npx agentlink-sh@latest env add prod
|
|
338
334
|
|
|
339
335
|
# 4. Deploy
|
|
340
|
-
agentlink env deploy prod # Prompts y/N; deploys schemas + functions
|
|
336
|
+
npx agentlink-sh@latest env deploy prod # Prompts y/N; deploys schemas + functions
|
|
341
337
|
```
|
|
342
338
|
|
|
343
339
|
### Agent-driven scaffold, user finishes in terminal
|
|
344
340
|
|
|
345
341
|
```bash
|
|
346
342
|
# 1. Agent (no browser access) scaffolds only — no Supabase touched
|
|
347
|
-
agentlink my-app --skip-env --prompt "..."
|
|
343
|
+
npx agentlink-sh@latest my-app --skip-env --prompt "..."
|
|
348
344
|
|
|
349
345
|
# 2. User, in their terminal:
|
|
350
346
|
cd my-app
|
|
351
|
-
agentlink env add dev # OAuth opens browser, env is ready
|
|
347
|
+
npx agentlink-sh@latest env add dev # OAuth opens browser, env is ready
|
|
352
348
|
|
|
353
349
|
# 3. Continue with the agent — schemas are ready to apply.
|
|
354
|
-
agentlink db apply
|
|
350
|
+
npx agentlink-sh@latest db apply
|
|
355
351
|
```
|
|
356
352
|
|
|
357
353
|
### Hotfix on prod
|
|
358
354
|
|
|
359
355
|
```bash
|
|
360
356
|
# Edit supabase/schemas/*.sql locally
|
|
361
|
-
agentlink env deploy prod # Pushes just the delta + functions
|
|
357
|
+
npx agentlink-sh@latest env deploy prod # Pushes just the delta + functions
|
|
362
358
|
```
|
|
363
359
|
|
|
364
360
|
### Rebuild migration history early in a project
|
|
365
361
|
|
|
366
362
|
```bash
|
|
367
363
|
# Dev DB is messy, migration files are inconsistent
|
|
368
|
-
agentlink db rebuild # Wipes migrations, re-applies schemas, creates one baseline
|
|
364
|
+
npx agentlink-sh@latest db rebuild # Wipes migrations, re-applies schemas, creates one baseline
|
|
369
365
|
```
|
|
370
366
|
|
|
371
367
|
## What it does
|
|
@@ -386,7 +382,7 @@ The scaffold runs a multi-step process:
|
|
|
386
382
|
12. **Install plugin** — Installs Agent Link plugin and companion skills
|
|
387
383
|
13. **Finalize** — Creates git repo, writes `agentlink.json` manifest
|
|
388
384
|
|
|
389
|
-
Running `agentlink` inside an existing project (with `agentlink.json`) triggers the **update** flow instead, which patches template files, updates the plugin, applies schema changes, and regenerates migrations.
|
|
385
|
+
Running `npx agentlink-sh@latest` inside an existing project (with `agentlink.json`) triggers the **update** flow instead, which patches template files, updates the plugin, applies schema changes, and regenerates migrations.
|
|
390
386
|
|
|
391
387
|
## Modes
|
|
392
388
|
|
|
@@ -40,6 +40,17 @@ var SUPPORTED_PGDELTA = pgdeltaPkg.version;
|
|
|
40
40
|
function pgdeltaBin() {
|
|
41
41
|
return path.join(pgdeltaDir(), "dist", "cli", "bin", "cli.js");
|
|
42
42
|
}
|
|
43
|
+
var PINNED_PNPM_VERSION = "10.34.1";
|
|
44
|
+
var PACKAGE_MANAGER_FIELD = `pnpm@${PINNED_PNPM_VERSION}`;
|
|
45
|
+
var PNPM_INSTALL_CMD = "corepack pnpm install";
|
|
46
|
+
var COREPACK_ENV = {
|
|
47
|
+
COREPACK_ENABLE_DOWNLOAD_PROMPT: "0"
|
|
48
|
+
};
|
|
49
|
+
var ONLY_BUILT_DEPENDENCIES = [
|
|
50
|
+
"@tailwindcss/oxide",
|
|
51
|
+
"esbuild",
|
|
52
|
+
"supabase"
|
|
53
|
+
];
|
|
43
54
|
function pgd() {
|
|
44
55
|
return `${JSON.stringify(process.execPath)} ${JSON.stringify(pgdeltaBin())}`;
|
|
45
56
|
}
|
|
@@ -48,11 +59,14 @@ var POSTGREST_CONFIG = {
|
|
|
48
59
|
db_extra_search_path: "public, extensions",
|
|
49
60
|
max_rows: 1e3
|
|
50
61
|
};
|
|
62
|
+
var AUTH_RATE_LIMIT_EMAIL_SENT = 1e3;
|
|
51
63
|
var AUTH_CONFIG = {
|
|
52
64
|
hook_send_email_enabled: true,
|
|
53
65
|
hook_send_email_uri: "pg-functions://postgres/public/_hook_send_email",
|
|
54
66
|
hook_before_user_created_enabled: true,
|
|
55
67
|
hook_before_user_created_uri: "pg-functions://postgres/public/_hook_before_user_created",
|
|
68
|
+
hook_custom_access_token_enabled: true,
|
|
69
|
+
hook_custom_access_token_uri: "pg-functions://postgres/public/_hook_custom_access_token",
|
|
56
70
|
external_email_enabled: true,
|
|
57
71
|
enable_signup: true,
|
|
58
72
|
jwt_exp: 3600,
|
|
@@ -60,11 +74,42 @@ var AUTH_CONFIG = {
|
|
|
60
74
|
security_refresh_token_reuse_interval: 10,
|
|
61
75
|
external_anonymous_users_enabled: false,
|
|
62
76
|
password_min_length: 8,
|
|
63
|
-
mailer_autoconfirm: false
|
|
77
|
+
mailer_autoconfirm: false,
|
|
78
|
+
// 8-digit email OTP — kept in sync with config.toml's auth.email.otp_length
|
|
79
|
+
// so the verify-OTP flow is identical on local and deployed environments.
|
|
80
|
+
mailer_otp_length: 8,
|
|
81
|
+
// Lifted alongside `hook_send_email_enabled: true` above — once the send
|
|
82
|
+
// hook is on, auth emails go through our edge function (Resend), not
|
|
83
|
+
// Supabase's tiny built-in test pool. Leaving Supabase's stock 2/hour
|
|
84
|
+
// default in place would silently throttle real signup load even though
|
|
85
|
+
// the underlying provider can handle thousands. See the constant's
|
|
86
|
+
// docblock for the choice of 1000 and the dashboard-override caveat.
|
|
87
|
+
rate_limit_email_sent: AUTH_RATE_LIMIT_EMAIL_SENT
|
|
64
88
|
};
|
|
65
89
|
var AUTH_CONFIG_DEV_OVERRIDES = {
|
|
66
90
|
mailer_autoconfirm: true
|
|
67
91
|
};
|
|
92
|
+
var RESEND_SMTP = {
|
|
93
|
+
host: "smtp.resend.com",
|
|
94
|
+
port: "465",
|
|
95
|
+
user: "resend"
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// src/theme.ts
|
|
99
|
+
var rgb = (r, g, b) => (s) => `\x1B[38;2;${r};${g};${b}m${s}\x1B[0m`;
|
|
100
|
+
var blue = rgb(92, 184, 228);
|
|
101
|
+
var amber = rgb(232, 168, 56);
|
|
102
|
+
var red = rgb(239, 68, 68);
|
|
103
|
+
var dim = (s) => `\x1B[2m${s}\x1B[0m`;
|
|
104
|
+
var bold = (s) => `\x1B[1m${s}\x1B[0m`;
|
|
105
|
+
var link = (url, label) => `\x1B]8;;${url}\x07${label ?? url}\x1B]8;;\x07`;
|
|
106
|
+
function deprecated(oldCmd, newCmd) {
|
|
107
|
+
console.error(
|
|
108
|
+
amber(
|
|
109
|
+
`Warning: \`${oldCmd}\` is deprecated and will be removed in the next major version. Use \`${newCmd}\` instead.`
|
|
110
|
+
)
|
|
111
|
+
);
|
|
112
|
+
}
|
|
68
113
|
|
|
69
114
|
export {
|
|
70
115
|
SUPPORTED_SUPABASE_CLI,
|
|
@@ -72,10 +117,21 @@ export {
|
|
|
72
117
|
OAUTH_CLIENT_SECRET,
|
|
73
118
|
supabaseBin,
|
|
74
119
|
sb,
|
|
75
|
-
SUPPORTED_PGDELTA,
|
|
76
120
|
pgdeltaBin,
|
|
121
|
+
PACKAGE_MANAGER_FIELD,
|
|
122
|
+
PNPM_INSTALL_CMD,
|
|
123
|
+
COREPACK_ENV,
|
|
124
|
+
ONLY_BUILT_DEPENDENCIES,
|
|
77
125
|
pgd,
|
|
78
126
|
POSTGREST_CONFIG,
|
|
79
127
|
AUTH_CONFIG,
|
|
80
|
-
AUTH_CONFIG_DEV_OVERRIDES
|
|
128
|
+
AUTH_CONFIG_DEV_OVERRIDES,
|
|
129
|
+
RESEND_SMTP,
|
|
130
|
+
blue,
|
|
131
|
+
amber,
|
|
132
|
+
red,
|
|
133
|
+
dim,
|
|
134
|
+
bold,
|
|
135
|
+
link,
|
|
136
|
+
deprecated
|
|
81
137
|
};
|