@insforge/cli 0.1.61 → 0.1.63
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 +133 -23
- package/dist/index.js +2578 -491
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @insforge/cli
|
|
2
2
|
|
|
3
|
-
Command line tool for the [InsForge](https://insforge.dev) platform. Manage your databases, edge functions, storage, deployments, secrets, and more — directly from the terminal.
|
|
3
|
+
Command line tool for the [InsForge](https://insforge.dev) platform. Manage your databases, edge functions, storage, deployments, payments, secrets, and more — directly from the terminal.
|
|
4
4
|
|
|
5
5
|
Designed to be both human-friendly (interactive prompts, formatted tables) and agent-friendly (structured JSON output, non-interactive mode, semantic exit codes).
|
|
6
6
|
|
|
@@ -63,12 +63,12 @@ npx @insforge/cli logout
|
|
|
63
63
|
|
|
64
64
|
All commands support the following flags:
|
|
65
65
|
|
|
66
|
-
| Flag
|
|
67
|
-
|
|
68
|
-
| `--json`
|
|
69
|
-
| `--project-id <id>` | Override the linked project ID
|
|
70
|
-
| `--api-url <url>`
|
|
71
|
-
| `-y, --yes`
|
|
66
|
+
| Flag | Description |
|
|
67
|
+
| ------------------- | -------------------------------------------------------- |
|
|
68
|
+
| `--json` | Output in JSON format (useful for scripts and AI agents) |
|
|
69
|
+
| `--project-id <id>` | Override the linked project ID |
|
|
70
|
+
| `--api-url <url>` | Override the Platform API URL |
|
|
71
|
+
| `-y, --yes` | Skip confirmation prompts |
|
|
72
72
|
|
|
73
73
|
## Commands
|
|
74
74
|
|
|
@@ -149,9 +149,11 @@ npx @insforge/cli logs <source> [options]
|
|
|
149
149
|
**Sources:** `insforge.logs`, `postgREST.logs`, `postgres.logs`, `function.logs`
|
|
150
150
|
|
|
151
151
|
**Options:**
|
|
152
|
+
|
|
152
153
|
- `--limit <n>`: Number of log entries to return (default: 20)
|
|
153
154
|
|
|
154
155
|
**Examples:**
|
|
156
|
+
|
|
155
157
|
```bash
|
|
156
158
|
npx @insforge/cli logs insforge.logs
|
|
157
159
|
npx @insforge/cli logs postgres.logs --limit 50
|
|
@@ -170,6 +172,7 @@ npx @insforge/cli docs [feature] [language]
|
|
|
170
172
|
**Languages:** `typescript`, `swift`, `kotlin`, `rest-api`
|
|
171
173
|
|
|
172
174
|
**Examples:**
|
|
175
|
+
|
|
173
176
|
```bash
|
|
174
177
|
# List all available docs
|
|
175
178
|
npx @insforge/cli docs
|
|
@@ -411,6 +414,110 @@ npx @insforge/cli deployments cancel abc-123
|
|
|
411
414
|
|
|
412
415
|
---
|
|
413
416
|
|
|
417
|
+
### Payments — `npx @insforge/cli payments`
|
|
418
|
+
|
|
419
|
+
Manage the Stripe payments foundation for the linked InsForge project. These commands are intended for developers and agents configuring Stripe keys, syncing catalog state, inspecting mirrored customers, and managing products/prices. Runtime checkout and customer portal calls should usually be made from the app via the SDK.
|
|
420
|
+
|
|
421
|
+
#### `npx @insforge/cli payments status`
|
|
422
|
+
|
|
423
|
+
Show Stripe key, account, sync, and webhook status for test/live environments.
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
npx @insforge/cli payments status
|
|
427
|
+
npx @insforge/cli payments status --json
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
#### `npx @insforge/cli payments config`
|
|
431
|
+
|
|
432
|
+
List, set, or remove Stripe secret keys.
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
npx @insforge/cli payments config
|
|
436
|
+
npx @insforge/cli payments config set test sk_test_xxx
|
|
437
|
+
npx @insforge/cli payments config set live # prompts securely
|
|
438
|
+
npx @insforge/cli payments config remove test -y
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### `npx @insforge/cli payments sync`
|
|
442
|
+
|
|
443
|
+
Sync Stripe products, prices, customers, and subscriptions from configured environments.
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
npx @insforge/cli payments sync
|
|
447
|
+
npx @insforge/cli payments sync --environment test
|
|
448
|
+
npx @insforge/cli payments sync --environment live --json
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
#### `npx @insforge/cli payments webhooks configure <environment>`
|
|
452
|
+
|
|
453
|
+
Create or recreate the InsForge-managed Stripe webhook endpoint for an environment.
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
npx @insforge/cli payments webhooks configure test
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
#### `npx @insforge/cli payments catalog --environment <environment>`
|
|
460
|
+
|
|
461
|
+
Inspect mirrored Stripe products and prices for one environment.
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
npx @insforge/cli payments catalog --environment test
|
|
465
|
+
npx @insforge/cli payments catalog --environment test --json
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
#### `npx @insforge/cli payments customers`
|
|
469
|
+
|
|
470
|
+
List mirrored Stripe customers for admin/debugging workflows.
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
npx @insforge/cli payments customers --environment test
|
|
474
|
+
npx @insforge/cli payments customers --environment test --limit 20 --json
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
#### `npx @insforge/cli payments products`
|
|
478
|
+
|
|
479
|
+
List, inspect, create, update, or delete Stripe products.
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
npx @insforge/cli payments products list --environment test
|
|
483
|
+
npx @insforge/cli payments products get prod_123 --environment test
|
|
484
|
+
npx @insforge/cli payments products create --environment test --name "Pro Plan"
|
|
485
|
+
npx @insforge/cli payments products update prod_123 --environment test --description "Updated"
|
|
486
|
+
npx @insforge/cli payments products delete prod_123 --environment test -y
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
#### `npx @insforge/cli payments prices`
|
|
490
|
+
|
|
491
|
+
List, inspect, create, update, or archive Stripe prices.
|
|
492
|
+
|
|
493
|
+
```bash
|
|
494
|
+
npx @insforge/cli payments prices list --environment test
|
|
495
|
+
npx @insforge/cli payments prices create --environment test --product prod_123 --currency usd --unit-amount 2000
|
|
496
|
+
npx @insforge/cli payments prices create --environment test --product prod_123 --currency usd --unit-amount 2000 --interval month
|
|
497
|
+
npx @insforge/cli payments prices update price_123 --environment test --active false
|
|
498
|
+
npx @insforge/cli payments prices archive price_123 --environment test
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
#### `npx @insforge/cli payments subscriptions`
|
|
502
|
+
|
|
503
|
+
List mirrored Stripe subscriptions for admin/debugging workflows.
|
|
504
|
+
|
|
505
|
+
```bash
|
|
506
|
+
npx @insforge/cli payments subscriptions --environment test
|
|
507
|
+
npx @insforge/cli payments subscriptions --environment test --subject-type team --subject-id team_123
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
#### `npx @insforge/cli payments history`
|
|
511
|
+
|
|
512
|
+
List mirrored payment history for admin/debugging workflows.
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
npx @insforge/cli payments history --environment test
|
|
516
|
+
npx @insforge/cli payments history --environment test --limit 20 --json
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
414
521
|
### Secrets — `npx @insforge/cli secrets`
|
|
415
522
|
|
|
416
523
|
#### `npx @insforge/cli secrets list`
|
|
@@ -551,19 +658,19 @@ Skill files are written to per-agent directories (e.g. `.claude/`, `.cursor/`, `
|
|
|
551
658
|
|
|
552
659
|
## Analytics
|
|
553
660
|
|
|
554
|
-
The CLI reports anonymous usage events to [PostHog](https://posthog.com) so we can understand which features are being used and prioritize improvements.
|
|
661
|
+
The CLI reports anonymous usage events to [PostHog](https://posthog.com) so we can understand which features are being used and prioritize improvements.
|
|
555
662
|
|
|
556
663
|
Analytics are enabled by default in the published npm package. If you build the CLI from source without setting `POSTHOG_API_KEY` at build time, analytics become a no-op automatically.
|
|
557
664
|
|
|
558
665
|
## Environment Variables
|
|
559
666
|
|
|
560
|
-
| Variable
|
|
561
|
-
|
|
562
|
-
| `INSFORGE_ACCESS_TOKEN` | Override the stored access token
|
|
563
|
-
| `INSFORGE_PROJECT_ID`
|
|
564
|
-
| `INSFORGE_API_URL`
|
|
565
|
-
| `INSFORGE_EMAIL`
|
|
566
|
-
| `INSFORGE_PASSWORD`
|
|
667
|
+
| Variable | Description |
|
|
668
|
+
| ----------------------- | ---------------------------------- |
|
|
669
|
+
| `INSFORGE_ACCESS_TOKEN` | Override the stored access token |
|
|
670
|
+
| `INSFORGE_PROJECT_ID` | Override the linked project ID |
|
|
671
|
+
| `INSFORGE_API_URL` | Override the Platform API URL |
|
|
672
|
+
| `INSFORGE_EMAIL` | Email for non-interactive login |
|
|
673
|
+
| `INSFORGE_PASSWORD` | Password for non-interactive login |
|
|
567
674
|
|
|
568
675
|
## Non-Interactive / CI Usage
|
|
569
676
|
|
|
@@ -588,14 +695,14 @@ npx @insforge/cli storage upload ./dist/bundle.js --bucket assets --key "v1.2.0/
|
|
|
588
695
|
|
|
589
696
|
## Exit Codes
|
|
590
697
|
|
|
591
|
-
| Code | Meaning
|
|
592
|
-
|
|
593
|
-
| 0
|
|
594
|
-
| 1
|
|
595
|
-
| 2
|
|
596
|
-
| 3
|
|
597
|
-
| 4
|
|
598
|
-
| 5
|
|
698
|
+
| Code | Meaning |
|
|
699
|
+
| ---- | ------------------------------------------------------- |
|
|
700
|
+
| 0 | Success |
|
|
701
|
+
| 1 | General error |
|
|
702
|
+
| 2 | Authentication failure |
|
|
703
|
+
| 3 | Project not linked (run `npx @insforge/cli link` first) |
|
|
704
|
+
| 4 | Resource not found |
|
|
705
|
+
| 5 | Permission denied |
|
|
599
706
|
|
|
600
707
|
## Development
|
|
601
708
|
|
|
@@ -628,14 +735,17 @@ npm run test:integration:real
|
|
|
628
735
|
```
|
|
629
736
|
|
|
630
737
|
Prerequisites:
|
|
738
|
+
|
|
631
739
|
- Logged in (`npx @insforge/cli login`) so `~/.insforge/credentials.json` exists
|
|
632
740
|
- Linked project in this repo (`npx @insforge/cli link`) so `.insforge/project.json` exists
|
|
633
741
|
|
|
634
742
|
Optional environment variables:
|
|
743
|
+
|
|
635
744
|
- `INSFORGE_API_URL`: Platform API URL override (defaults to `https://api.insforge.dev`)
|
|
636
745
|
- `INTEGRATION_LOG_SOURCE`: Log source for `logs` test (default `insforge.logs`)
|
|
637
746
|
|
|
638
747
|
Current real-project checks:
|
|
748
|
+
|
|
639
749
|
- `whoami --json`
|
|
640
750
|
- `metadata --json`
|
|
641
751
|
- `logs <source> --json`
|