@agentlink.sh/cli 0.10.0 → 0.10.1
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 +4 -4
- package/dist/index.js +81 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
-
## Install
|
|
7
|
+
## Install & Run
|
|
8
8
|
|
|
9
9
|
### macOS
|
|
10
10
|
|
|
@@ -24,16 +24,16 @@ wget -qO- https://agentlink.sh/install | sh
|
|
|
24
24
|
irm https://agentlink.sh/install.ps1 | iex
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### npx (any platform with Node.js 18+)
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
30
|
+
npx @agentlink.sh/cli@latest
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
Or run directly with npx (requires Node.js 18+):
|
|
34
34
|
|
|
35
35
|
```bash
|
|
36
|
-
npx @
|
|
36
|
+
npx @agentlink.sh/cli@latest
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
The install scripts automatically detect your OS, install Node.js if needed, and set up the CLI globally.
|
package/dist/index.js
CHANGED
|
@@ -1671,7 +1671,7 @@ async function dbApply(options) {
|
|
|
1671
1671
|
console.warn(`Warning: type generation failed \u2014 ${err.message}`);
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
|
-
console.log("\nDone. Run 'npx @
|
|
1674
|
+
console.log("\nDone. Run 'npx @agentlink.sh/cli check' to verify.");
|
|
1675
1675
|
}
|
|
1676
1676
|
async function dbMigrate(name, options) {
|
|
1677
1677
|
const dbUrl = await resolveDbUrl(options.cwd, options.dbUrl);
|
|
@@ -1928,7 +1928,7 @@ async function resolveEnvironments(cwd, opts) {
|
|
|
1928
1928
|
if (!manifest.cloud?.environments?.[targetName]) {
|
|
1929
1929
|
throw new Error(
|
|
1930
1930
|
`Target environment "${targetName}" not found.
|
|
1931
|
-
Run: npx @
|
|
1931
|
+
Run: npx @agentlink.sh/cli@latest env add ${targetName}`
|
|
1932
1932
|
);
|
|
1933
1933
|
}
|
|
1934
1934
|
await ensureAccessToken(opts.ci, cwd);
|
|
@@ -2138,16 +2138,16 @@ This is a **cloud** Supabase project.
|
|
|
2138
2138
|
|
|
2139
2139
|
| Task | Command |
|
|
2140
2140
|
|------|---------|
|
|
2141
|
-
| Apply schemas | \`npx @
|
|
2142
|
-
| Generate migration | \`npx @
|
|
2141
|
+
| Apply schemas | \`npx @agentlink.sh/cli@latest db apply\` |
|
|
2142
|
+
| Generate migration | \`npx @agentlink.sh/cli@latest db migrate name\` then \`supabase db push\` |
|
|
2143
2143
|
| Push migrations | \`supabase db push\` |
|
|
2144
|
-
| Generate types | \`npx @
|
|
2145
|
-
| Run SQL | \`npx @
|
|
2144
|
+
| Generate types | \`npx @agentlink.sh/cli@latest db types\` |
|
|
2145
|
+
| Run SQL | \`npx @agentlink.sh/cli@latest db sql "SELECT ..."\` |
|
|
2146
2146
|
| Deploy edge functions | \`supabase functions deploy\` |
|
|
2147
2147
|
| Set secrets | \`supabase secrets set KEY=value\` |
|
|
2148
|
-
| Deploy to production | \`npx @
|
|
2149
|
-
| Switch environment | \`npx @
|
|
2150
|
-
| List environments | \`npx @
|
|
2148
|
+
| Deploy to production | \`npx @agentlink.sh/cli@latest deploy\` |
|
|
2149
|
+
| Switch environment | \`npx @agentlink.sh/cli@latest env use <name>\` |
|
|
2150
|
+
| List environments | \`npx @agentlink.sh/cli@latest env list\` |
|
|
2151
2151
|
|
|
2152
2152
|
## Important
|
|
2153
2153
|
|
|
@@ -2169,14 +2169,14 @@ This is a **local** Supabase project running in Docker.
|
|
|
2169
2169
|
| Task | Command |
|
|
2170
2170
|
|------|---------|
|
|
2171
2171
|
| Start Supabase | \`supabase start\` |
|
|
2172
|
-
| Apply schemas | \`npx @
|
|
2173
|
-
| Generate migration | \`npx @
|
|
2174
|
-
| Generate types | \`npx @
|
|
2175
|
-
| Run SQL | \`npx @
|
|
2172
|
+
| Apply schemas | \`npx @agentlink.sh/cli@latest db apply\` |
|
|
2173
|
+
| Generate migration | \`npx @agentlink.sh/cli@latest db migrate name\` |
|
|
2174
|
+
| Generate types | \`npx @agentlink.sh/cli@latest db types\` |
|
|
2175
|
+
| Run SQL | \`npx @agentlink.sh/cli@latest db sql "SELECT ..."\` |
|
|
2176
2176
|
| Serve edge functions | \`supabase functions serve\` |
|
|
2177
|
-
| Deploy to production | \`npx @
|
|
2178
|
-
| Switch environment | \`npx @
|
|
2179
|
-
| List environments | \`npx @
|
|
2177
|
+
| Deploy to production | \`npx @agentlink.sh/cli@latest deploy\` |
|
|
2178
|
+
| Switch environment | \`npx @agentlink.sh/cli@latest env use <name>\` |
|
|
2179
|
+
| List environments | \`npx @agentlink.sh/cli@latest env list\` |
|
|
2180
2180
|
|
|
2181
2181
|
## Finding connection details
|
|
2182
2182
|
|
|
@@ -2315,7 +2315,7 @@ async function envAdd(name, cwd, opts = {}) {
|
|
|
2315
2315
|
console.log(`
|
|
2316
2316
|
${blue("Done.")} Environment "${name}" is ready.`);
|
|
2317
2317
|
if (!name.startsWith("dev") && name !== "staging" && name !== "local") {
|
|
2318
|
-
console.log(` Deploy with: ${dim("npx @
|
|
2318
|
+
console.log(` Deploy with: ${dim("npx @agentlink.sh/cli@latest deploy --env " + name)}`);
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
2321
|
async function promptForPassword(nonInteractive) {
|
|
@@ -2541,7 +2541,7 @@ jobs:
|
|
|
2541
2541
|
- run: npm ci
|
|
2542
2542
|
|
|
2543
2543
|
- name: Deploy to ${envName}
|
|
2544
|
-
run: npx @
|
|
2544
|
+
run: npx @agentlink.sh/cli@latest deploy --ci --env ${envName}
|
|
2545
2545
|
env:
|
|
2546
2546
|
SUPABASE_ACCESS_TOKEN: \${{ secrets.SUPABASE_ACCESS_TOKEN }}
|
|
2547
2547
|
SUPABASE_DB_PASSWORD: \${{ secrets.SUPABASE_DB_PASSWORD }}
|
|
@@ -4286,6 +4286,60 @@ ${red("Error:")} Supabase is not running.
|
|
|
4286
4286
|
// src/wizard.ts
|
|
4287
4287
|
var __dirname2 = path15.dirname(fileURLToPath2(import.meta.url));
|
|
4288
4288
|
var pkg2 = JSON.parse(fs15.readFileSync(path15.join(__dirname2, "..", "package.json"), "utf-8"));
|
|
4289
|
+
async function checkForCliUpdate(autoYes) {
|
|
4290
|
+
try {
|
|
4291
|
+
const latest = execSync(`npm view @agentlink.sh/cli version 2>/dev/null`, { encoding: "utf-8" }).trim();
|
|
4292
|
+
if (!latest || latest === pkg2.version) return;
|
|
4293
|
+
const current = pkg2.version.split(".").map(Number);
|
|
4294
|
+
const remote = latest.split(".").map(Number);
|
|
4295
|
+
const isNewer = remote[0] > current[0] || remote[0] === current[0] && remote[1] > current[1] || remote[0] === current[0] && remote[1] === current[1] && remote[2] > current[2];
|
|
4296
|
+
if (!isNewer) return;
|
|
4297
|
+
console.log(` ${amber("\u25B2")} New version available: ${dim(pkg2.version)} \u2192 ${bold(latest)}`);
|
|
4298
|
+
const shouldUpdate = autoYes || await confirm5({
|
|
4299
|
+
message: "Update now?",
|
|
4300
|
+
default: true,
|
|
4301
|
+
theme: theme5
|
|
4302
|
+
});
|
|
4303
|
+
if (!shouldUpdate) {
|
|
4304
|
+
console.log();
|
|
4305
|
+
return;
|
|
4306
|
+
}
|
|
4307
|
+
console.log(` ${blue("\u25CF")} Updating...`);
|
|
4308
|
+
execSync("npm install -g @agentlink.sh/cli@latest", { stdio: "ignore" });
|
|
4309
|
+
console.log(` ${blue("\u2714")} Updated to v${latest}`);
|
|
4310
|
+
console.log();
|
|
4311
|
+
const args = process.argv.slice(2).map((a) => JSON.stringify(a)).join(" ");
|
|
4312
|
+
execSync(`agentlink ${args}`, { stdio: "inherit", cwd: process.cwd() });
|
|
4313
|
+
process.exit(0);
|
|
4314
|
+
} catch {
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
async function checkForPluginUpdate(autoYes) {
|
|
4318
|
+
try {
|
|
4319
|
+
const listOutput = execSync("claude plugin list --json 2>/dev/null", { encoding: "utf-8" });
|
|
4320
|
+
const plugins = JSON.parse(listOutput);
|
|
4321
|
+
const installed = plugins.find((p) => p.id === "link@agentlink");
|
|
4322
|
+
if (!installed) return;
|
|
4323
|
+
const availableOutput = execSync("claude plugin list --json --available 2>/dev/null", { encoding: "utf-8" });
|
|
4324
|
+
const available = JSON.parse(availableOutput);
|
|
4325
|
+
const latest = available.find((p) => p.id === "link@agentlink");
|
|
4326
|
+
if (!latest || latest.version === installed.version) return;
|
|
4327
|
+
console.log(` ${amber("\u25B2")} Plugin update available: ${dim(installed.version)} \u2192 ${bold(latest.version)}`);
|
|
4328
|
+
const shouldUpdate = autoYes || await confirm5({
|
|
4329
|
+
message: "Update Agent Link plugin?",
|
|
4330
|
+
default: true,
|
|
4331
|
+
theme: theme5
|
|
4332
|
+
});
|
|
4333
|
+
if (!shouldUpdate) {
|
|
4334
|
+
console.log();
|
|
4335
|
+
return;
|
|
4336
|
+
}
|
|
4337
|
+
execSync(`claude plugin update link@agentlink --scope ${installed.scope}`, { stdio: "ignore" });
|
|
4338
|
+
console.log(` ${blue("\u2714")} Plugin updated to v${latest.version}`);
|
|
4339
|
+
console.log();
|
|
4340
|
+
} catch {
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4289
4343
|
var theme5 = {
|
|
4290
4344
|
prefix: { idle: blue("?"), done: blue("\u2714") },
|
|
4291
4345
|
style: {
|
|
@@ -4404,6 +4458,10 @@ async function wizard(initialName, initialPrompt, opts = {}) {
|
|
|
4404
4458
|
printBanner();
|
|
4405
4459
|
console.log(dim(` v${pkg2.version}`));
|
|
4406
4460
|
console.log();
|
|
4461
|
+
if (!nonInteractive) {
|
|
4462
|
+
await checkForCliUpdate(autoYes);
|
|
4463
|
+
await checkForPluginUpdate(autoYes);
|
|
4464
|
+
}
|
|
4407
4465
|
if (!opts.resume) {
|
|
4408
4466
|
let sessions;
|
|
4409
4467
|
if (initialName && initialName !== ".") {
|
|
@@ -4561,7 +4619,11 @@ Run without --resume to start fresh.`
|
|
|
4561
4619
|
}
|
|
4562
4620
|
if (!checkCommand("claude")) {
|
|
4563
4621
|
console.log(amber(" Installing Claude Code..."));
|
|
4564
|
-
|
|
4622
|
+
try {
|
|
4623
|
+
await runCommand("npm install -g @anthropic-ai/claude-code");
|
|
4624
|
+
} catch {
|
|
4625
|
+
await runCommand("sudo npm install -g @anthropic-ai/claude-code");
|
|
4626
|
+
}
|
|
4565
4627
|
console.log(blue(" \u2714 Claude Code installed."));
|
|
4566
4628
|
}
|
|
4567
4629
|
const authStatus = await runCommand("claude auth status").catch(() => "");
|