@insforge/cli 0.1.87 → 0.1.88-razorpay.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 +372 -46
- package/dist/index.js +1256 -371
- package/package.json +4 -3
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -72,6 +72,11 @@ All commands support the following flags:
|
|
|
72
72
|
|
|
73
73
|
## Commands
|
|
74
74
|
|
|
75
|
+
> The `orgs`, `projects`, and `records` command groups are registered but hidden
|
|
76
|
+
> (`hidden: true` in `src/index.ts`) and are intentionally excluded from this
|
|
77
|
+
> reference. Use `npx @insforge/cli list` instead of `orgs`/`projects`; `records`
|
|
78
|
+
> is internal and not supported for direct use.
|
|
79
|
+
|
|
75
80
|
### Top-Level
|
|
76
81
|
|
|
77
82
|
#### `npx @insforge/cli whoami`
|
|
@@ -99,8 +104,19 @@ Create a new InsForge project interactively.
|
|
|
99
104
|
```bash
|
|
100
105
|
npx @insforge/cli create
|
|
101
106
|
npx @insforge/cli create --name "my-app" --org-id <org-id> --region us-east
|
|
107
|
+
npx @insforge/cli create --name "my-app" --template nextjs --auth better-auth # scaffold from a built-in template
|
|
108
|
+
npx @insforge/cli create --name "my-app" --marketplace <slug> # install a marketplace template
|
|
102
109
|
```
|
|
103
110
|
|
|
111
|
+
**Options:**
|
|
112
|
+
|
|
113
|
+
- `--name <name>`: Project name
|
|
114
|
+
- `--org-id <id>`: Organization ID
|
|
115
|
+
- `--region <region>`: Deployment region (`us-east`, `us-west`, `eu-central`, `ap-southeast`)
|
|
116
|
+
- `--template <template>`: Built-in template (`react`, `nextjs`, `chatbot`, `crm`, `e-commerce`, `todo`, or `empty`)
|
|
117
|
+
- `--marketplace <slug>`: Install a marketplace template by slug (browse: https://insforge.dev/templates)
|
|
118
|
+
- `--auth <provider>`: Wire a third-party auth provider into the chosen template (currently: `better-auth`)
|
|
119
|
+
|
|
104
120
|
#### `npx @insforge/cli link`
|
|
105
121
|
|
|
106
122
|
Link the current directory to an InsForge project. Creates `.insforge/project.json` with the project ID, API key, and OSS host URL.
|
|
@@ -186,6 +202,66 @@ npx @insforge/cli docs storage rest-api # Show REST API storage docs
|
|
|
186
202
|
|
|
187
203
|
---
|
|
188
204
|
|
|
205
|
+
### Branch — `npx @insforge/cli branch`
|
|
206
|
+
|
|
207
|
+
Manage backend branches of the currently linked project.
|
|
208
|
+
|
|
209
|
+
#### `npx @insforge/cli branch list`
|
|
210
|
+
|
|
211
|
+
List branches of the currently linked project.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx @insforge/cli branch list
|
|
215
|
+
npx @insforge/cli branch list --json
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
#### `npx @insforge/cli branch create <name>`
|
|
219
|
+
|
|
220
|
+
Create a branch from the currently linked project.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npx @insforge/cli branch create feature-x
|
|
224
|
+
npx @insforge/cli branch create feature-x --mode schema-only # full | schema-only (default: full)
|
|
225
|
+
npx @insforge/cli branch create feature-x --no-switch # do not auto-switch context after creation
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### `npx @insforge/cli branch switch [name]`
|
|
229
|
+
|
|
230
|
+
Switch this directory's context to a branch (or back to the parent project).
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
npx @insforge/cli branch switch feature-x
|
|
234
|
+
npx @insforge/cli branch switch --parent # switch back to the parent project
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
#### `npx @insforge/cli branch merge <name>`
|
|
238
|
+
|
|
239
|
+
Merge a branch back to its parent project.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npx @insforge/cli branch merge feature-x
|
|
243
|
+
npx @insforge/cli branch merge feature-x --dry-run # compute the diff and print rendered SQL; do not apply
|
|
244
|
+
npx @insforge/cli branch merge feature-x --save-sql diff.sql # write rendered SQL preview to a file
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
#### `npx @insforge/cli branch reset <name>`
|
|
248
|
+
|
|
249
|
+
Reset a branch's database back to T0 (the parent snapshot at branch creation).
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npx @insforge/cli branch reset feature-x
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
#### `npx @insforge/cli branch delete <name>`
|
|
256
|
+
|
|
257
|
+
Delete a branch.
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
npx @insforge/cli branch delete feature-x
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
189
265
|
### AI — `npx @insforge/cli ai`
|
|
190
266
|
|
|
191
267
|
Configure local development for the InsForge Model Gateway. The setup command fetches the linked project's active OpenRouter key from the InsForge backend and writes it as the server-only `OPENROUTER_API_KEY` variable.
|
|
@@ -278,6 +354,26 @@ Import database from a local SQL file.
|
|
|
278
354
|
npx @insforge/cli db import schema.sql
|
|
279
355
|
```
|
|
280
356
|
|
|
357
|
+
#### `npx @insforge/cli db migrations`
|
|
358
|
+
|
|
359
|
+
Manage database migration files.
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
npx @insforge/cli db migrations list # list applied remote migrations
|
|
363
|
+
npx @insforge/cli db migrations fetch # fetch applied remote migrations into migrations/
|
|
364
|
+
npx @insforge/cli db migrations new add-users # create a new local migration file (lowercase, digits, hyphens only)
|
|
365
|
+
npx @insforge/cli db migrations up --all # apply all pending local migrations
|
|
366
|
+
npx @insforge/cli db migrations up --to 20260101_add-users # apply up to a version/file
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
#### `npx @insforge/cli db connection-string`
|
|
370
|
+
|
|
371
|
+
Print the project Postgres connection URL (cloud projects only).
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
npx @insforge/cli db connection-string
|
|
375
|
+
```
|
|
376
|
+
|
|
281
377
|
---
|
|
282
378
|
|
|
283
379
|
### Functions — `npx @insforge/cli functions`
|
|
@@ -426,108 +522,150 @@ Cancel a running deployment.
|
|
|
426
522
|
npx @insforge/cli deployments cancel abc-123
|
|
427
523
|
```
|
|
428
524
|
|
|
525
|
+
#### `npx @insforge/cli deployments env`
|
|
526
|
+
|
|
527
|
+
Manage deployment environment variables.
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
npx @insforge/cli deployments env list # list all deployment env vars
|
|
531
|
+
npx @insforge/cli deployments env set API_URL https://api.example.com # create or update a variable
|
|
532
|
+
npx @insforge/cli deployments env delete <id> # delete a variable by ID
|
|
533
|
+
```
|
|
534
|
+
|
|
429
535
|
---
|
|
430
536
|
|
|
431
537
|
### Payments — `npx @insforge/cli payments`
|
|
432
538
|
|
|
433
|
-
Manage the
|
|
539
|
+
Manage the payments foundation for the linked InsForge project. Provider-specific commands live under `payments stripe` and `payments razorpay`. These commands are intended for developers and agents configuring provider keys, syncing mirrored provider state, inspecting customers, and managing provider catalog records. Runtime checkout/order/subscription calls should usually be made from the app via the SDK.
|
|
434
540
|
|
|
435
|
-
#### `npx @insforge/cli payments status`
|
|
541
|
+
#### `npx @insforge/cli payments <provider> status`
|
|
436
542
|
|
|
437
|
-
Show
|
|
543
|
+
Show key, account, sync, and webhook status for test/live environments.
|
|
438
544
|
|
|
439
545
|
```bash
|
|
440
|
-
npx @insforge/cli payments status
|
|
441
|
-
npx @insforge/cli payments status
|
|
546
|
+
npx @insforge/cli payments stripe status
|
|
547
|
+
npx @insforge/cli payments razorpay status
|
|
548
|
+
npx @insforge/cli payments stripe status --json
|
|
442
549
|
```
|
|
443
550
|
|
|
444
|
-
#### `npx @insforge/cli payments config`
|
|
551
|
+
#### `npx @insforge/cli payments <provider> config`
|
|
445
552
|
|
|
446
|
-
List, set, or remove
|
|
553
|
+
List, set, or remove provider keys.
|
|
447
554
|
|
|
448
555
|
```bash
|
|
449
|
-
npx @insforge/cli payments config
|
|
450
|
-
npx @insforge/cli payments config set test sk_test_xxx
|
|
451
|
-
npx @insforge/cli payments config set live # prompts securely
|
|
452
|
-
npx @insforge/cli payments config remove test -y
|
|
556
|
+
npx @insforge/cli payments stripe config list
|
|
557
|
+
npx @insforge/cli payments stripe config set --environment test sk_test_xxx
|
|
558
|
+
npx @insforge/cli payments stripe config set --environment live # prompts securely
|
|
559
|
+
npx @insforge/cli payments stripe config remove --environment test -y
|
|
560
|
+
npx @insforge/cli payments razorpay config list
|
|
561
|
+
npx @insforge/cli payments razorpay config set --environment test --key-id rzp_test_xxx --key-secret xxx
|
|
562
|
+
npx @insforge/cli payments razorpay config remove --environment test -y
|
|
453
563
|
```
|
|
454
564
|
|
|
455
|
-
#### `npx @insforge/cli payments sync`
|
|
565
|
+
#### `npx @insforge/cli payments <provider> sync`
|
|
456
566
|
|
|
457
|
-
Sync
|
|
567
|
+
Sync provider catalog, customers, subscriptions, and transaction projections from configured environments.
|
|
458
568
|
|
|
459
569
|
```bash
|
|
460
|
-
npx @insforge/cli payments sync
|
|
461
|
-
npx @insforge/cli payments sync --environment test
|
|
462
|
-
npx @insforge/cli payments sync --environment
|
|
570
|
+
npx @insforge/cli payments stripe sync
|
|
571
|
+
npx @insforge/cli payments stripe sync --environment test
|
|
572
|
+
npx @insforge/cli payments razorpay sync --environment test
|
|
573
|
+
npx @insforge/cli payments stripe sync --environment live --json
|
|
463
574
|
```
|
|
464
575
|
|
|
465
|
-
#### `npx @insforge/cli payments webhooks configure <environment>`
|
|
576
|
+
#### `npx @insforge/cli payments stripe webhooks configure --environment <environment>`
|
|
466
577
|
|
|
467
578
|
Create or recreate the InsForge-managed Stripe webhook endpoint for an environment.
|
|
468
579
|
|
|
469
580
|
```bash
|
|
470
|
-
npx @insforge/cli payments webhooks configure test
|
|
581
|
+
npx @insforge/cli payments stripe webhooks configure --environment test
|
|
471
582
|
```
|
|
472
583
|
|
|
473
|
-
####
|
|
584
|
+
#### Razorpay webhook setup
|
|
474
585
|
|
|
475
|
-
|
|
586
|
+
Razorpay webhooks are configured manually in the Razorpay dashboard. Use the InsForge dashboard payments settings dialog to copy the webhook URL and webhook secret, then select the recommended events on Razorpay's website.
|
|
587
|
+
|
|
588
|
+
#### `npx @insforge/cli payments <provider> catalog --environment <environment>`
|
|
589
|
+
|
|
590
|
+
Inspect mirrored provider catalog records for one environment.
|
|
476
591
|
|
|
477
592
|
```bash
|
|
478
|
-
npx @insforge/cli payments catalog --environment test
|
|
479
|
-
npx @insforge/cli payments catalog --environment test
|
|
593
|
+
npx @insforge/cli payments stripe catalog --environment test
|
|
594
|
+
npx @insforge/cli payments razorpay catalog --environment test
|
|
595
|
+
npx @insforge/cli payments stripe catalog --environment test --json
|
|
480
596
|
```
|
|
481
597
|
|
|
482
|
-
#### `npx @insforge/cli payments customers --environment <environment>`
|
|
598
|
+
#### `npx @insforge/cli payments <provider> customers --environment <environment>`
|
|
483
599
|
|
|
484
|
-
List mirrored
|
|
600
|
+
List mirrored provider customers for admin/debugging workflows.
|
|
485
601
|
|
|
486
602
|
```bash
|
|
487
|
-
npx @insforge/cli payments customers --environment test
|
|
488
|
-
npx @insforge/cli payments customers --environment test
|
|
603
|
+
npx @insforge/cli payments stripe customers --environment test
|
|
604
|
+
npx @insforge/cli payments razorpay customers --environment test
|
|
605
|
+
npx @insforge/cli payments stripe customers --environment test --limit 20 --json
|
|
489
606
|
```
|
|
490
607
|
|
|
491
|
-
#### `npx @insforge/cli payments products`
|
|
608
|
+
#### `npx @insforge/cli payments stripe products`
|
|
492
609
|
|
|
493
610
|
List, inspect, create, update, or delete Stripe products.
|
|
494
611
|
|
|
495
612
|
```bash
|
|
496
|
-
npx @insforge/cli payments products list --environment test
|
|
497
|
-
npx @insforge/cli payments products get prod_123 --environment test
|
|
498
|
-
npx @insforge/cli payments products create --environment test --name "Pro Plan"
|
|
499
|
-
npx @insforge/cli payments products update prod_123 --environment test --description "Updated"
|
|
500
|
-
npx @insforge/cli payments products delete prod_123 --environment test -y
|
|
613
|
+
npx @insforge/cli payments stripe products list --environment test
|
|
614
|
+
npx @insforge/cli payments stripe products get prod_123 --environment test
|
|
615
|
+
npx @insforge/cli payments stripe products create --environment test --name "Pro Plan"
|
|
616
|
+
npx @insforge/cli payments stripe products update prod_123 --environment test --description "Updated"
|
|
617
|
+
npx @insforge/cli payments stripe products delete prod_123 --environment test -y
|
|
501
618
|
```
|
|
502
619
|
|
|
503
|
-
#### `npx @insforge/cli payments prices`
|
|
620
|
+
#### `npx @insforge/cli payments stripe prices`
|
|
504
621
|
|
|
505
622
|
List, inspect, create, update, or archive Stripe prices.
|
|
506
623
|
|
|
507
624
|
```bash
|
|
508
|
-
npx @insforge/cli payments prices list --environment test
|
|
509
|
-
npx @insforge/cli payments prices create --environment test --product prod_123 --currency usd --unit-amount 2000
|
|
510
|
-
npx @insforge/cli payments prices create --environment test --product prod_123 --currency usd --unit-amount 2000 --interval month
|
|
511
|
-
npx @insforge/cli payments prices update price_123 --environment test --active false
|
|
512
|
-
npx @insforge/cli payments prices archive price_123 --environment test
|
|
625
|
+
npx @insforge/cli payments stripe prices list --environment test
|
|
626
|
+
npx @insforge/cli payments stripe prices create --environment test --product prod_123 --currency usd --unit-amount 2000
|
|
627
|
+
npx @insforge/cli payments stripe prices create --environment test --product prod_123 --currency usd --unit-amount 2000 --interval month
|
|
628
|
+
npx @insforge/cli payments stripe prices update price_123 --environment test --active false
|
|
629
|
+
npx @insforge/cli payments stripe prices archive price_123 --environment test
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
#### `npx @insforge/cli payments razorpay items`
|
|
633
|
+
|
|
634
|
+
List, create, or update Razorpay items.
|
|
635
|
+
|
|
636
|
+
```bash
|
|
637
|
+
npx @insforge/cli payments razorpay items list --environment test
|
|
638
|
+
npx @insforge/cli payments razorpay items create --environment test --name "Pro Plan" --amount 200000 --currency inr
|
|
639
|
+
npx @insforge/cli payments razorpay items update item_123 --environment test --active false
|
|
513
640
|
```
|
|
514
641
|
|
|
515
|
-
#### `npx @insforge/cli payments
|
|
642
|
+
#### `npx @insforge/cli payments razorpay plans`
|
|
516
643
|
|
|
517
|
-
List
|
|
644
|
+
List or create Razorpay subscription plans.
|
|
518
645
|
|
|
519
646
|
```bash
|
|
520
|
-
npx @insforge/cli payments
|
|
521
|
-
npx @insforge/cli payments
|
|
647
|
+
npx @insforge/cli payments razorpay plans list --environment test
|
|
648
|
+
npx @insforge/cli payments razorpay plans create --environment test --period monthly --interval 1 --item-name "Pro Plan" --item-amount 200000 --item-currency inr
|
|
522
649
|
```
|
|
523
650
|
|
|
524
|
-
#### `npx @insforge/cli payments
|
|
651
|
+
#### `npx @insforge/cli payments <provider> subscriptions --environment <environment>`
|
|
525
652
|
|
|
526
|
-
List mirrored
|
|
653
|
+
List mirrored provider subscriptions for admin/debugging workflows.
|
|
527
654
|
|
|
528
655
|
```bash
|
|
529
|
-
npx @insforge/cli payments
|
|
530
|
-
npx @insforge/cli payments
|
|
656
|
+
npx @insforge/cli payments stripe subscriptions --environment test
|
|
657
|
+
npx @insforge/cli payments razorpay subscriptions --environment test
|
|
658
|
+
npx @insforge/cli payments stripe subscriptions --environment test --subject-type team --subject-id team_123
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
#### `npx @insforge/cli payments <provider> transactions --environment <environment>`
|
|
662
|
+
|
|
663
|
+
List mirrored payment transactions for admin/debugging workflows. `--subject-type` and `--subject-id` refer to the app billing subject passed to InsForge, such as `team:team_123` or `user:user_123`; they are not provider customer, payment, order, or subscription ids.
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
npx @insforge/cli payments stripe transactions --environment test
|
|
667
|
+
npx @insforge/cli payments razorpay transactions --environment test
|
|
668
|
+
npx @insforge/cli payments stripe transactions --environment test --limit 20 --json
|
|
531
669
|
```
|
|
532
670
|
|
|
533
671
|
---
|
|
@@ -643,6 +781,194 @@ npx @insforge/cli schedules logs 123 --limit 100
|
|
|
643
781
|
|
|
644
782
|
---
|
|
645
783
|
|
|
784
|
+
### Compute — `npx @insforge/cli compute`
|
|
785
|
+
|
|
786
|
+
Manage compute services (Docker containers on Fly.io).
|
|
787
|
+
|
|
788
|
+
#### `npx @insforge/cli compute list`
|
|
789
|
+
|
|
790
|
+
List all compute services.
|
|
791
|
+
|
|
792
|
+
```bash
|
|
793
|
+
npx @insforge/cli compute list
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
#### `npx @insforge/cli compute get <id>`
|
|
797
|
+
|
|
798
|
+
Get details of a compute service.
|
|
799
|
+
|
|
800
|
+
```bash
|
|
801
|
+
npx @insforge/cli compute get my-api
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
#### `npx @insforge/cli compute deploy [dir]`
|
|
805
|
+
|
|
806
|
+
Deploy a compute service. Source mode runs a `flyctl` remote build and push (requires `flyctl` on PATH, no Docker needed); image mode deploys a pre-built image (no `flyctl`/Docker required).
|
|
807
|
+
|
|
808
|
+
```bash
|
|
809
|
+
# Source mode
|
|
810
|
+
npx @insforge/cli compute deploy ./api --name my-api
|
|
811
|
+
# Image mode
|
|
812
|
+
npx @insforge/cli compute deploy --image registry.example.com/my-api:latest --name my-api
|
|
813
|
+
# Common options
|
|
814
|
+
npx @insforge/cli compute deploy ./api --name my-api \
|
|
815
|
+
--port 8080 --cpu shared-1x --memory 512 --region iad \
|
|
816
|
+
--env '{"LOG_LEVEL":"info"}' # or --env-file .env
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
**Options:**
|
|
820
|
+
|
|
821
|
+
- `--name <name>`: Service name (required)
|
|
822
|
+
- `--image <url>`: Container image URL (image mode)
|
|
823
|
+
- `--port <port>`: Container port (default: `8080`)
|
|
824
|
+
- `--cpu <tier>`: CPU tier (default: `shared-1x`)
|
|
825
|
+
- `--memory <mb>`: Memory in MB (default: `512`)
|
|
826
|
+
- `--region <region>`: Deploy region (default: `iad`)
|
|
827
|
+
- `--env <json>`: Environment variables as JSON
|
|
828
|
+
- `--env-file <path>`: Load environment variables from a file
|
|
829
|
+
- `--protocol <http|tcp>`: Service protocol (default: `http`)
|
|
830
|
+
|
|
831
|
+
#### `npx @insforge/cli compute update <id>`
|
|
832
|
+
|
|
833
|
+
Update a compute service.
|
|
834
|
+
|
|
835
|
+
```bash
|
|
836
|
+
npx @insforge/cli compute update my-api --memory 1024
|
|
837
|
+
npx @insforge/cli compute update my-api --env-set LOG_LEVEL=debug # set/update one var (repeatable)
|
|
838
|
+
npx @insforge/cli compute update my-api --env-unset OLD_KEY # remove one var (repeatable)
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
**Options:**
|
|
842
|
+
|
|
843
|
+
- `--image <image>`: Container image URL
|
|
844
|
+
- `--port <port>`: Container port
|
|
845
|
+
- `--cpu <tier>`: CPU tier
|
|
846
|
+
- `--memory <mb>`: Memory in MB
|
|
847
|
+
- `--region <region>`: Deploy region
|
|
848
|
+
- `--env <json>`: Environment variables as JSON (replaces ALL vars)
|
|
849
|
+
- `--env-set <KEY=VALUE>`: Set/update one variable (repeatable, merges)
|
|
850
|
+
- `--env-unset <KEY>`: Remove one variable (repeatable, merges)
|
|
851
|
+
|
|
852
|
+
#### `npx @insforge/cli compute start <id>` / `stop <id>`
|
|
853
|
+
|
|
854
|
+
Start a stopped, or stop a running, compute service.
|
|
855
|
+
|
|
856
|
+
```bash
|
|
857
|
+
npx @insforge/cli compute start my-api
|
|
858
|
+
npx @insforge/cli compute stop my-api
|
|
859
|
+
```
|
|
860
|
+
|
|
861
|
+
#### `npx @insforge/cli compute events <id>`
|
|
862
|
+
|
|
863
|
+
Get compute service machine events (start/stop/exit/restart).
|
|
864
|
+
|
|
865
|
+
```bash
|
|
866
|
+
npx @insforge/cli compute events my-api --limit 50
|
|
867
|
+
```
|
|
868
|
+
|
|
869
|
+
#### `npx @insforge/cli compute delete <id>`
|
|
870
|
+
|
|
871
|
+
Delete a compute service and its Fly.io resources.
|
|
872
|
+
|
|
873
|
+
```bash
|
|
874
|
+
npx @insforge/cli compute delete my-api
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
---
|
|
878
|
+
|
|
879
|
+
### Diagnose — `npx @insforge/cli diagnose`
|
|
880
|
+
|
|
881
|
+
Backend diagnostics. Run with no subcommand for a full health report.
|
|
882
|
+
|
|
883
|
+
```bash
|
|
884
|
+
npx @insforge/cli diagnose
|
|
885
|
+
npx @insforge/cli diagnose --ai "why is my database slow?" # ask AI to analyze diagnostic data
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
#### `npx @insforge/cli diagnose advisor`
|
|
889
|
+
|
|
890
|
+
Display latest advisor scan results and issues.
|
|
891
|
+
|
|
892
|
+
```bash
|
|
893
|
+
npx @insforge/cli diagnose advisor --severity critical --category security --limit 50
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
#### `npx @insforge/cli diagnose db`
|
|
897
|
+
|
|
898
|
+
Run database health checks (connections, bloat, index usage, etc.).
|
|
899
|
+
|
|
900
|
+
```bash
|
|
901
|
+
npx @insforge/cli diagnose db
|
|
902
|
+
npx @insforge/cli diagnose db --check connections,bloat
|
|
903
|
+
```
|
|
904
|
+
|
|
905
|
+
#### `npx @insforge/cli diagnose logs`
|
|
906
|
+
|
|
907
|
+
Aggregate error-level logs from all backend sources.
|
|
908
|
+
|
|
909
|
+
```bash
|
|
910
|
+
npx @insforge/cli diagnose logs --source postgres.logs --limit 100
|
|
911
|
+
```
|
|
912
|
+
|
|
913
|
+
#### `npx @insforge/cli diagnose metrics`
|
|
914
|
+
|
|
915
|
+
Display EC2 instance metrics (CPU, memory, disk, network).
|
|
916
|
+
|
|
917
|
+
```bash
|
|
918
|
+
npx @insforge/cli diagnose metrics --range 6h
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
---
|
|
922
|
+
|
|
923
|
+
### PostHog — `npx @insforge/cli posthog`
|
|
924
|
+
|
|
925
|
+
Manage PostHog product analytics integration.
|
|
926
|
+
|
|
927
|
+
#### `npx @insforge/cli posthog setup`
|
|
928
|
+
|
|
929
|
+
Connect PostHog to your InsForge dashboard, then run the official PostHog wizard to wire it into your app.
|
|
930
|
+
|
|
931
|
+
```bash
|
|
932
|
+
npx @insforge/cli posthog setup
|
|
933
|
+
npx @insforge/cli posthog setup --skip-browser # only print the OAuth URL, do not auto-open the browser
|
|
934
|
+
```
|
|
935
|
+
|
|
936
|
+
---
|
|
937
|
+
|
|
938
|
+
### Config — `npx @insforge/cli config`
|
|
939
|
+
|
|
940
|
+
Manage `insforge.toml` (declarative project configuration).
|
|
941
|
+
|
|
942
|
+
#### `npx @insforge/cli config export`
|
|
943
|
+
|
|
944
|
+
Pull live project config and write `insforge.toml`.
|
|
945
|
+
|
|
946
|
+
```bash
|
|
947
|
+
npx @insforge/cli config export
|
|
948
|
+
npx @insforge/cli config export --out insforge.toml --force
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
#### `npx @insforge/cli config plan`
|
|
952
|
+
|
|
953
|
+
Show the diff between `insforge.toml` and live project state.
|
|
954
|
+
|
|
955
|
+
```bash
|
|
956
|
+
npx @insforge/cli config plan
|
|
957
|
+
npx @insforge/cli config plan --file insforge.toml
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
#### `npx @insforge/cli config apply`
|
|
961
|
+
|
|
962
|
+
Apply `insforge.toml` to the live project.
|
|
963
|
+
|
|
964
|
+
```bash
|
|
965
|
+
npx @insforge/cli config apply
|
|
966
|
+
npx @insforge/cli config apply --dry-run # show plan, do not apply
|
|
967
|
+
npx @insforge/cli config apply --auto-approve # skip confirmation prompt
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
---
|
|
971
|
+
|
|
646
972
|
## Project Configuration
|
|
647
973
|
|
|
648
974
|
Running `npx @insforge/cli link` creates a `.insforge/` directory in your project:
|