@insforge/cli 0.1.20 → 0.1.21
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 +110 -0
- package/dist/index.js +14 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,6 +137,49 @@ insforge metadata
|
|
|
137
137
|
insforge metadata --json
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
#### `insforge logs`
|
|
141
|
+
|
|
142
|
+
Fetch backend container logs.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
insforge logs <source> [options]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Sources:** `insforge.logs`, `postgREST.logs`, `postgres.logs`, `function.logs`
|
|
149
|
+
|
|
150
|
+
**Options:**
|
|
151
|
+
- `--limit <n>`: Number of log entries to return (default: 20)
|
|
152
|
+
|
|
153
|
+
**Examples:**
|
|
154
|
+
```bash
|
|
155
|
+
insforge logs insforge.logs
|
|
156
|
+
insforge logs postgres.logs --limit 50
|
|
157
|
+
insforge logs function.logs --json
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### `insforge docs`
|
|
161
|
+
|
|
162
|
+
Browse InsForge SDK documentation.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
insforge docs [feature] [language]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Features:** `db`, `storage`, `functions`, `auth`, `ai`, `realtime`, `instructions`
|
|
169
|
+
**Languages:** `typescript`, `swift`, `kotlin`, `rest-api`
|
|
170
|
+
|
|
171
|
+
**Examples:**
|
|
172
|
+
```bash
|
|
173
|
+
# List all available docs
|
|
174
|
+
insforge docs
|
|
175
|
+
|
|
176
|
+
# Specific feature/language docs
|
|
177
|
+
insforge docs instructions # Show backend setup instructions
|
|
178
|
+
insforge docs db typescript # Show TypeScript database SDK docs
|
|
179
|
+
insforge docs auth swift # Show Swift auth SDK docs
|
|
180
|
+
insforge docs storage rest-api # Show REST API storage docs
|
|
181
|
+
```
|
|
182
|
+
|
|
140
183
|
---
|
|
141
184
|
|
|
142
185
|
### Database — `insforge db`
|
|
@@ -258,6 +301,15 @@ insforge functions invoke my-function --method GET
|
|
|
258
301
|
insforge functions invoke my-function --data '{"key": "value"}' --json
|
|
259
302
|
```
|
|
260
303
|
|
|
304
|
+
#### `insforge functions delete <slug>`
|
|
305
|
+
|
|
306
|
+
Delete an edge function.
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
insforge functions delete my-function
|
|
310
|
+
insforge functions delete my-function -y # skip confirmation
|
|
311
|
+
```
|
|
312
|
+
|
|
261
313
|
---
|
|
262
314
|
|
|
263
315
|
### Storage — `insforge storage`
|
|
@@ -409,6 +461,64 @@ insforge secrets delete STRIPE_API_KEY
|
|
|
409
461
|
insforge secrets delete STRIPE_API_KEY -y # skip confirmation
|
|
410
462
|
```
|
|
411
463
|
|
|
464
|
+
### Schedules — `insforge schedules`
|
|
465
|
+
|
|
466
|
+
Manage scheduled tasks (cron jobs).
|
|
467
|
+
|
|
468
|
+
#### `insforge schedules list`
|
|
469
|
+
|
|
470
|
+
List all schedules in the current project.
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
insforge schedules list
|
|
474
|
+
insforge schedules list --json
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
#### `insforge schedules create`
|
|
478
|
+
|
|
479
|
+
Create a new scheduled task.
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
insforge schedules create --name "daily-cleanup" --cron "0 0 * * *" --url "https://api.example.com/cleanup" --method POST
|
|
483
|
+
insforge schedules create --name "hourly-sync" --cron "0 * * * *" --url "https://api.example.com/sync" --method GET --headers '{"Authorization": "Bearer xxx"}'
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
#### `insforge schedules get <id>`
|
|
487
|
+
|
|
488
|
+
Get details of a specific schedule.
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
insforge schedules get <id>
|
|
492
|
+
insforge schedules get 123 --json
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
#### `insforge schedules update <id>`
|
|
496
|
+
|
|
497
|
+
Update an existing schedule.
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
insforge schedules update <id> --name "weekly-cleanup" --cron "0 0 * * 0"
|
|
501
|
+
insforge schedules update 123 --active false
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
#### `insforge schedules delete <id>`
|
|
505
|
+
|
|
506
|
+
Delete a schedule.
|
|
507
|
+
|
|
508
|
+
```bash
|
|
509
|
+
insforge schedules delete <id>
|
|
510
|
+
insforge schedules delete 123 -y
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
#### `insforge schedules logs <id>`
|
|
514
|
+
|
|
515
|
+
Fetch execution logs for a specific schedule.
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
insforge schedules logs <id>
|
|
519
|
+
insforge schedules logs 123 --limit 100
|
|
520
|
+
```
|
|
521
|
+
|
|
412
522
|
---
|
|
413
523
|
|
|
414
524
|
## Project Configuration
|
package/dist/index.js
CHANGED
|
@@ -720,6 +720,16 @@ async function installSkills(json) {
|
|
|
720
720
|
} catch {
|
|
721
721
|
if (!json) clack5.log.warn("Failed to install agent skills. You can run manually: npx skills add insforge/agent-skills -s insforge -s insforge-cli");
|
|
722
722
|
}
|
|
723
|
+
try {
|
|
724
|
+
if (!json) clack5.log.info("Installing find-skills...");
|
|
725
|
+
await execAsync("npx skills add https://github.com/vercel-labs/skills --skill find-skills -y", {
|
|
726
|
+
cwd: process.cwd(),
|
|
727
|
+
timeout: 6e4
|
|
728
|
+
});
|
|
729
|
+
if (!json) clack5.log.success("find-skills installed.");
|
|
730
|
+
} catch {
|
|
731
|
+
if (!json) clack5.log.warn("Failed to install find-skills. You can run manually: npx skills add https://github.com/vercel-labs/skills --skill find-skills");
|
|
732
|
+
}
|
|
723
733
|
try {
|
|
724
734
|
updateGitignore();
|
|
725
735
|
} catch {
|
|
@@ -1433,8 +1443,8 @@ Specify --file <path> or create ${join3("insforge", "functions", slug, "index.ts
|
|
|
1433
1443
|
}
|
|
1434
1444
|
}
|
|
1435
1445
|
}
|
|
1436
|
-
|
|
1437
|
-
|
|
1446
|
+
if (deployFailed) throw new CLIError("Function deployment failed");
|
|
1447
|
+
await reportCliUsage("cli.functions.deploy", true);
|
|
1438
1448
|
} catch (err) {
|
|
1439
1449
|
await reportCliUsage("cli.functions.deploy", false);
|
|
1440
1450
|
handleError(err, json);
|
|
@@ -1470,20 +1480,14 @@ function registerFunctionsInvokeCommand(functionsCmd2) {
|
|
|
1470
1480
|
if (json) {
|
|
1471
1481
|
outputJson({ status, body: data });
|
|
1472
1482
|
} else {
|
|
1473
|
-
if (status >= 400) {
|
|
1474
|
-
console.error(`HTTP ${status}`);
|
|
1475
|
-
}
|
|
1476
1483
|
console.log(JSON.stringify(data, null, 2));
|
|
1477
1484
|
}
|
|
1478
1485
|
} else {
|
|
1479
1486
|
const text3 = await res.text();
|
|
1480
|
-
if (!json && status >= 400) {
|
|
1481
|
-
console.error(`HTTP ${status}`);
|
|
1482
|
-
}
|
|
1483
1487
|
console.log(text3);
|
|
1484
1488
|
}
|
|
1485
1489
|
if (status >= 400) {
|
|
1486
|
-
|
|
1490
|
+
throw new CLIError(`HTTP ${status}`, 1, "HTTP_ERROR");
|
|
1487
1491
|
}
|
|
1488
1492
|
} catch (err) {
|
|
1489
1493
|
handleError(err, json);
|
|
@@ -2800,8 +2804,7 @@ function registerLogsCommand(program2) {
|
|
|
2800
2804
|
await requireAuth();
|
|
2801
2805
|
const resolved = SOURCE_LOOKUP.get(source.toLowerCase());
|
|
2802
2806
|
if (!resolved) {
|
|
2803
|
-
|
|
2804
|
-
process.exit(1);
|
|
2807
|
+
throw new CLIError(`Invalid log source "${source}". Valid sources: ${VALID_SOURCES.join(", ")}`);
|
|
2805
2808
|
}
|
|
2806
2809
|
const limit = parseInt(opts.limit, 10) || 20;
|
|
2807
2810
|
const res = await ossFetch(`/api/logs/${encodeURIComponent(resolved)}?limit=${limit}`);
|