@insforge/cli 0.1.14 → 0.1.16
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 +9 -0
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,6 +128,15 @@ insforge current
|
|
|
128
128
|
insforge current --json
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
#### `insforge metadata`
|
|
132
|
+
|
|
133
|
+
Show backend metadata including auth configuration, database tables, storage buckets, edge functions, AI models, and realtime channels.
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
insforge metadata
|
|
137
|
+
insforge metadata --json
|
|
138
|
+
```
|
|
139
|
+
|
|
131
140
|
---
|
|
132
141
|
|
|
133
142
|
### Database — `insforge db`
|
package/dist/index.js
CHANGED
|
@@ -694,6 +694,33 @@ ${missing.join("\n")}
|
|
|
694
694
|
`;
|
|
695
695
|
appendFileSync(gitignorePath, block);
|
|
696
696
|
}
|
|
697
|
+
async function isCliInstalledGlobally() {
|
|
698
|
+
try {
|
|
699
|
+
await execAsync("insforge --version");
|
|
700
|
+
return true;
|
|
701
|
+
} catch {
|
|
702
|
+
return false;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
async function promptCliInstall(json) {
|
|
706
|
+
if (json) return;
|
|
707
|
+
try {
|
|
708
|
+
if (await isCliInstalledGlobally()) return;
|
|
709
|
+
const shouldInstall = await clack5.confirm({
|
|
710
|
+
message: "Would you like to install the InsForge CLI globally? (so you can run `insforge` directly)"
|
|
711
|
+
});
|
|
712
|
+
if (clack5.isCancel(shouldInstall) || !shouldInstall) {
|
|
713
|
+
clack5.log.info("You can install it later with: npm install -g @insforge/cli");
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const s = clack5.spinner();
|
|
717
|
+
s.start("Installing @insforge/cli globally...");
|
|
718
|
+
await execAsync("npm install -g @insforge/cli", { timeout: 6e4 });
|
|
719
|
+
s.stop("InsForge CLI installed globally");
|
|
720
|
+
} catch {
|
|
721
|
+
clack5.log.warn("Failed to install CLI globally. You can run manually: npm install -g @insforge/cli");
|
|
722
|
+
}
|
|
723
|
+
}
|
|
697
724
|
async function installSkills(json) {
|
|
698
725
|
try {
|
|
699
726
|
if (!json) clack5.log.info("Installing InsForge agent skills...");
|
|
@@ -818,6 +845,7 @@ function registerProjectLinkCommand(program2) {
|
|
|
818
845
|
} else {
|
|
819
846
|
outputSuccess(`Linked to project "${project.name}" (${project.appkey}.${project.region})`);
|
|
820
847
|
}
|
|
848
|
+
await promptCliInstall(json);
|
|
821
849
|
await installSkills(json);
|
|
822
850
|
await reportCliUsage("cli.link", true, 6);
|
|
823
851
|
} catch (err) {
|
|
@@ -1620,10 +1648,10 @@ function registerStorageDeleteBucketCommand(storageCmd2) {
|
|
|
1620
1648
|
try {
|
|
1621
1649
|
await requireAuth();
|
|
1622
1650
|
if (!yes && !json) {
|
|
1623
|
-
const
|
|
1651
|
+
const confirm8 = await clack7.confirm({
|
|
1624
1652
|
message: `Delete bucket "${name}" and all its objects? This cannot be undone.`
|
|
1625
1653
|
});
|
|
1626
|
-
if (!
|
|
1654
|
+
if (!confirm8 || clack7.isCancel(confirm8)) {
|
|
1627
1655
|
process.exit(0);
|
|
1628
1656
|
}
|
|
1629
1657
|
}
|
|
@@ -1969,6 +1997,7 @@ function registerCreateCommand(program2) {
|
|
|
1969
1997
|
if (hasTemplate) {
|
|
1970
1998
|
await downloadTemplate(template, projectConfig, projectName, json, apiUrl);
|
|
1971
1999
|
}
|
|
2000
|
+
await promptCliInstall(json);
|
|
1972
2001
|
await installSkills(json);
|
|
1973
2002
|
await reportCliUsage("cli.create", true, 6);
|
|
1974
2003
|
if (hasTemplate) {
|
|
@@ -2050,7 +2079,8 @@ async function downloadTemplate(framework, projectConfig, projectName, json, _ap
|
|
|
2050
2079
|
} catch {
|
|
2051
2080
|
}
|
|
2052
2081
|
const frame = framework === "nextjs" ? "nextjs" : "react";
|
|
2053
|
-
const
|
|
2082
|
+
const esc = (s2) => `'${s2.replace(/'/g, "'\\''")}'`;
|
|
2083
|
+
const command = `npx create-insforge-app ${esc(targetDir)} --frame ${frame} --base-url ${esc(projectConfig.oss_host)} --anon-key ${esc(anonKey)} --skip-install`;
|
|
2054
2084
|
s?.message(`Running create-insforge-app (${frame})...`);
|
|
2055
2085
|
await execAsync2(command, {
|
|
2056
2086
|
maxBuffer: 10 * 1024 * 1024,
|
|
@@ -2470,10 +2500,10 @@ function registerSecretsDeleteCommand(secretsCmd2) {
|
|
|
2470
2500
|
try {
|
|
2471
2501
|
await requireAuth();
|
|
2472
2502
|
if (!yes && !json) {
|
|
2473
|
-
const
|
|
2503
|
+
const confirm8 = await clack11.confirm({
|
|
2474
2504
|
message: `Delete secret "${key}"? This cannot be undone.`
|
|
2475
2505
|
});
|
|
2476
|
-
if (!
|
|
2506
|
+
if (!confirm8 || clack11.isCancel(confirm8)) {
|
|
2477
2507
|
process.exit(0);
|
|
2478
2508
|
}
|
|
2479
2509
|
}
|
|
@@ -2656,10 +2686,10 @@ function registerSchedulesDeleteCommand(schedulesCmd2) {
|
|
|
2656
2686
|
try {
|
|
2657
2687
|
await requireAuth();
|
|
2658
2688
|
if (!yes && !json) {
|
|
2659
|
-
const
|
|
2689
|
+
const confirm8 = await clack12.confirm({
|
|
2660
2690
|
message: `Delete schedule "${id}"? This cannot be undone.`
|
|
2661
2691
|
});
|
|
2662
|
-
if (!
|
|
2692
|
+
if (!confirm8 || clack12.isCancel(confirm8)) {
|
|
2663
2693
|
process.exit(0);
|
|
2664
2694
|
}
|
|
2665
2695
|
}
|