indraq_cli 1.9.1 → 2.0.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.
Files changed (64) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1043 -1517
  3. package/cloud-api/.env +6 -0
  4. package/cloud-api/.env.example +14 -14
  5. package/cloud-api/README.md +145 -141
  6. package/cloud-api/package.json +29 -29
  7. package/cloud-api/sql/001_init.sql +8 -8
  8. package/cloud-api/sql/002_user_providers_and_project_resources.sql +40 -40
  9. package/cloud-api/sql/003_environment_infrastructure.sql +19 -19
  10. package/cloud-api/sql/004_managed_aws_credentials.sql +20 -20
  11. package/cloud-api/sql/005_project_members_and_resource_grants.sql +22 -22
  12. package/cloud-api/sql/006_catalog_identity_password_security.sql +96 -96
  13. package/cloud-api/sql/007_aws_access_key_rotation.sql +16 -16
  14. package/cloud-api/src/index.ts +1329 -1254
  15. package/cloud-api/tsconfig.json +18 -18
  16. package/dist/cli/help-content.d.ts.map +1 -1
  17. package/dist/cli/help-content.js +254 -251
  18. package/dist/cli/help-content.js.map +1 -1
  19. package/dist/modules/access/commands/access.command.d.ts +19 -0
  20. package/dist/modules/access/commands/access.command.d.ts.map +1 -1
  21. package/dist/modules/access/commands/access.command.js +57 -46
  22. package/dist/modules/access/commands/access.command.js.map +1 -1
  23. package/dist/modules/cloud/commands/cloud.command.d.ts.map +1 -1
  24. package/dist/modules/cloud/commands/cloud.command.js +18 -2
  25. package/dist/modules/cloud/commands/cloud.command.js.map +1 -1
  26. package/dist/modules/cloud/config/cloud-config.d.ts +1 -1
  27. package/dist/modules/cloud/config/cloud-config.js +1 -1
  28. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts +13 -1
  29. package/dist/modules/cloud/services/cloud-jenkins.service.d.ts.map +1 -1
  30. package/dist/modules/cloud/services/cloud-jenkins.service.js +173 -77
  31. package/dist/modules/cloud/services/cloud-jenkins.service.js.map +1 -1
  32. package/dist/modules/cloud/services/managed-aws-credential.service.d.ts.map +1 -1
  33. package/dist/modules/cloud/services/managed-aws-credential.service.js +11 -4
  34. package/dist/modules/cloud/services/managed-aws-credential.service.js.map +1 -1
  35. package/dist/modules/jenkins/commands/admin.command.d.ts +3 -0
  36. package/dist/modules/jenkins/commands/admin.command.d.ts.map +1 -1
  37. package/dist/modules/jenkins/commands/admin.command.js +91 -1
  38. package/dist/modules/jenkins/commands/admin.command.js.map +1 -1
  39. package/dist/modules/jenkins/index.d.ts.map +1 -1
  40. package/dist/modules/jenkins/index.js +3 -0
  41. package/dist/modules/jenkins/index.js.map +1 -1
  42. package/dist/modules/scaffold/services/docker-template.service.js +95 -95
  43. package/dist/modules/users/commands/user.command.d.ts.map +1 -1
  44. package/dist/modules/users/commands/user.command.js +290 -44
  45. package/dist/modules/users/commands/user.command.js.map +1 -1
  46. package/dist/modules/users/providers/aws-user.provider.d.ts.map +1 -1
  47. package/dist/modules/users/providers/aws-user.provider.js +9 -2
  48. package/dist/modules/users/providers/aws-user.provider.js.map +1 -1
  49. package/dist/modules/users/providers/jenkins-user.provider.d.ts +11 -4
  50. package/dist/modules/users/providers/jenkins-user.provider.d.ts.map +1 -1
  51. package/dist/modules/users/providers/jenkins-user.provider.js +174 -72
  52. package/dist/modules/users/providers/jenkins-user.provider.js.map +1 -1
  53. package/dist/modules/users/providers/npm-user.provider.d.ts.map +1 -1
  54. package/dist/modules/users/providers/npm-user.provider.js +3 -1
  55. package/dist/modules/users/providers/npm-user.provider.js.map +1 -1
  56. package/dist/shared/config/config-files.js +7 -7
  57. package/docs/ARCHITECTURE.md +29 -29
  58. package/docs/CREATE-DEPLOYMENT-reference.groovy +1105 -1105
  59. package/package.json +77 -76
  60. package/templates/jenkins/CREATE-DEPLOYMENT.groovy +1105 -1105
  61. package/templates/jenkins/Jenkinsfile-Mobile-App +759 -759
  62. package/cloud-api/.dockerignore +0 -18
  63. package/cloud-api/Dockerfile +0 -19
  64. package/cloud-api/package-lock.json +0 -2250
package/README.md CHANGED
@@ -1,1517 +1,1043 @@
1
- # IndraQ CLI
2
-
3
- IndraQ CLI is a cloud-first developer and DevOps command-line platform for creating projects, configuring reusable infrastructure credentials, managing users, and reconciling deployments across GHCR, Jenkins, AWS Route53, and Nginx Proxy Manager.
4
-
5
- The goal is simple: developers should work with understandable names such as `production`, `staging`, `api.example.com`, and `order-service` instead of remembering server IP addresses, Jenkins details, registry paths, or provider credentials for every project.
6
-
7
- ## What IndraQ manages
8
-
9
- IndraQ has two kinds of configuration:
10
-
11
- ### User-level reusable credentials
12
-
13
- Each IndraQ user owns their own provider credentials. They can reuse the same credentials across all projects they can access.
14
-
15
- Supported reusable providers:
16
-
17
- - AWS
18
- - Nginx Proxy Manager (NPM)
19
- - Jenkins Development
20
- - Jenkins Production
21
- - GitHub Container Registry (GHCR)
22
-
23
- Credentials are stored in IndraQ Cloud. They are not copied into every project.
24
-
25
- ### Project-level infrastructure
26
-
27
- Each project stores only the infrastructure associated with that project, for example:
28
-
29
- - GHCR image repository
30
- - Jenkins deployment job
31
- - Route53 record
32
- - Route53 routing policy
33
- - Route53 health checks
34
- - NPM proxy host
35
- - selected shared environment
36
- - host/container ports
37
-
38
- A local IndraQ project keeps the Cloud project ID in `.indraq/project.json`. Provider secrets are not stored in the project folder.
39
-
40
- ---
41
-
42
- # 1. Roles and permissions
43
-
44
- IndraQ Cloud supports three roles.
45
-
46
- | Role | Main access |
47
- | --- | --- |
48
- | `user` | View the organization project catalog, create projects, configure their own provider credentials, use shared environments, run prebuild/deploy only on projects where they have WRITE access, retrieve/rotate their own managed AWS IAM credential |
49
- | `manager` | Everything a user can do, plus create/manage normal users, rotate managed users' AWS keys, update/delete Cloud projects with a reason, manage project membership/resource access, and view audit logs |
50
- | `admin` | Full access, including create managers/admins, change roles, rotate any managed AWS key, manage projects/members/resource access, manage shared environments and Route53 health checks, configure AWS policy mappings, and view audit logs |
51
-
52
- Important rules:
53
-
54
- - Managers can create normal users only.
55
- - Only admins can create another manager or admin.
56
- - Only admins can change a user's IndraQ role.
57
- - Only admins can create/update/delete shared environments.
58
- - Every user has their own AWS/NPM/Jenkins/GHCR provider credentials.
59
- - Shared environments are visible to authenticated users, but only admins manage them.
60
- - Route53 health checks can be listed/selected by users and managers, but only admins create/delete them.
61
- - Organization projects are visible to every authenticated user; VIEW vs WRITE controls whether infrastructure can be changed.
62
-
63
- ---
64
-
65
- # 2. System architecture
66
-
67
- A typical installation looks like this:
68
-
69
- ```text
70
- Developer workstation
71
- |
72
- | indraq CLI
73
- v
74
- IndraQ Cloud API
75
- |
76
- +-- PostgreSQL
77
- |
78
- +-- user credentials
79
- | +-- AWS
80
- | +-- NPM
81
- | +-- Jenkins DEV
82
- | +-- Jenkins PROD
83
- | +-- GHCR
84
- |
85
- +-- shared environments
86
- |
87
- +-- projects
88
- +-- GHCR image
89
- +-- Jenkins job
90
- +-- Route53 record / health checks
91
- +-- NPM proxy
92
- ```
93
-
94
- Example shared environments:
95
-
96
- ```text
97
- production-api -> 10.0.0.10
98
- production-backup -> 10.0.0.11
99
- staging -> 10.0.1.10
100
- qa -> 10.0.2.20
101
- client-a -> 192.0.2.25
102
- ```
103
-
104
- Environment names are completely arbitrary. There is no fixed `PRIMARY` or `SECONDARY` environment type.
105
-
106
- For a Route53 FAILOVER record, the user chooses which environment acts as PRIMARY and which acts as SECONDARY for that particular DNS record.
107
-
108
- ---
109
-
110
- # 3. Requirements
111
-
112
- ## CLI workstation
113
-
114
- Required:
115
-
116
- - Node.js 22 or newer
117
- - npm
118
- - Git
119
-
120
- Recommended/required depending on the workflow:
121
-
122
- - Docker, for GHCR image login/build/push
123
- - network access to IndraQ Cloud API
124
- - network access to Jenkins/NPM/AWS/GitHub used by that user
125
-
126
- ## Cloud server
127
-
128
- Required:
129
-
130
- - Node.js 22 or newer
131
- - PostgreSQL
132
- - a persistent `MASTER_KEY`
133
- - a strong `JWT_SECRET`
134
-
135
- ## Jenkins
136
-
137
- For deployment creation and unified Jenkins user management, Jenkins must allow the account configured in IndraQ to perform the required administrative operations.
138
-
139
- The included reference pipeline is:
140
-
141
- ```text
142
- docs/CREATE-DEPLOYMENT-reference.groovy
143
- ```
144
-
145
- For its live parameter UI, Jenkins Active Choices is required. Role assignment for Jenkins users requires the Jenkins Role Strategy setup expected by your Jenkins instance.
146
-
147
- IndraQ handles Jenkins CSRF crumbs together with the Jenkins web session when `/scriptText` administration is required.
148
-
149
- ---
150
-
151
- # 4. Install and start IndraQ Cloud API
152
-
153
- Open the Cloud API folder:
154
-
155
- ```powershell
156
- cd cloud-api
157
- npm install
158
- ```
159
-
160
- Copy the example environment file:
161
-
162
- ```powershell
163
- Copy-Item .env.example .env
164
- ```
165
-
166
- Edit `.env`:
167
-
168
- ```env
169
- PORT=4010
170
- DATABASE_URL=postgresql://indraq:change-me@127.0.0.1:5432/indraq_cloud
171
- JWT_SECRET=replace-with-at-least-32-random-characters
172
- MASTER_KEY=replace-with-exactly-64-hex-characters
173
- BOOTSTRAP_ADMIN_EMAIL=admin@example.com
174
- BOOTSTRAP_ADMIN_PASSWORD=use-a-strong-password
175
- ```
176
-
177
- Requirements:
178
-
179
- - `JWT_SECRET`: at least 32 characters
180
- - `MASTER_KEY`: exactly 64 hexadecimal characters (32 bytes)
181
- - `BOOTSTRAP_ADMIN_PASSWORD`: at least 12 characters
182
-
183
- Generate a valid master key with Node:
184
-
185
- ```powershell
186
- node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
187
- ```
188
-
189
- Generate a JWT secret:
190
-
191
- ```powershell
192
- node -e "console.log(require('crypto').randomBytes(48).toString('hex'))"
193
- ```
194
-
195
- Build and start:
196
-
197
- ```powershell
198
- npm run build
199
- npm run dev
200
- ```
201
-
202
- Production start:
203
-
204
- ```powershell
205
- npm run build
206
- npm start
207
- ```
208
-
209
- Expected startup message:
210
-
211
- ```text
212
- IndraQ Cloud API listening on 4010
213
- ```
214
-
215
- ## Database migrations
216
-
217
- SQL migrations in `cloud-api/sql/` are applied automatically when the Cloud API starts.
218
-
219
- You do not normally need to run migration files manually.
220
-
221
- ## Bootstrap administrator
222
-
223
- If no admin exists, the Cloud API creates the first administrator from:
224
-
225
- ```env
226
- BOOTSTRAP_ADMIN_EMAIL=...
227
- BOOTSTRAP_ADMIN_PASSWORD=...
228
- ```
229
-
230
- After the first administrator is created, remove the bootstrap password from the long-running production environment if your deployment process allows it.
231
-
232
- Do not change or lose `MASTER_KEY` after secrets have been stored. The same key is required to decrypt provider credentials later.
233
-
234
- ---
235
-
236
- # 5. Build and install the CLI
237
-
238
- From the repository root:
239
-
240
- ```powershell
241
- npm install
242
- npm run build
243
- npm test
244
- npm link
245
- ```
246
-
247
- Confirm installation:
248
-
249
- ```powershell
250
- indraq --version
251
- indraq --help
252
- ```
253
-
254
- Run diagnostics:
255
-
256
- ```powershell
257
- indraq doctor
258
- ```
259
-
260
- ---
261
-
262
- # 6. Login to IndraQ Cloud
263
-
264
- The official IndraQ Cloud API URL is built into the CLI (`https://api.indraq.com`). Users do not configure a backend URL.
265
-
266
- After installing the npm package, login directly:
267
-
268
- ```powershell
269
- indraq login
270
- ```
271
-
272
- Check the active identity:
273
-
274
- ```powershell
275
- indraq whoami
276
- ```
277
-
278
- Logout:
279
-
280
- ```powershell
281
- indraq logout
282
- ```
283
-
284
- The aliases below also work:
285
-
286
- ```powershell
287
- indraq cloud login
288
- indraq cloud whoami
289
- indraq cloud logout
290
- ```
291
-
292
- ---
293
-
294
- # 7. Shared environments
295
-
296
- An environment is a friendly name bound to a reusable server IP.
297
-
298
- Examples:
299
-
300
- ```text
301
- production
302
- production-backup
303
- staging
304
- qa
305
- client-a
306
- mumbai-app-01
307
- ```
308
-
309
- There is no limit such as one primary and one secondary environment. Admins can create as many environments as required and name them freely.
310
-
311
- ## Create an environment
312
-
313
- Admin only:
314
-
315
- ```powershell
316
- indraq environment create
317
- ```
318
-
319
- The wizard asks for values such as:
320
-
321
- - environment name
322
- - description
323
- - server IPv4 address
324
- - region (optional/useful for latency routing)
325
- - audit reason
326
-
327
- ## List environments
328
-
329
- ```powershell
330
- indraq environment list
331
- ```
332
-
333
- ## Update an environment
334
-
335
- ```powershell
336
- indraq environment update production
337
- ```
338
-
339
- ## Delete an environment
340
-
341
- ```powershell
342
- indraq environment delete production
343
- ```
344
-
345
- Environments are shared infrastructure shortcuts. Provider credentials are still private per IndraQ user.
346
-
347
- ---
348
-
349
- # 8. Configure reusable provider credentials
350
-
351
- The easiest entry point is:
352
-
353
- ```powershell
354
- indraq configure
355
- ```
356
-
357
- Or configure one provider directly:
358
-
359
- ```powershell
360
- indraq provider configure aws
361
- indraq provider configure npm
362
- indraq provider configure jenkins-dev
363
- indraq provider configure jenkins-prod
364
- indraq provider configure ghcr
365
- ```
366
-
367
- List configured provider profiles:
368
-
369
- ```powershell
370
- indraq provider list
371
- ```
372
-
373
- Secrets are never printed by `provider list`.
374
-
375
- ## AWS provider
376
-
377
- ```powershell
378
- indraq provider configure aws
379
- ```
380
-
381
- The wizard validates AWS access and can configure:
382
-
383
- - AWS region
384
- - access key ID
385
- - secret access key
386
- - optional session token
387
- - default hosted zone
388
- - default managed IAM policies by IndraQ role
389
-
390
- ### AWS policy mapping
391
-
392
- Admins can define managed policy ARNs for:
393
-
394
- ```text
395
- USER
396
- MANAGER
397
- ADMIN
398
- ```
399
-
400
- Managers can configure the policy mapping needed for normal users but cannot elevate users to manager/admin.
401
-
402
- When unified AWS user creation is used, IndraQ applies the policies for the selected Cloud role. If the role changes later, IndraQ removes old IndraQ-managed role policies before applying the new role mapping so stale elevated access is not intentionally retained by the CLI.
403
-
404
- You can still explicitly provide policies when using low-level IAM commands if required.
405
-
406
- ## Nginx Proxy Manager provider
407
-
408
- ```powershell
409
- indraq provider configure npm
410
- ```
411
-
412
- Enter:
413
-
414
- - NPM URL
415
- - NPM administrator email
416
- - NPM administrator password
417
-
418
- IndraQ validates the credentials before storing them.
419
-
420
- ## Jenkins provider
421
-
422
- Development Jenkins:
423
-
424
- ```powershell
425
- indraq provider configure jenkins-dev
426
- ```
427
-
428
- Production Jenkins:
429
-
430
- ```powershell
431
- indraq provider configure jenkins-prod
432
- ```
433
-
434
- Enter:
435
-
436
- - Jenkins URL
437
- - Jenkins username
438
- - Jenkins API token/password
439
-
440
- IndraQ validates authentication before storing the profile.
441
-
442
- ## GHCR provider
443
-
444
- ```powershell
445
- indraq provider configure ghcr
446
- ```
447
-
448
- Enter:
449
-
450
- - registry host, normally `ghcr.io`
451
- - GitHub token with the package permissions needed by your workflow
452
-
453
- After authentication, IndraQ fetches:
454
-
455
- - the authenticated GitHub account
456
- - organizations visible to that token
457
-
458
- The user selects the owner instead of typing a hardcoded organization name.
459
-
460
- Example generated image path:
461
-
462
- ```text
463
- ghcr.io/acme-platform/order-service
464
- ```
465
-
466
- No organization name is hardcoded into IndraQ.
467
-
468
- If GitHub cannot enumerate the required organization for the supplied token, manual owner entry remains available as a fallback.
469
-
470
- ---
471
-
472
- # 9. User management
473
-
474
- Use unified user management when the same person needs accounts across IndraQ Cloud, AWS, NPM, and Jenkins.
475
-
476
- ## Create a user
477
-
478
- ```powershell
479
- indraq user create
480
- ```
481
-
482
- The wizard asks for:
483
-
484
- - username
485
- - providers to create/manage
486
- - Cloud role (`user`, `manager`, `admin`) when permitted
487
- - email
488
- - temporary first-login password generated by IndraQ (shown once to the operator)
489
- - provider-specific settings where required
490
-
491
- You can also use flags:
492
-
493
- ```powershell
494
- indraq user create hk --providers cloud,aws,npm,jenkins --role user
495
- ```
496
-
497
- Provider-selection flags also exist:
498
-
499
- ```powershell
500
- --cloud
501
- --aws
502
- --npm
503
- --jenkins
504
- ```
505
-
506
- ### Role rules
507
-
508
- Manager creating a user:
509
-
510
- ```text
511
- allowed role: user
512
- ```
513
-
514
- Admin creating a user:
515
-
516
- ```text
517
- allowed roles: user, manager, admin
518
- ```
519
-
520
- ### Unified creation safety
521
-
522
- Before creating accounts in multiple providers, IndraQ preflights Jenkins administration when Jenkins is selected.
523
-
524
- If a later provider fails after creation has started, IndraQ performs best-effort rollback of providers created by that command.
525
-
526
- Always review the provider result summary after a failed operation.
527
-
528
- ## Update a user
529
-
530
- ```powershell
531
- indraq user update hk
532
- ```
533
-
534
- Examples:
535
-
536
- ```powershell
537
- indraq user update hk --role manager
538
- indraq user update hk --providers cloud,aws
539
- ```
540
-
541
- Only an admin can change Cloud roles.
542
-
543
- ## Delete a user
544
-
545
- ```powershell
546
- indraq user delete hk
547
- ```
548
-
549
- Skip the confirmation only when you intentionally want non-interactive deletion:
550
-
551
- ```powershell
552
- indraq user delete hk --yes
553
- ```
554
-
555
-
556
- ## First login and password reset
557
-
558
- When a manager/admin creates a Cloud user, IndraQ generates a temporary password. It is intended only for the first login. On first `indraq login`, the user must choose a new password before other Cloud commands are allowed. Managed NPM/Jenkins identities created by the unified user workflow are rotated to the same new password.
559
-
560
- Self-service password recovery uses an email OTP:
561
-
562
- ```powershell
563
- indraq password reset
564
- indraq password reset --email user@example.com --cloud
565
- indraq password reset --email user@example.com --npm
566
- indraq password reset --email user@example.com --jenkins
567
- indraq password reset --email user@example.com --all
568
- ```
569
-
570
- `--all` means Cloud + NPM + Jenkins. AWS is intentionally excluded because IndraQ AWS users use access keys rather than console passwords. The Cloud API requires SMTP configuration (`SMTP_HOST`, `SMTP_PORT`, `SMTP_SECURE`, `SMTP_USER`, `SMTP_PASS`, `SMTP_FROM`).
571
-
572
- List/update/delete workflows are searchable and selectable rather than requiring users to remember exact identities. By default list commands return 10 rows; use `--search`, `--limit`, or `--all` where available. This applies to organization users, AWS IAM users/records, NPM users/proxies, Jenkins users/jobs, projects, environments, health checks, and logs.
573
-
574
- ---
575
-
576
- # 10. AWS IAM CLI users and recoverable access keys
577
-
578
- AWS does not provide the original secret access key again after access-key creation.
579
-
580
- When IndraQ creates an AWS IAM user through the unified user workflow, IndraQ stores the generated AWS secret encrypted in IndraQ Cloud and links it to that Cloud user.
581
- IndraQ also attaches an `IndraQBaseRole` inline IAM policy automatically according to the selected IndraQ `user`, `manager`, or `admin` role. Optional AWS managed-policy mappings configured by an operator are reconciled on top of that base role.
582
-
583
-
584
- The user sees the key at creation time and can retrieve their own stored credential later after logging into their IndraQ account. Access keys can also be rotated through IndraQ without losing the encrypted recovery copy.
585
-
586
- Create an IAM CLI user directly:
587
-
588
- ```powershell
589
- indraq iam user:create hk
590
- ```
591
-
592
- Delete:
593
-
594
- ```powershell
595
- indraq iam user:delete hk
596
- ```
597
-
598
- Retrieve the current logged-in user's stored unified AWS credential:
599
-
600
- ```powershell
601
- indraq iam credentials hk
602
- ```
603
-
604
- Rotate an access key:
605
-
606
- ```powershell
607
- indraq iam access-key rotate
608
- ```
609
-
610
- A normal user can rotate only their own IndraQ-managed AWS key. Managers/admins can select managed organization users across the organization. IndraQ creates the replacement key, stores it encrypted, updates the target user's reusable AWS provider credential, and only then deletes the previous managed key. Rotation is audited. If the IAM user already has two keys, IndraQ stops rather than deleting an unknown/unmanaged key.
611
-
612
- Important security behavior:
613
-
614
- - the target Cloud user can retrieve their own stored AWS secret
615
- - normal users cannot resolve another user's provider credentials
616
- - retrieval is audited
617
- - provider-resolution responses use `Cache-Control: no-store`
618
- - AWS console login profiles are intentionally not created by these IAM CLI-user flows
619
-
620
- If an AWS key is exposed publicly, rotate/delete it immediately even if IndraQ has an encrypted copy.
621
-
622
- ---
623
-
624
- # 11. Create a project with `indraq init`
625
-
626
- The recommended project entry point is:
627
-
628
- ```powershell
629
- indraq init
630
- ```
631
-
632
- Or initialize another directory:
633
-
634
- ```powershell
635
- indraq init my-app
636
- ```
637
-
638
- ## Login check
639
-
640
- `init` verifies that the user is connected and authenticated to IndraQ Cloud. If required, it guides the user through Cloud configuration/login.
641
-
642
- ## New project
643
-
644
- The wizard supports:
645
-
646
- - Frontend
647
- - Backend
648
- - Frontend + Backend
649
- - Mobile App
650
-
651
- Web/frontend options include supported project templates such as Vite/React/Next/vanilla depending on the selected flow.
652
-
653
- Backend scaffolding includes Express and optional integrations selected in the wizard.
654
-
655
- ## Dependency installation
656
-
657
- For web projects, IndraQ links the project to Cloud **before** dependency installation.
658
-
659
- This is deliberate. If npm is unavailable, a registry is temporarily unreachable, or installation fails, the Cloud project is not lost.
660
-
661
- IndraQ:
662
-
663
- 1. creates the project files
664
- 2. creates/links the Cloud project
665
- 3. runs npm installation
666
- 4. retries compatible npm execution paths where appropriate
667
- 5. reports any component where installation is still pending
668
- 6. continues the project/infrastructure workflow
669
-
670
- If npm still cannot install dependencies, the CLI prints the exact folders where you should run:
671
-
672
- ```powershell
673
- npm install
674
- ```
675
-
676
- You can intentionally skip installation:
677
-
678
- ```powershell
679
- indraq init --skip-install
680
- ```
681
-
682
- Generated npm package names are sanitized so display names containing spaces or uppercase characters do not create invalid package names.
683
-
684
- ## Full setup vs project only
685
-
686
- After project creation, choose:
687
-
688
- ```text
689
- Full setup now GHCR + Jenkins + Route53 + NPM
690
- ```
691
-
692
- or:
693
-
694
- ```text
695
- Project only I will run prebuild later
696
- ```
697
-
698
- Choosing project-only still leaves a valid Cloud-linked project.
699
-
700
- Run infrastructure setup later with:
701
-
702
- ```powershell
703
- indraq prebuild
704
- ```
705
-
706
- ## Existing IndraQ project
707
-
708
- If `.indraq/project.json` already exists, `init` does not blindly recreate the application.
709
-
710
- It checks the existing Cloud project and offers to reconcile pending:
711
-
712
- - GHCR
713
- - Jenkins
714
- - Route53
715
- - NPM
716
-
717
- This means rerunning `indraq init` is useful when a previous setup was intentionally skipped or interrupted.
718
-
719
- ## Existing non-IndraQ project
720
-
721
- If files already exist but the folder was not initialized by IndraQ, the CLI warns that generated files may be overwritten.
722
-
723
- It requires two confirmations, including typing:
724
-
725
- ```text
726
- OVERWRITE
727
- ```
728
-
729
- No existing project should be overwritten silently.
730
-
731
- ---
732
-
733
- # 12. Project Cloud registration and linking
734
-
735
- ## Register an existing application without running `init`
736
-
737
- If you already have a project and only want IndraQ to manage its Cloud identity/infrastructure, run this from the existing project folder:
738
-
739
- ```powershell
740
- indraq project create
741
- ```
742
-
743
- This command is intentionally non-destructive. It:
744
-
745
- - verifies your IndraQ Cloud login
746
- - detects sensible defaults from `package.json` when possible
747
- - asks for project type/framework/port metadata where needed
748
- - creates the Cloud project
749
- - creates only `.indraq/project.json` locally
750
-
751
- It does **not** scaffold source code, run `npm install`, generate a Dockerfile, create AWS records, create NPM proxies, create Jenkins jobs, configure GHCR, run prebuild, or deploy anything.
752
-
753
- Example for an existing Express API:
754
-
755
- ```powershell
756
- cd cloud-api
757
- indraq project create cloud-api --kind backend --framework express --port 4010 --health /health
758
- ```
759
-
760
- After that you can run infrastructure commands independently:
761
-
762
- ```powershell
763
- indraq dockerfile create
764
- indraq jenkins create-deployment
765
- indraq healthcheck list
766
- indraq healthcheck create
767
- indraq healthcheck delete
768
-
769
- indraq dns create
770
- indraq proxy create
771
- ```
772
-
773
- Or reconcile everything later:
774
-
775
- ```powershell
776
- indraq prebuild
777
- ```
778
-
779
- If an accessible Cloud project with the same name already exists, IndraQ offers to link the folder to it instead of silently creating a duplicate.
780
-
781
- ## Sync older IndraQ project metadata
782
-
783
- For folders already initialized by an older IndraQ metadata format, create/update the Cloud project with:
784
-
785
- ```powershell
786
- indraq project sync
787
- ```
788
-
789
- Check infrastructure associations:
790
-
791
- ```powershell
792
- indraq project status
793
- ```
794
-
795
- The local project file becomes Cloud-oriented and primarily stores the project ID.
796
-
797
- Example:
798
-
799
- ```json
800
- {
801
- "schemaVersion": 3,
802
- "projectId": "..."
803
- }
804
- ```
805
-
806
- Provider passwords/tokens are not supposed to live in that file.
807
-
808
- ## Re-link a folder when `.indraq/project.json` is missing
809
-
810
- If the local project reference is deleted accidentally, do **not** recreate the project. Run:
811
-
812
- ```powershell
813
- indraq project link
814
- ```
815
-
816
- IndraQ lists the Cloud projects the logged-in user is allowed to access. Selecting one recreates only `.indraq/project.json`; application files are not modified.
817
-
818
- Every authenticated organization user can discover and view the project catalog. `indraq project list` shows whether the current account has `VIEW` or `WRITE` access. Managers/admins can manage project membership with audited reasons:
819
-
820
- ```powershell
821
- indraq project add user
822
- indraq project delete user
823
- ```
824
-
825
- VIEW access allows discovery/linking/inspection. WRITE access is required for infrastructure-changing commands such as prebuild. Cloud project update/delete remains manager/admin controlled and audited.
826
-
827
- ## Project resource access
828
-
829
- Project membership and provider-resource access are separate. Managers/admins can grant or revoke access to AWS, NPM, Jenkins, or all supported project resources:
830
-
831
- ```powershell
832
- indraq access add user
833
- indraq access delete user
834
- ```
835
-
836
- For AWS, IndraQ generates record-name/record-type/action conditions for granted Route53 records and exact health-check ARN permissions. AWS cannot safely hide individual records if `ListResourceRecordSets` is granted, so normal-user workflows rely on the IndraQ project inventory rather than broad hosted-zone listing.
837
-
838
- For Jenkins, IndraQ synchronizes Role Strategy item roles for the selected deployment jobs.
839
-
840
- For NPM, normal users retain NPM's creator-owned `visibility=user` model. IndraQ records project/resource grants but does not switch accounts to `visibility=all`, because that would expose proxy hosts created by other users.
841
-
842
- ---
843
-
844
- # 13. Prebuild: reconcile the complete web deployment
845
-
846
- For a Cloud-linked web project, run:
847
-
848
- ```powershell
849
- indraq prebuild
850
- ```
851
-
852
- Prebuild is an infrastructure reconciler. It checks what already exists, creates missing resources, and repairs supported stale associations instead of assuming every run starts from zero.
853
-
854
- Typical order:
855
-
856
- ```text
857
- User provider credentials
858
- |
859
- v
860
- GHCR project image
861
- |
862
- v
863
- Jenkins host-port validation
864
- |
865
- v
866
- Jenkins deployment job
867
- |
868
- v
869
- Route53 record + selected existing health checks
870
- |
871
- v
872
- Verify Route53 prerequisite
873
- |
874
- v
875
- NPM proxy + SSL
876
- ```
877
-
878
- ## Missing provider configuration
879
-
880
- If required reusable credentials are missing, IndraQ warns and offers to configure them instead of immediately failing with an unexplained configuration error.
881
-
882
- ## Shared environment or custom target
883
-
884
- For infrastructure targets, users can select an admin-created shared environment.
885
-
886
- Where supported, a custom IP/hostname option remains available for exceptional cases.
887
-
888
- ---
889
-
890
- # 14. Route53 DNS
891
-
892
- Standalone DNS wizard:
893
-
894
- ```powershell
895
- indraq dns create
896
- ```
897
-
898
- Other useful commands:
899
-
900
- ```powershell
901
- indraq dns zones
902
- indraq dns records
903
- indraq dns update
904
- indraq dns delete
905
- ```
906
-
907
- Supported routing choices for managed A-record flows:
908
-
909
- ```text
910
- SIMPLE
911
- FAILOVER
912
- WEIGHTED
913
- LATENCY
914
- ```
915
-
916
- ## FAILOVER
917
-
918
- For FAILOVER, the user chooses any two environments:
919
-
920
- ```text
921
- PRIMARY target -> production
922
- SECONDARY target -> production-backup
923
- ```
924
-
925
- The environments themselves are not permanently primary/secondary.
926
-
927
- The same environment can play a different role for another DNS record.
928
-
929
- ## Route53 health checks
930
-
931
- DNS creation does **not** create health checks automatically. Users and managers select from health checks that already exist in Route53. Only an IndraQ admin can create or delete health checks:
932
-
933
- ```powershell
934
- indraq healthcheck list
935
- indraq healthcheck create
936
- indraq healthcheck delete
937
- ```
938
-
939
- `healthcheck list` is available for selection/search. `healthcheck create` asks for the real AWS endpoint settings (IP/FQDN, protocol, port, path where applicable, request interval, failure threshold, and latency measurement).
940
-
941
- Routing behavior is enforced:
942
-
943
- - `SIMPLE`: no health check is attached.
944
- - `FAILOVER`: select existing PRIMARY and SECONDARY health checks.
945
- - `WEIGHTED` / `LATENCY`: attaching an existing health check is optional.
946
-
947
- ## WEIGHTED
948
-
949
- IndraQ asks for primary/secondary weights.
950
-
951
- ## LATENCY
952
-
953
- IndraQ asks for the AWS regions associated with the selected targets when required.
954
-
955
- ## SIMPLE
956
-
957
- Only one target is required.
958
-
959
- ---
960
-
961
- # 15. Nginx Proxy Manager proxy and SSL
962
-
963
- Standalone proxy creation:
964
-
965
- ```powershell
966
- indraq proxy create api.example.com
967
- ```
968
-
969
- Update/delete:
970
-
971
- ```powershell
972
- indraq proxy update api.example.com
973
- indraq proxy delete api.example.com
974
- ```
975
-
976
- ## Route53 prerequisite
977
-
978
- IndraQ verifies that the exact Route53 record exists before creating a new NPM proxy host.
979
-
980
- If the DNS record is missing, proxy creation stops before NPM creation. This avoids creating a proxy/certificate flow for a domain that has not been routed yet.
981
-
982
- ## Forward target
983
-
984
- The user can select a shared environment, for example:
985
-
986
- ```text
987
- production — 10.0.0.10
988
- staging — 10.0.1.10
989
- ```
990
-
991
- or choose a custom IP/hostname.
992
-
993
- ## SSL choices
994
-
995
- NPM creation includes explicit SSL selection:
996
-
997
- ```text
998
- Request Let's Encrypt certificate
999
- Use an existing NPM certificate
1000
- No SSL
1001
- ```
1002
-
1003
- For Let's Encrypt, IndraQ asks for the required email and certificate options.
1004
-
1005
- For an existing certificate, IndraQ lists available NPM certificates when possible so users do not have to remember a certificate ID.
1006
-
1007
- ---
1008
-
1009
- # 16. Jenkins deployment and port validation
1010
-
1011
- IndraQ checks the requested host port before final deployment creation.
1012
-
1013
- If the port is busy, the CLI reports it immediately and suggests available alternatives instead of waiting for a pipeline failure.
1014
-
1015
- Conceptually:
1016
-
1017
- ```text
1018
- Requested port: 6200
1019
- |
1020
- +-- free -> continue
1021
- |
1022
- +-- busy -> show suggested free ports -> ask again
1023
- ```
1024
-
1025
- Jenkins remains the final authority and should still validate the port during the pipeline/deployment itself.
1026
-
1027
- ## Create only the Jenkins deployment
1028
-
1029
- If DNS/NPM setup is not wanted yet, trigger only the Jenkins seed job:
1030
-
1031
- ```powershell
1032
- indraq jenkins create-deployment
1033
- ```
1034
-
1035
- This performs the aggressive host-port check, uses the selected user's GHCR owner/image, invokes `CREATE-DEPLOYMENT`, records the Jenkins project resource, and does **not** modify Route53 or NPM.
1036
-
1037
- Create/reconcile deployment infrastructure:
1038
-
1039
- ```powershell
1040
- indraq deployment create
1041
- ```
1042
-
1043
- This is backed by the same prebuild reconciliation flow.
1044
-
1045
- Run an existing configured deployment:
1046
-
1047
- ```powershell
1048
- indraq deployment run --env production
1049
- ```
1050
-
1051
- Build/push/deploy:
1052
-
1053
- ```powershell
1054
- indraq deploy build --env production
1055
- ```
1056
-
1057
- The shared environment name is not restricted to `dev` or `prod`.
1058
-
1059
- ---
1060
-
1061
- # 17. GHCR image naming
1062
-
1063
- The image path is built from the authenticated user's selected registry owner.
1064
-
1065
- Example provider configuration:
1066
-
1067
- ```text
1068
- Registry: ghcr.io
1069
- Owner: acme-platform
1070
- ```
1071
-
1072
- Project:
1073
-
1074
- ```text
1075
- order-service
1076
- ```
1077
-
1078
- Generated repository:
1079
-
1080
- ```text
1081
- ghcr.io/acme-platform/order-service
1082
- ```
1083
-
1084
- For full-stack projects, components can use separate image names, for example:
1085
-
1086
- ```text
1087
- ghcr.io/acme-platform/order-service-frontend
1088
- ghcr.io/acme-platform/order-service-backend
1089
- ```
1090
-
1091
- ---
1092
-
1093
- # 18. NPM user management
1094
-
1095
- Create:
1096
-
1097
- ```powershell
1098
- indraq npm-user create
1099
- ```
1100
-
1101
- Update:
1102
-
1103
- ```powershell
1104
- indraq npm-user update user@example.com
1105
- ```
1106
-
1107
- Delete:
1108
-
1109
- ```powershell
1110
- indraq npm-user delete user@example.com
1111
- ```
1112
-
1113
- These commands use the current logged-in user's reusable NPM provider credential.
1114
-
1115
- ---
1116
-
1117
- # 19. Dockerfile generation
1118
-
1119
- For an existing project:
1120
-
1121
- ```powershell
1122
- indraq dockerfile create
1123
- ```
1124
-
1125
- IndraQ does not try to guess which source/configuration files your application needs. Generated Dockerfiles copy the complete Docker build context with `COPY . .`; `.dockerignore` is the source of truth for files that must stay out of the image.
1126
-
1127
- Generated Alpine runtime images install `curl`, and Docker health checks use `curl -fsS`. This keeps container health validation available for Node and Nginx images without relying on whichever BusyBox utilities happen to be present.
1128
-
1129
- The generated `.dockerignore` excludes local dependencies, Git/IndraQ metadata, logs, coverage, caches, and previous build output. IndraQ intentionally does **not** ignore `.env` or `.env.*` files, so environment files present in the project directory are included in the Docker build context and baked into the resulting image according to the company's deployment policy.
1130
-
1131
- For Node backends and Next.js applications, the runtime stage copies the complete filtered build tree from the build stage, including generated output and production dependencies. For Vite/React static frontends, the build stage receives the complete filtered project context and Nginx serves only the compiled output directory.
1132
-
1133
- Dependency installation also works whether the project has a `package-lock.json` or not: IndraQ uses `npm ci` when a lockfile exists and falls back to `npm install` otherwise.
1134
-
1135
- Optional flags include framework, Node version, port, health endpoint, Compose generation, output directory, and force overwrite.
1136
-
1137
- Use command help for the current options:
1138
-
1139
- ```powershell
1140
- indraq dockerfile create --help
1141
- ```
1142
-
1143
- ---
1144
-
1145
- # 20. Mobile projects
1146
-
1147
- IndraQ also includes mobile project configuration/build commands.
1148
-
1149
- See:
1150
-
1151
- ```powershell
1152
- indraq help mobile
1153
- ```
1154
-
1155
- or:
1156
-
1157
- ```powershell
1158
- indraq build --help
1159
- ```
1160
-
1161
- Web deployment reconciliation through Route53/NPM is intended for web frontend/backend components. Mobile build behavior is separate.
1162
-
1163
- ---
1164
-
1165
- # 21. Audit logs
1166
-
1167
- Managers and admins can view audit logs:
1168
-
1169
- ```powershell
1170
- indraq logs
1171
- ```
1172
-
1173
- Sensitive Cloud/provider actions use audit reasons so administrative changes can be traced.
1174
-
1175
- Examples include:
1176
-
1177
- - user creation/deletion
1178
- - provider credential changes
1179
- - AWS credential storage/resolution
1180
- - environment changes
1181
- - project resource reconciliation
1182
-
1183
- ---
1184
-
1185
- # 22. Doctor
1186
-
1187
- Run:
1188
-
1189
- ```powershell
1190
- indraq doctor
1191
- ```
1192
-
1193
- Doctor checks the local IndraQ/Node environment and useful project/provider conditions.
1194
-
1195
- Use it when setup feels inconsistent before manually editing local configuration files.
1196
-
1197
- ---
1198
-
1199
- # 23. Recommended first-time setup
1200
-
1201
- ## Administrator
1202
-
1203
- 1. Start IndraQ Cloud API.
1204
- 2. Login as bootstrap admin.
1205
- 3. Create shared environments.
1206
- 4. Configure your own provider credentials.
1207
- 5. Configure AWS role-policy mappings if unified AWS user creation will be used.
1208
- 6. Create managers/users as required.
1209
-
1210
- Example:
1211
-
1212
- ```powershell
1213
- indraq login
1214
- indraq environment create
1215
- indraq environment create
1216
- indraq provider configure aws
1217
- indraq provider configure npm
1218
- indraq provider configure jenkins-dev
1219
- indraq provider configure jenkins-prod
1220
- indraq provider configure ghcr
1221
- indraq user create
1222
- ```
1223
-
1224
- ## Developer
1225
-
1226
- 1. Login to IndraQ Cloud.
1227
- 2. Configure the provider credentials that belong to you.
1228
- 3. Run `indraq init`.
1229
- 4. Select full infrastructure setup, or skip it and run `indraq prebuild` later.
1230
- 5. Start coding.
1231
-
1232
- Example:
1233
-
1234
- ```powershell
1235
- indraq login
1236
- indraq configure
1237
- indraq init my-service
1238
- ```
1239
-
1240
- ---
1241
-
1242
- # 24. Recommended daily workflow
1243
-
1244
- Inside an existing project:
1245
-
1246
- ```powershell
1247
- indraq whoami
1248
- indraq project status
1249
- indraq prebuild
1250
- indraq deploy build --env production
1251
- ```
1252
-
1253
- You do not need to re-enter AWS/NPM/Jenkins/GHCR credentials for every project.
1254
-
1255
- ---
1256
-
1257
- # 25. Common troubleshooting
1258
-
1259
- ## `npm install` fails during `indraq init`
1260
-
1261
- IndraQ links the Cloud project before dependency installation and should preserve setup even when installation fails.
1262
-
1263
- Look for the component paths printed by the CLI, then run:
1264
-
1265
- ```powershell
1266
- cd <component-folder>
1267
- npm install
1268
- ```
1269
-
1270
- Also verify:
1271
-
1272
- ```powershell
1273
- node --version
1274
- npm --version
1275
- npm config get registry
1276
- ```
1277
-
1278
- Use Node.js 22 or newer.
1279
-
1280
- ## Jenkins returns `403 No valid crumb was included`
1281
-
1282
- The current Jenkins administration client fetches the Jenkins crumb together with its session cookies and sends them together to `/scriptText`.
1283
-
1284
- If a 403 continues:
1285
-
1286
- - verify the configured Jenkins account can access the required administration endpoint
1287
- - verify reverse proxies are not stripping session cookies/headers
1288
- - verify Jenkins security settings/plugins expected by your setup
1289
- - prefer a Jenkins API token where appropriate
1290
-
1291
- Run the provider configuration again if credentials changed:
1292
-
1293
- ```powershell
1294
- indraq provider configure jenkins-dev
1295
- ```
1296
-
1297
- or:
1298
-
1299
- ```powershell
1300
- indraq provider configure jenkins-prod
1301
- ```
1302
-
1303
- ## Port is already in use
1304
-
1305
- IndraQ should detect the busy Jenkins host port before creating the deployment and offer suggested alternatives.
1306
-
1307
- Choose another suggested port and continue.
1308
-
1309
- ## NPM proxy creation says Route53 is missing
1310
-
1311
- Create/reconcile DNS first:
1312
-
1313
- ```powershell
1314
- indraq dns create
1315
- ```
1316
-
1317
- or run:
1318
-
1319
- ```powershell
1320
- indraq prebuild
1321
- ```
1322
-
1323
- Then retry the proxy.
1324
-
1325
- ## GHCR organization is missing from the selection
1326
-
1327
- The organization list is based on what the GitHub token can see.
1328
-
1329
- Check token access. If the required owner still cannot be enumerated, use the manual-owner fallback in the GHCR provider wizard.
1330
-
1331
- ## AWS secret is not visible in AWS anymore
1332
-
1333
- AWS does not re-display an existing secret access key.
1334
-
1335
- If the AWS user was created through IndraQ's unified user workflow and the encrypted credential was stored successfully, the logged-in target user can run:
1336
-
1337
- ```powershell
1338
- indraq iam credentials <aws-username>
1339
- ```
1340
-
1341
- Otherwise rotate/create a new AWS access key rather than attempting to recover an unavailable secret from AWS.
1342
-
1343
- ## Cloud API refuses to start because of `MASTER_KEY`
1344
-
1345
- `MASTER_KEY` must be exactly 64 hexadecimal characters.
1346
-
1347
- Generate one with:
1348
-
1349
- ```powershell
1350
- node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
1351
- ```
1352
-
1353
- Do not replace an existing production master key if encrypted credentials already exist.
1354
-
1355
- ---
1356
-
1357
- # 26. Security model
1358
-
1359
- ## Passwords
1360
-
1361
- IndraQ Cloud account passwords are hashed with bcrypt.
1362
-
1363
- ## Reusable provider secrets
1364
-
1365
- Provider secrets must be usable again for AWS/Jenkins/NPM/GHCR API calls, so they cannot be stored as one-way password hashes.
1366
-
1367
- They are encrypted at rest using AES-256-GCM with the Cloud API `MASTER_KEY`.
1368
-
1369
- ## Project files
1370
-
1371
- Project folders should not contain reusable provider secrets.
1372
-
1373
- The normal design is:
1374
-
1375
- ```text
1376
- local project -> project ID
1377
- Cloud user -> reusable encrypted provider credentials
1378
- Cloud project -> infrastructure associations
1379
- ```
1380
-
1381
- ## AWS IAM users
1382
-
1383
- IndraQ's IAM-user flow is intended for CLI/API users. AWS console login profiles are intentionally not created.
1384
-
1385
- ## Exposed credentials
1386
-
1387
- If any AWS key, GitHub token, Jenkins token, NPM password, or other credential is pasted into logs/chat/tickets or otherwise exposed, rotate it immediately. Encryption in IndraQ Cloud does not make a publicly exposed credential safe.
1388
-
1389
- ---
1390
-
1391
- # 27. Main command reference
1392
-
1393
- Use `--help` on any command for the authoritative current flags.
1394
-
1395
- ```text
1396
- indraq configure
1397
- indraq doctor
1398
-
1399
- indraq login
1400
- indraq logout
1401
- indraq whoami
1402
-
1403
- indraq environment create
1404
- indraq environment list
1405
- indraq environment update
1406
- indraq environment delete
1407
-
1408
- indraq provider configure
1409
- indraq provider list
1410
-
1411
- indraq user list
1412
- indraq user create
1413
- indraq user update
1414
- indraq user delete
1415
- indraq password reset
1416
-
1417
- indraq iam user:create
1418
- indraq iam user:delete
1419
- indraq iam credentials
1420
-
1421
- indraq dns zones
1422
- indraq dns records
1423
- indraq dns create
1424
- indraq dns update
1425
- indraq dns delete
1426
-
1427
- indraq proxy create
1428
- indraq proxy update
1429
- indraq proxy delete
1430
-
1431
- indraq npm-user create
1432
- indraq npm-user update
1433
- indraq npm-user delete
1434
-
1435
- indraq init
1436
- indraq project create
1437
- indraq project link
1438
- indraq project sync
1439
- indraq project status
1440
- indraq prebuild
1441
-
1442
- indraq deployment create
1443
- indraq deployment run
1444
- indraq deploy build
1445
-
1446
- indraq dockerfile create
1447
- indraq logs
1448
- ```
1449
-
1450
- For the complete live command reference:
1451
-
1452
- ```powershell
1453
- indraq --help
1454
- ```
1455
-
1456
- ---
1457
-
1458
- # 28. Legacy compatibility commands
1459
-
1460
- Provider credentials now live directly in IndraQ Cloud.
1461
-
1462
- The old-style credential commands remain only for compatibility:
1463
-
1464
- ```powershell
1465
- indraq credentials sync
1466
- indraq credentials restore
1467
- ```
1468
-
1469
- They do not represent the recommended local-file-to-Cloud workflow.
1470
-
1471
- Use instead:
1472
-
1473
- ```powershell
1474
- indraq provider configure <provider>
1475
- indraq provider list
1476
- ```
1477
-
1478
- ---
1479
-
1480
- # 29. Release verification
1481
-
1482
- Before deploying or distributing the CLI, run:
1483
-
1484
- ```powershell
1485
- npm install
1486
- npm run build
1487
- npm test
1488
- ```
1489
-
1490
- Cloud API:
1491
-
1492
- ```powershell
1493
- cd cloud-api
1494
- npm install
1495
- npm run build
1496
- ```
1497
-
1498
- Then perform a real integration test in your own environment because mocked regression tests cannot verify private AWS, Jenkins, NPM, GHCR, DNS, firewall, or server configuration.
1499
-
1500
- A useful end-to-end test is:
1501
-
1502
- 1. login
1503
- 2. create/list environments
1504
- 3. configure provider credentials
1505
- 4. create a disposable project with `indraq init`
1506
- 5. choose full setup
1507
- 6. verify Jenkins port validation
1508
- 7. verify Route53 routing and AWS health checks
1509
- 8. verify NPM SSL/proxy
1510
- 9. verify GHCR image owner/path
1511
- 10. rerun `indraq prebuild` and confirm resources are reconciled rather than duplicated
1512
-
1513
- ---
1514
-
1515
- # License
1516
-
1517
- MIT. See `LICENSE`.
1
+ <div align="center">
2
+ <img src="docs/assets/indraq-logo.png" alt="IndraQ" width="430" />
3
+
4
+ <h1>IndraQ CLI</h1>
5
+
6
+ <p><strong>One developer command center for project setup, access, infrastructure and deployments.</strong></p>
7
+
8
+ <p>
9
+ <img alt="npm" src="https://img.shields.io/badge/npm-v2.0.0-CB3837?logo=npm&logoColor=white" />
10
+ <img alt="Node.js" src="https://img.shields.io/badge/Node.js-22%2B-339933?logo=node.js&logoColor=white" />
11
+ <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-CLI-3178C6?logo=typescript&logoColor=white" />
12
+ <img alt="License" src="https://img.shields.io/badge/license-MIT-blue" />
13
+ </p>
14
+
15
+ <p>
16
+ <a href="#quick-start">Quick start</a> ·
17
+ <a href="#recommended-workflow-in-chronological-order">Workflow</a> ·
18
+ <a href="#command-reference">Commands</a> ·
19
+ <a href="#common-real-world-flows">Common flows</a> ·
20
+ <a href="#security-model">Security</a> ·
21
+ <a href="#troubleshooting">Troubleshooting</a>
22
+ </p>
23
+ </div>
24
+
25
+ > [!NOTE]
26
+ > This guide matches **IndraQ CLI v2.0.0**. For the exact flags supported by your installed version, use `indraq <command> --help`.
27
+
28
+ IndraQ CLI removes repetitive DevOps work from the developer path. Instead of opening Jenkins, AWS, Nginx Proxy Manager, GHCR and multiple configuration files for every project, you use one consistent CLI from the terminal.
29
+
30
+ ```mermaid
31
+ flowchart LR
32
+ A[Login] --> B[Configure providers once]
33
+ B --> C[Create or link project]
34
+ C --> D[Prebuild infrastructure]
35
+ D --> E[Build & deploy]
36
+ E --> F[Operate / audit]
37
+ ```
38
+
39
+ The key design is simple: **user credentials stay reusable and personal; project infrastructure stays attached to the project.** This lets the same provider configuration work across every project the user is allowed to access.
40
+
41
+
42
+ > [!TIP]
43
+ > **v2.0 lifecycle rule:** deleting a person deletes their Cloud/AWS/NPM/Jenkins identity, but **does not delete the project**. Jenkins DEV/PROD cleanup checks every configured controller. Adding another user to that project inherits its existing resource grants and synchronizes the provider-native access that can be safely scoped per user.
44
+
45
+ <details>
46
+ <summary><strong>📚 Table of contents</strong></summary>
47
+
48
+ - [Why use IndraQ?](#why-use-indraq)
49
+ - [The mental model](#the-mental-model)
50
+ - [Roles and permissions](#roles-and-permissions)
51
+ - [Quick start](#quick-start)
52
+ - [Recommended workflow](#recommended-workflow-in-chronological-order)
53
+ - [Command reference](#command-reference)
54
+ - [Help, diagnostics and authentication](#a-help-diagnostics-and-authentication)
55
+ - [Providers and environments](#b-reusable-providers-and-shared-environments)
56
+ - [Users and roles](#c-organization-users-and-roles)
57
+ - [Project access](#d-project-membership-and-resource-access)
58
+ - [Project lifecycle](#e-project-lifecycle)
59
+ - [Infrastructure and deployment](#f-infrastructure-reconciliation-and-deployment)
60
+ - [Jenkins](#g-jenkins-pipelines-deployments-and-users)
61
+ - [AWS IAM](#h-aws-iam-and-managed-access-keys)
62
+ - [Route53](#i-route53-dns-and-health-checks)
63
+ - [Nginx Proxy Manager](#j-nginx-proxy-manager-proxy-hosts-and-users)
64
+ - [Mobile builds](#k-mobile-builds)
65
+ - [Audit logs](#l-audit-logs)
66
+ - [Common real-world flows](#common-real-world-flows)
67
+ - [Security model](#security-model)
68
+ - [Troubleshooting](#troubleshooting)
69
+ - [Cloud API operator notes](#platform-operator-indraq-cloud-api)
70
+ - [Release checklist](#before-publishing-a-cli-release)
71
+
72
+ </details>
73
+
74
+ ---
75
+
76
+ ## Why use IndraQ?
77
+
78
+ | Problem without IndraQ | What IndraQ does |
79
+ | --- | --- |
80
+ | Developers remember IPs, ports, Jenkins jobs and registry paths | Uses named environments and stored project associations |
81
+ | Provider credentials are copied between projects | Stores reusable credentials once in IndraQ Cloud |
82
+ | New projects need repetitive folder, Docker and environment setup | `indraq init` scaffolds the project safely |
83
+ | DNS, proxy and Jenkins setup drift apart | `indraq prebuild` reconciles them as one workflow |
84
+ | User access has to be changed in several systems | Unified user create/update/delete synchronizes providers |
85
+ | Jenkins jobs require opening the browser and remembering parameters | CLI can discover, prompt for and run any visible pipeline |
86
+ | AWS keys are difficult to recover or rotate safely | IndraQ can store managed IAM credentials encrypted and rotate them |
87
+ | Nobody knows who changed infrastructure | Manager/admin operations are audited in IndraQ Cloud |
88
+
89
+ The result is not just fewer commands. The important benefit is **repeatability**: two developers following the same IndraQ workflow should reach the same infrastructure state without having to know every provider-specific detail.
90
+
91
+ ---
92
+
93
+ ## The mental model
94
+
95
+ IndraQ is easiest to understand as three connected layers:
96
+
97
+ ```mermaid
98
+ flowchart TB
99
+ U[Developer / Admin] --> CLI[IndraQ CLI]
100
+ CLI --> CLOUD[IndraQ Cloud]
101
+
102
+ CLOUD --> CREDS[Reusable provider credentials]
103
+ CREDS --> AWS[AWS]
104
+ CREDS --> NPM[Nginx Proxy Manager]
105
+ CREDS --> JDEV[Jenkins Dev]
106
+ CREDS --> JPROD[Jenkins Prod]
107
+ CREDS --> GHCR[GHCR]
108
+
109
+ CLOUD --> ENV[Shared named environments]
110
+ ENV --> PROD[production → 10.0.0.10]
111
+ ENV --> STAGE[staging → 10.0.1.10]
112
+
113
+ CLOUD --> PROJECT[Project associations]
114
+ PROJECT --> DNS[Route53]
115
+ PROJECT --> PROXY[Proxy / SSL]
116
+ PROJECT --> PIPE[Jenkins deployment]
117
+ PROJECT --> IMAGE[Container image]
118
+ ```
119
+
120
+ ### 1. Reusable provider credentials
121
+
122
+ Each IndraQ user can store their own credentials for AWS, Nginx Proxy Manager, Jenkins Development, Jenkins Production and GHCR. They are stored in IndraQ Cloud and reused across projects instead of being copied into every repository.
123
+
124
+ ### 2. Shared environments
125
+
126
+ Admins define friendly environment names such as `production`, `production-backup`, `staging` and `qa`. Developers select the name instead of memorizing an IP address.
127
+
128
+ ### 3. Project infrastructure
129
+
130
+ A Cloud project remembers the infrastructure associated with that application: image, Jenkins job, Route53 records and routing, health checks, NPM proxy/SSL, environment, ports and deployment metadata.
131
+
132
+ The local repository normally needs only the Cloud project reference:
133
+
134
+ ```text
135
+ .indraq/project.json
136
+ ```
137
+
138
+ ---
139
+
140
+ ## Roles and permissions
141
+
142
+ | Role | Typical responsibility |
143
+ | --- | --- |
144
+ | `user` | Work on permitted projects, configure personal providers, prebuild/deploy, use shared environments and manage their own supported credentials |
145
+ | `manager` | Everything a user can do, plus manage normal users, project membership/resource access, managed user AWS keys and audit logs |
146
+ | `admin` | Full organization control, including managers/admins, role changes, shared environments and admin-only Route53 health-check operations |
147
+
148
+ Important role rules:
149
+
150
+ - Managers can create and manage normal `user` accounts.
151
+ - Only admins can create managers/admins or change an existing IndraQ role.
152
+ - The last active admin cannot be deleted or demoted.
153
+ - An admin cannot use the role endpoint to demote their own active session.
154
+ - Role promotion/demotion is synchronized across linked managed providers before the Cloud role is committed.
155
+
156
+ Provider role mapping is intentional. Nginx Proxy Manager only provides `user` and `admin`, so IndraQ maps `manager` and `admin` to NPM `admin`. AWS and Jenkins use their IndraQ-managed role/policy mappings.
157
+
158
+ ```mermaid
159
+ flowchart LR
160
+ U[user] -->|admin promotes| M[manager]
161
+ M -->|admin promotes| A[admin]
162
+ A -->|admin demotes| M
163
+ M -->|admin demotes| U
164
+
165
+ M -. role sync .-> AWS[AWS policy]
166
+ M -. role sync .-> NPM[NPM role]
167
+ M -. role sync .-> J[Jenkins role]
168
+ ```
169
+
170
+ ---
171
+
172
+ # Quick start
173
+
174
+ ## 1. Install
175
+
176
+ Requirements:
177
+
178
+ - Node.js **22+**
179
+ - npm
180
+ - Git
181
+ - Docker when building/pushing Docker images
182
+ - network access to the IndraQ Cloud and providers you use
183
+
184
+ Install the published CLI:
185
+
186
+ ```powershell
187
+ npm install -g indraq_cli
188
+ ```
189
+
190
+ Check it:
191
+
192
+ ```powershell
193
+ indraq --version
194
+ indraq doctor
195
+ indraq --help
196
+ ```
197
+
198
+ When developing the CLI itself:
199
+
200
+ ```powershell
201
+ npm install
202
+ npm run build
203
+ npm test
204
+ npm link
205
+ ```
206
+
207
+ ---
208
+
209
+ ## 2. Login
210
+
211
+ ```powershell
212
+ indraq login
213
+ ```
214
+
215
+ Check the current identity:
216
+
217
+ ```powershell
218
+ indraq whoami
219
+ ```
220
+
221
+ The normal CLI uses the official IndraQ Cloud endpoint built into the package. Users do not need to configure an API URL manually.
222
+
223
+ If the account was created with a temporary password, the first login requires a new password before normal Cloud operations continue.
224
+
225
+ ---
226
+
227
+ ## 3. Configure your providers once
228
+
229
+ The easiest entry point is:
230
+
231
+ ```powershell
232
+ indraq configure
233
+ ```
234
+
235
+ It provides one menu for:
236
+
237
+ ```text
238
+ Reusable provider credentials
239
+ Current project infrastructure / prebuild
240
+ Mobile settings
241
+ Provider status
242
+ ```
243
+
244
+ You can also configure a provider directly:
245
+
246
+ ```powershell
247
+ indraq provider configure aws
248
+ indraq provider configure npm
249
+ indraq provider configure jenkins-dev
250
+ indraq provider configure jenkins-prod
251
+ indraq provider configure ghcr
252
+ ```
253
+
254
+ Review what is configured without exposing secrets:
255
+
256
+ ```powershell
257
+ indraq provider list
258
+ ```
259
+
260
+ ---
261
+
262
+ ## 4. Create or connect a project
263
+
264
+ For a brand-new application:
265
+
266
+ ```powershell
267
+ indraq init
268
+ ```
269
+
270
+ For an existing codebase that should become a new Cloud project without scaffolding it:
271
+
272
+ ```powershell
273
+ indraq project create
274
+ ```
275
+
276
+ For a folder that belongs to an existing Cloud project:
277
+
278
+ ```powershell
279
+ indraq project link
280
+ ```
281
+
282
+ Check the current association:
283
+
284
+ ```powershell
285
+ indraq project status
286
+ ```
287
+
288
+ ---
289
+
290
+ ## 5. Prepare infrastructure
291
+
292
+ ```powershell
293
+ indraq prebuild
294
+ ```
295
+
296
+ For web projects, prebuild is the main infrastructure reconciliation command. It discovers the current state and prepares only what the project needs.
297
+
298
+ ```mermaid
299
+ flowchart LR
300
+ P[indraq prebuild] --> G[GHCR image]
301
+ P --> R[Route53 DNS / routing]
302
+ P --> H[Health checks]
303
+ P --> N[NPM proxy / SSL]
304
+ P --> J[Jenkins deployment]
305
+ G --> S[Project resource associations]
306
+ R --> S
307
+ H --> S
308
+ N --> S
309
+ J --> S
310
+ ```
311
+
312
+ Use it for the first deployment **and** whenever infrastructure needs to be reconciled later.
313
+
314
+ ---
315
+
316
+ ## 6. Deploy
317
+
318
+ Deploy with a named shared environment:
319
+
320
+ ```powershell
321
+ indraq deploy build --env staging
322
+ ```
323
+
324
+ Common shortcuts:
325
+
326
+ ```powershell
327
+ indraq deploy:dev
328
+ indraq deploy:prod
329
+ ```
330
+
331
+ The deployment flow builds the Docker image, pushes it to the configured registry and runs the configured Jenkins deployment.
332
+
333
+ ---
334
+
335
+ # Recommended workflow in chronological order
336
+
337
+ ```mermaid
338
+ flowchart LR
339
+ D[1 · doctor] --> L[2 · login]
340
+ L --> C[3 · configure]
341
+ C --> E[4 · environments]
342
+ E --> P[5 · project]
343
+ P --> S[6 · status]
344
+ S --> B[7 · prebuild]
345
+ B --> DEP[8 · deploy]
346
+ DEP --> LOG[9 · logs]
347
+ ```
348
+
349
+ | Step | Command | Why it matters |
350
+ | ---: | --- | --- |
351
+ | 1 | `indraq doctor` | Verify the machine and CLI command resolution before debugging anything else |
352
+ | 2 | `indraq login` | Authenticate to the organization control plane |
353
+ | 3 | `indraq configure` | Store reusable provider credentials once |
354
+ | 4 | `indraq environment list` | See which admin-managed server targets are available |
355
+ | 5 | `indraq init` / `project create` / `project link` | Establish the project correctly before infrastructure work |
356
+ | 6 | `indraq project status` | Confirm which Cloud project and resources the folder is using |
357
+ | 7 | `indraq prebuild` | Reconcile DNS, proxy, image and Jenkins infrastructure |
358
+ | 8 | `indraq deploy build --env <name>` | Build, push and deploy the application |
359
+ | 9 | `indraq logs` | Audit administrative/infrastructure activity when investigating changes |
360
+
361
+ For normal daily work after initial setup, developers usually spend most of their time around `project status`, `prebuild`, deployment commands and Jenkins pipeline commands.
362
+
363
+ ---
364
+
365
+ # Command reference
366
+
367
+ > [!TIP]
368
+ > Read these tables as a **map of intent**. When you know what you want to do but not the exact flags, find the command here and then run `indraq <command> --help`.
369
+
370
+ `indraq --help` and `<command> --help` are the authoritative source for flags. The tables below explain **when to use each command and why it exists**.
371
+
372
+ Most list/select commands support some combination of:
373
+
374
+ ```text
375
+ --search <text> filter results
376
+ --limit <number> control the number loaded
377
+ --all load all results
378
+ ```
379
+
380
+ ## A. Help, diagnostics and authentication
381
+
382
+ | Command | Usage / importance |
383
+ | --- | --- |
384
+ | `indraq --help` | Show the complete live CLI command tree. Start here when you do not remember a command. |
385
+ | `indraq <command> --help` | Show flags and subcommands for one command. Best source for exact current syntax. |
386
+ | `indraq help [topic]` | Focused help for supported topics such as `configure`, `docker`, `mobile`, `aws` and `doctor`. |
387
+ | `indraq doctor` | Diagnose Node.js and command-resolution problems. Run this before deeper troubleshooting. |
388
+ | `indraq login` | Authenticate to IndraQ Cloud. Supports `--email` and `--password` for scripted use. |
389
+ | `indraq logout` | Remove the current Cloud session from the machine. |
390
+ | `indraq whoami` | Show the authenticated IndraQ identity. Useful before admin or production actions. |
391
+ | `indraq password reset` | Email-OTP password recovery for Cloud, NPM, Jenkins or all password-based accounts. AWS keys are intentionally separate. |
392
+ | `indraq cloud login` | Namespaced alias of `indraq login`. |
393
+ | `indraq cloud logout` | Namespaced alias of `indraq logout`. |
394
+ | `indraq cloud whoami` | Namespaced alias of `indraq whoami`. |
395
+
396
+ Examples:
397
+
398
+ ```powershell
399
+ indraq help aws
400
+ indraq whoami
401
+ indraq password reset --email user@example.com --all
402
+ ```
403
+
404
+ ---
405
+
406
+ ## B. Reusable providers and shared environments
407
+
408
+ Configure these before expecting project automation to work.
409
+
410
+ | Command | Usage / importance |
411
+ | --- | --- |
412
+ | `indraq configure` | Main configuration home. Recommended interactive entry point for providers, current-project prebuild and mobile settings. |
413
+ | `indraq provider configure [provider]` | Configure `aws`, `npm`, `jenkins-dev`, `jenkins-prod` or `ghcr` directly in Cloud. |
414
+ | `indraq provider list` | Show configured providers without exposing secrets. Useful before `prebuild`, user provisioning or Jenkins operations. |
415
+ | `indraq environment create` | **Admin:** create a reusable named server environment. Prevents users from memorizing IPs. |
416
+ | `indraq environment list` | List shared environments and targets. |
417
+ | `indraq environment update [name]` | **Admin:** update an environment target. Projects can keep using the friendly environment name. |
418
+ | `indraq environment delete [name]` | **Admin:** remove an environment. Use `--yes` only when intentionally bypassing confirmation. |
419
+ | `indraq credentials configure [provider]` | Compatibility namespace for provider configuration. Prefer `provider configure`. |
420
+ | `indraq credentials list` | Compatibility namespace for provider listing. Prefer `provider list`. |
421
+ | `indraq credentials sync` | Legacy credential synchronization command retained for compatibility. |
422
+ | `indraq credentials restore` | Legacy credential restore workflow retained for compatibility. |
423
+ | `indraq server create` | Deprecated alias that creates a shared environment. Prefer `environment create`. |
424
+ | `indraq server list` | Deprecated alias that lists shared environments. Prefer `environment list`. |
425
+
426
+ Example:
427
+
428
+ ```powershell
429
+ indraq environment create
430
+ indraq environment list --all
431
+ indraq provider configure jenkins-prod
432
+ indraq provider list
433
+ ```
434
+
435
+ ---
436
+
437
+ ## C. Organization users and roles
438
+
439
+ Unified user commands coordinate identities across IndraQ Cloud and selected configured providers.
440
+
441
+ | Command | Usage / importance |
442
+ | --- | --- |
443
+ | `indraq user list` | **Manager/admin:** list organization users. Use it before updates/deletion when you do not remember exact usernames. |
444
+ | `indraq user create [username]` | **Manager/admin:** create a Cloud user and selected AWS/NPM/Jenkins identities. If both Jenkins DEV and PROD are configured, both are preflighted and managed. |
445
+ | `indraq user update [username]` | Update selected providers. **Admin role changes are synchronized across linked managed providers before Cloud is changed.** |
446
+ | `indraq user delete [username]` | Permanently delete the person's managed identities. Project definitions and infrastructure stay intact. |
447
+
448
+ Useful examples:
449
+
450
+ ```powershell
451
+ indraq user create nitin --providers cloud,aws,npm,jenkins --role user
452
+ indraq user update nitin --role manager
453
+ indraq user update nitin --role user
454
+ indraq user delete nitin
455
+ ```
456
+
457
+ ### Role synchronization
458
+
459
+ When an admin changes a role, for example:
460
+
461
+ ```powershell
462
+ indraq user update nitin --role manager
463
+ ```
464
+
465
+ IndraQ reconciles linked providers before committing the Cloud role:
466
+
467
+ ```mermaid
468
+ flowchart LR
469
+ C[Role change requested] --> AWS[AWS policies]
470
+ AWS --> NPM[NPM role]
471
+ NPM --> JD[Jenkins DEV]
472
+ JD --> JP[Jenkins PROD]
473
+ JP --> CLOUD[IndraQ Cloud role · LAST]
474
+ AWS -. failure .-> RB[Best-effort rollback]
475
+ NPM -. failure .-> RB
476
+ JD -. failure .-> RB
477
+ JP -. failure .-> RB
478
+ ```
479
+
480
+ If an external role update fails, the Cloud role is not committed and already-changed external providers are rolled back on a best-effort basis.
481
+
482
+ ### Permanent deletion in v2.0
483
+
484
+ > [!WARNING]
485
+ > `indraq user delete` is a **real delete**, not a soft-disable command. Use it only when the person should be removed from the organization.
486
+
487
+ Deletion follows this order:
488
+
489
+ ```mermaid
490
+ flowchart LR
491
+ U[User delete] --> AWS[AWS identity]
492
+ AWS --> NPM[NPM identity]
493
+ NPM --> JD[Jenkins DEV if configured]
494
+ JD --> JP[Jenkins PROD if configured]
495
+ JP --> C[Cloud identity · LAST]
496
+ C --> KEEP[Projects / DNS / proxy / GHCR / Jenkins jobs remain]
497
+ ```
498
+
499
+ Important v2.0 behavior:
500
+
501
+ - If the Cloud identity is selected for hard deletion, IndraQ automatically expands cleanup to linked managed AWS/NPM identities and to every configured Jenkins controller. You cannot accidentally hard-delete Cloud while leaving a known managed Jenkins identity behind.
502
+ - Jenkins cleanup does **not** depend only on an old Cloud mapping; every Jenkins controller currently configured for the administrator is checked.
503
+ - A Jenkins username that is already absent counts as success.
504
+ - If an old release left a Jenkins identity behind, a later `user create` can reconcile that stale identity instead of being blocked by "user already exists".
505
+ - Cloud deletion is last. If an external provider genuinely fails, the Cloud identity is retained so cleanup can be retried safely.
506
+ - Project ownership/configuration is preserved or reassigned; user-specific memberships and grants are removed with the identity.
507
+
508
+ ---
509
+
510
+ ## D. Project membership and inherited access
511
+
512
+ In v2.0, **project membership is the primary project-access boundary**. Adding a user to a project grants all resources that already belong to that project, then synchronizes provider-native permissions where the provider supports safe per-user scoping.
513
+
514
+ | Command | Usage / importance |
515
+ | --- | --- |
516
+ | `indraq project add user` | **Manager/admin:** add a user to a project and inherit all existing project resource grants. AWS/Jenkins native access is synchronized immediately. |
517
+ | `indraq project delete user` | Remove project membership, delete that project's resource grants and resynchronize AWS/Jenkins permissions. |
518
+ | `indraq access add user` | Optional granular override: grant only selected project resources instead of relying on full project inheritance. |
519
+ | `indraq access delete user` | Revoke selected resource grants without removing the user from the whole project. |
520
+
521
+ ```mermaid
522
+ flowchart TD
523
+ A[project add user] --> M[Cloud project membership]
524
+ M --> G[Grant all current project resources]
525
+ G --> AWS[AWS scoped IAM policy]
526
+ G --> J[Jenkins item roles]
527
+ G --> N[NPM project grant in IndraQ]
528
+ G --> H[GHCR project grant in IndraQ]
529
+ J --> D[User can run project pipelines]
530
+ D --> H2[Jenkins uses project GHCR credential]
531
+ ```
532
+
533
+ > [!NOTE]
534
+ > AWS and Jenkins support safe native per-user project scoping, so IndraQ applies it automatically. Nginx Proxy Manager does not offer a safe per-proxy multi-owner ACL, and GHCR direct local push/pull requires the user's own GitHub/GHCR token. IndraQ therefore records those project grants without leaking an administrator credential or changing NPM visibility to `all`. Jenkins deployments can still use the project's stored GHCR credential.
535
+
536
+ Use `project delete user` when the person stays in the organization but should lose the entire project. Use `user delete` only when the person should be removed everywhere.
537
+
538
+ ---
539
+
540
+ ## E. Project lifecycle
541
+
542
+ | Command | Usage / importance |
543
+ | --- | --- |
544
+ | `indraq init [directory]` | Safely create a new application and IndraQ project setup. Use `--skip-install` when you want files generated without dependency installation. |
545
+ | `indraq project create [name]` | Register an **existing current folder** as a new Cloud project without scaffolding or infrastructure changes. |
546
+ | `indraq project list` | List organization projects and your VIEW/WRITE access. |
547
+ | `indraq project link` | Link/re-link the current folder to an existing accessible Cloud project. |
548
+ | `indraq project sync` | Migrate older local IndraQ metadata to the Cloud model and keep the local project reference minimal. |
549
+ | `indraq project status` | Show the current Cloud project and infrastructure associations, optionally for an environment. |
550
+ | `indraq dockerfile create` | Generate Docker support for an existing project without running the full `init` workflow. |
551
+
552
+ ### `indraq init`
553
+
554
+ Use this for a **new project**, not to overwrite a populated application accidentally.
555
+
556
+ The wizard can create supported frontend, backend, full-stack and mobile structures, environment files, ignore files and Docker support. Framework/version choices are collected interactively. Dependency installation can be skipped:
557
+
558
+ ```powershell
559
+ indraq init my-service --skip-install
560
+ ```
561
+
562
+ ### `indraq project create`
563
+
564
+ Use this when code already exists and only Cloud registration is needed:
565
+
566
+ ```powershell
567
+ indraq project create cloud-api --kind backend --framework express --port 4010 --health /health
568
+ ```
569
+
570
+ It does **not** scaffold source code, run `npm install`, or automatically create DNS/proxy/Jenkins infrastructure.
571
+
572
+ ### `indraq dockerfile create`
573
+
574
+ Common flags include:
575
+
576
+ ```text
577
+ --framework <framework>
578
+ --node-version <version>
579
+ --output <directory>
580
+ --port <port>
581
+ --health <endpoint>
582
+ --compose
583
+ --force
584
+ ```
585
+
586
+ ---
587
+
588
+ ## F. Infrastructure reconciliation and deployment
589
+
590
+ | Command | Usage / importance |
591
+ | --- | --- |
592
+ | `indraq prebuild` | Main web-infrastructure reconciliation command for GHCR, Route53, NPM and Jenkins. Run before first deployment and after infrastructure changes. |
593
+ | `indraq deployment create` | Deployment-oriented entry point to the prebuild/reconciliation flow. |
594
+ | `indraq deployment run --env <name>` | Run the configured deployment for a shared environment. |
595
+ | `indraq deploy build --env <name>` | Build Docker image, push it and run the Jenkins deployment. Primary explicit deploy command. |
596
+ | `indraq deploy configure` | Open the main configuration home from the deploy namespace. |
597
+ | `indraq deploy:configure` | Legacy/top-level alias for configuration. |
598
+ | `indraq deploy:dev` | Shortcut for deployment using the `dev`/development shared environment. |
599
+ | `indraq deploy:prod` | Shortcut for deployment using the `prod`/production shared environment. |
600
+
601
+ Useful prebuild flags:
602
+
603
+ ```text
604
+ --env <environment>
605
+ --secondary-env <environment>
606
+ --routing SIMPLE|FAILOVER|WEIGHTED|LATENCY
607
+ --host-port <port>
608
+ --networks <list>
609
+ --volumes <list>
610
+ --flags <flags>
611
+ --yes
612
+ ```
613
+
614
+ Example failover preparation:
615
+
616
+ ```powershell
617
+ indraq prebuild --env production --secondary-env production-backup --routing FAILOVER
618
+ ```
619
+
620
+ The purpose of prebuild is **reconciliation**, not blind creation. It should discover what already exists and create/update what the project requires.
621
+
622
+ ---
623
+
624
+ ## G. Jenkins: pipelines, deployments and users
625
+
626
+ Jenkins commands use the Jenkins credentials stored in the authenticated user's IndraQ Cloud profile.
627
+
628
+ | Command | Usage / importance |
629
+ | --- | --- |
630
+ | `indraq jenkins pipelines` | List all buildable jobs/pipelines visible to the Jenkins account, including jobs in folders. No default 10-job cap when `--limit` is omitted. |
631
+ | `indraq jenkins run [job]` | Select/run any visible pipeline. IndraQ discovers its Jenkins parameters and prompts for values. |
632
+ | `indraq jenkins pipeline:run [job]` | Long-form alias of `jenkins run`. |
633
+ | `indraq jenkins create-deployment` | Trigger only the Jenkins `CREATE-DEPLOYMENT` workflow for a component; it does not create Route53/NPM resources. |
634
+ | `indraq jenkins deployments` | List Jenkins deployment jobs. |
635
+ | `indraq jenkins deployment:update [job]` | Reconcile a deployment through `CREATE-DEPLOYMENT`. |
636
+ | `indraq jenkins deployment:delete [job]` | Delete a Jenkins deployment job after confirmation. |
637
+ | `indraq jenkins users` | List Jenkins users visible to the configured admin-capable identity. |
638
+ | `indraq jenkins user:update [username]` | Update a Jenkins user's password/roles directly. Unified organization role changes should normally use `indraq user update`. |
639
+ | `indraq jenkins user:delete [username]` | Delete a Jenkins user directly. Unified organization deletion should normally use `indraq user delete`. |
640
+
641
+ Choose Jenkins environment explicitly when useful:
642
+
643
+ ```powershell
644
+ indraq jenkins pipelines --stage dev
645
+ indraq jenkins pipelines --stage prod
646
+ ```
647
+
648
+ ### Run any Jenkins pipeline
649
+
650
+ ```mermaid
651
+ sequenceDiagram
652
+ participant U as User
653
+ participant C as IndraQ CLI
654
+ participant J as Jenkins
655
+ U->>C: indraq jenkins run
656
+ C->>J: Discover visible jobs
657
+ J-->>C: Jobs + parameter definitions
658
+ C-->>U: Prompt required / optional parameters
659
+ U->>C: Values
660
+ C->>J: Trigger build
661
+ J-->>C: Queue / build status
662
+ C-->>U: Result
663
+ ```
664
+
665
+ Interactive selection:
666
+
667
+ ```powershell
668
+ indraq jenkins run
669
+ ```
670
+
671
+ Direct job name:
672
+
673
+ ```powershell
674
+ indraq jenkins run api-admin-service --stage dev
675
+ ```
676
+
677
+ Folder jobs are supported using their full job path when visible.
678
+
679
+ IndraQ inspects the job's parameter definitions. Parameters with a usable Jenkins default are shown as **optional**; parameters without one are treated as **required**. Boolean, choice, password, text and string parameters get appropriate prompts.
680
+
681
+ By default the CLI waits for completion. To queue and return immediately:
682
+
683
+ ```powershell
684
+ indraq jenkins run api-admin-service --stage dev --no-wait
685
+ ```
686
+
687
+ ### Create only a Jenkins deployment
688
+
689
+ Use this when DNS and proxy already exist or you intentionally want Jenkins only:
690
+
691
+ ```powershell
692
+ indraq jenkins create-deployment --stage dev --component backend --image-name api-service --host-port 5010
693
+ ```
694
+
695
+ Common optional deployment fields include networks, volumes and Docker flags.
696
+
697
+ ---
698
+
699
+ ## H. AWS IAM and managed access keys
700
+
701
+ IndraQ IAM users are designed for CLI/API access. Console login is intentionally not part of the IAM-user flow.
702
+
703
+ | Command | Usage / importance |
704
+ | --- | --- |
705
+ | `indraq iam users` | List AWS IAM users. |
706
+ | `indraq iam user:create [username]` | Create an IAM user and normally an access key; optional managed policy ARNs can be attached. |
707
+ | `indraq iam user:update [username]` | Update attached managed policies for an IAM user. |
708
+ | `indraq iam user:delete [username]` | Delete an IAM user and removable dependencies after confirmation. |
709
+ | `indraq iam credentials [username]` | Reveal the authenticated user's own IndraQ-managed AWS access key/secret stored encrypted in Cloud. |
710
+ | `indraq iam access-key rotate [username]` | Rotate an IndraQ-managed IAM access key safely; manager/admin can select managed organization users when authorized. |
711
+
712
+ Examples:
713
+
714
+ ```powershell
715
+ indraq iam users --all
716
+ indraq iam user:create nitin
717
+ indraq iam credentials nitin
718
+ indraq iam access-key rotate nitin --reason "Quarterly credential rotation"
719
+ ```
720
+
721
+ AWS does not reveal an old secret access key again after creation. For AWS identities created through the managed IndraQ workflow, the generated secret can be stored encrypted in IndraQ Cloud so the owner can retrieve it later through the authorized CLI command.
722
+
723
+ During rotation, IndraQ creates/stores the replacement managed key before removing the previous managed key so the recovery record does not point to a key that was never successfully created.
724
+
725
+ ---
726
+
727
+ ## I. Route53 DNS and health checks
728
+
729
+ | Command | Usage / importance |
730
+ | --- | --- |
731
+ | `indraq dns zones` | List Route53 hosted zones available to the configured AWS identity. |
732
+ | `indraq dns records` | List records in a hosted zone. Use `--zone` when scripting. |
733
+ | `indraq dns create [record]` | Create a Route53 record interactively or with flags. |
734
+ | `indraq dns update [record]` | UPSERT/reconcile a Route53 record. |
735
+ | `indraq dns delete [record]` | Select/delete Route53 record set(s). |
736
+ | `indraq healthcheck list` | List/select Route53 health checks. |
737
+ | `indraq healthcheck create` | **Admin:** create a Route53 health check. |
738
+ | `indraq healthcheck delete [id]` | **Admin:** delete a Route53 health check. |
739
+
740
+ Supported record types exposed by the command include:
741
+
742
+ ```text
743
+ A
744
+ CNAME
745
+ TXT
746
+ MX
747
+ ```
748
+
749
+ Supported routing choices include:
750
+
751
+ ```text
752
+ SIMPLE
753
+ FAILOVER
754
+ WEIGHTED
755
+ LATENCY
756
+ ```
757
+
758
+ Example:
759
+
760
+ ```powershell
761
+ indraq dns create api.example.com --type A --environment production --routing SIMPLE
762
+ ```
763
+
764
+ Failover example:
765
+
766
+ ```powershell
767
+ indraq dns create api.example.com `
768
+ --type A `
769
+ --environment production `
770
+ --secondary-environment production-backup `
771
+ --routing FAILOVER
772
+ ```
773
+
774
+ ```mermaid
775
+ flowchart TB
776
+ DNS[api.example.com] --> R53[Route53 failover]
777
+ R53 -->|PRIMARY · healthy| P[production]
778
+ R53 -->|PRIMARY · unhealthy| S[production-backup]
779
+ HC[Health check] -. status .-> R53
780
+ ```
781
+
782
+ Health checks are especially important for failover designs because Route53 needs a reliable signal to decide whether a primary target is healthy.
783
+
784
+ ---
785
+
786
+ ## J. Nginx Proxy Manager: proxy hosts and users
787
+
788
+ ### Proxy hosts
789
+
790
+ | Command | Usage / importance |
791
+ | --- | --- |
792
+ | `indraq proxy list` | List NPM proxy hosts. |
793
+ | `indraq proxy create [domain]` | Create a reverse proxy, with optional certificate/SSL/WebSocket settings. |
794
+ | `indraq proxy update [domain]` | Update an existing proxy host. |
795
+ | `indraq proxy delete [domain]` | Delete a proxy host after confirmation. |
796
+
797
+ Common proxy options include:
798
+
799
+ ```text
800
+ --forward-host <host>
801
+ --environment <name>
802
+ --forward-port <port>
803
+ --scheme http|https
804
+ --certificate-id <id>
805
+ --request-ssl
806
+ --email <email>
807
+ --force-ssl
808
+ --http2
809
+ --websocket / --no-websocket
810
+ ```
811
+
812
+ Example:
813
+
814
+ ```powershell
815
+ indraq proxy create api.example.com --environment production --forward-port 5000 --request-ssl --force-ssl --http2
816
+ ```
817
+
818
+ ### NPM users
819
+
820
+ | Command | Usage / importance |
821
+ | --- | --- |
822
+ | `indraq npm-user list` | List Nginx Proxy Manager users. |
823
+ | `indraq npm-user create` | Create an NPM user directly. |
824
+ | `indraq npm-user update [identity]` | Update name, nickname, email, password, role or disabled state. |
825
+ | `indraq npm-user delete [identity]` | Delete an NPM user directly. |
826
+
827
+ For organization-wide lifecycle changes, prefer `indraq user create/update/delete` so Cloud, AWS, NPM and Jenkins stay synchronized.
828
+
829
+ ---
830
+
831
+ ## K. Mobile builds
832
+
833
+ Mobile build shortcuts are grouped under `indraq build`.
834
+
835
+ | Command | Usage / importance |
836
+ | --- | --- |
837
+ | `indraq build mobile:dev` | Build the mobile development environment. |
838
+ | `indraq build mobile:development` | Alias of `mobile:dev`. |
839
+ | `indraq build mobile:staging` | Build the mobile staging environment. |
840
+ | `indraq build mobile:prod` | Build the mobile production environment. |
841
+ | `indraq build mobile:production` | Alias of `mobile:prod`. |
842
+
843
+ Useful per-build overrides:
844
+
845
+ ```text
846
+ --output dev-client|debug-apk|apk|aab
847
+ --profile fast|clean|full-reset
848
+ --verbose
849
+ --dry-run
850
+ --yes
851
+ ```
852
+
853
+ Before a real upload/build, validate the plan when useful:
854
+
855
+ ```powershell
856
+ indraq build mobile:staging --dry-run
857
+ ```
858
+
859
+ Use `indraq configure` → **Mobile App settings** for the persistent mobile configuration.
860
+
861
+ ---
862
+
863
+ ## L. Audit logs
864
+
865
+ | Command | Usage / importance |
866
+ | --- | --- |
867
+ | `indraq logs` | **Manager/admin:** view IndraQ audit activity. Supports search/limit/all filtering. |
868
+
869
+ Example:
870
+
871
+ ```powershell
872
+ indraq logs --search user.role --all
873
+ ```
874
+
875
+ Audit logs are important when diagnosing who changed user roles, project access or infrastructure and why.
876
+
877
+ ---
878
+
879
+ # Common real-world flows
880
+
881
+ ```mermaid
882
+ flowchart TD
883
+ Q{What are you doing?}
884
+ Q -->|New person| U[user create project add user]
885
+ Q -->|Role change| R[user update --role]
886
+ Q -->|Remove person| X[user delete]
887
+ Q -->|New infrastructure| P[prebuild]
888
+ Q -->|Deploy code| D[deploy build]
889
+ Q -->|Run Jenkins job| J[jenkins run]
890
+ ```
891
+
892
+ | Goal | Recommended commands |
893
+ | --- | --- |
894
+ | Add a developer | `user create` → `project add user` (existing project resources are inherited automatically) |
895
+ | Promote/demote a person | `user update <name> --role manager|user` |
896
+ | Remove a person permanently | `user delete <name>` |
897
+ | Register an existing app | `project create` → `configure` → `prebuild` |
898
+ | Connect a checked-out repo | `project link` → `project status` |
899
+ | First web deployment | `prebuild --env <name>` → `deploy build --env <name>` |
900
+ | Later web deployment | `deploy build --env <name>` |
901
+ | Run an arbitrary Jenkins job | `jenkins pipelines` → `jenkins run` |
902
+ | Remove only project/resource access | `project delete user` / `access delete user` |
903
+
904
+ Use unified user commands for organization lifecycle changes. Direct AWS/NPM/Jenkins user commands are useful for provider-specific administration, but changing only one provider can intentionally create a state that differs from the IndraQ organization identity.
905
+
906
+ ---
907
+
908
+ # Security model
909
+
910
+ IndraQ automates privileged systems, so convenience must not come at the cost of uncontrolled credentials.
911
+
912
+ | Area | Design |
913
+ | --- | --- |
914
+ | Cloud login | Authenticated session stored for the CLI rather than re-entering passwords for every command |
915
+ | Provider credentials | Stored per IndraQ user in Cloud rather than in each project repository |
916
+ | Encryption | Sensitive reusable provider secrets use the Cloud `MASTER_KEY` for encrypted-at-rest storage |
917
+ | AWS managed keys | Secret access keys created through the managed workflow can be retained encrypted for authorized recovery/rotation |
918
+ | Project access | VIEW/WRITE and resource grants control who can change project infrastructure |
919
+ | Role updates | External linked providers are reconciled before the Cloud role is finalized |
920
+ | User deletion | AWS/NPM/Jenkins cleanup happens before permanent Cloud deletion; project configuration is retained |
921
+ | Auditing | Sensitive manager/admin actions require/record reasons where the API enforces them |
922
+
923
+ Never commit `.env` files containing real secrets, AWS credentials, Jenkins tokens, NPM passwords or GHCR tokens to Git.
924
+
925
+ Keep the Cloud `MASTER_KEY` stable. Changing or losing it after encrypted credentials are stored makes those existing encrypted values unreadable.
926
+
927
+ ---
928
+
929
+ # Troubleshooting
930
+
931
+ | Symptom | First checks |
932
+ | --- | --- |
933
+ | `indraq` is not found | Run `npm run build`, `npm link` (development), open a new terminal, then `indraq doctor` |
934
+ | Provider credentials are missing | `indraq provider list`, then `indraq provider configure <provider>` |
935
+ | Jenkins crumb/authorization error | Confirm the correct `--stage` and that the stored Jenkins account has enough permission for that operation |
936
+ | Jenkins host port is busy | Choose another validated/suggested free host port before deployment creation |
937
+ | `prebuild` cannot reconcile resources | Check `whoami` → `project status` → `provider list` → `environment list`, then rerun |
938
+ | Unified deletion stops on a provider | Repair the genuine provider failure and retry; Cloud deletion is retained until external cleanup can complete |
939
+
940
+ For command syntax, use `indraq <command> --help` rather than guessing flags.
941
+
942
+ ---
943
+
944
+ # Platform operator: IndraQ Cloud API
945
+
946
+ Most CLI users can skip this section. The team operating `api.indraq.com` should use `cloud-api/README.md` as the detailed server guide.
947
+
948
+ The Cloud API requires Node.js 22+, PostgreSQL, a strong `JWT_SECRET`, a persistent 64-hex-character `MASTER_KEY`, bootstrap-admin credentials for first startup, and SMTP when email password reset is enabled.
949
+
950
+ ```powershell
951
+ cd cloud-api
952
+ npm install
953
+ Copy-Item .env.example .env
954
+ npm run build
955
+ npm start
956
+ ```
957
+
958
+ Numbered SQL migrations in `cloud-api/sql/` run automatically at API startup. Do not casually replace `MASTER_KEY`; existing encrypted provider secrets depend on it.
959
+
960
+ More implementation detail:
961
+
962
+ ```text
963
+ cloud-api/README.md
964
+ docs/ARCHITECTURE.md
965
+ ```
966
+
967
+ ---
968
+
969
+ # Before publishing a CLI release
970
+
971
+ Run the complete verification sequence:
972
+
973
+ ```powershell
974
+ npm install
975
+ npm run build
976
+ npm test
977
+ npm pack --dry-run
978
+ ```
979
+
980
+ Inspect `npm pack --dry-run` before publishing. The package should contain the files required at runtime and must not contain private `.env` files, tokens, credentials or unrelated development artifacts.
981
+
982
+ Test the actual tarball when making a significant release:
983
+
984
+ ```powershell
985
+ npm pack
986
+ npm install -g .\indraq_cli-<version>.tgz
987
+ indraq --version
988
+ indraq doctor
989
+ indraq --help
990
+ ```
991
+
992
+ Then publish only after the packaged build behaves correctly:
993
+
994
+ ```powershell
995
+ npm publish --dry-run
996
+ npm publish
997
+ ```
998
+
999
+ ---
1000
+
1001
+ # Where to go next
1002
+
1003
+ For day-to-day usage, these four commands cover most questions:
1004
+
1005
+ ```powershell
1006
+ indraq --help
1007
+ indraq configure
1008
+ indraq project status
1009
+ indraq prebuild
1010
+ ```
1011
+
1012
+ For deployments:
1013
+
1014
+ ```powershell
1015
+ indraq deploy build --env <environment>
1016
+ ```
1017
+
1018
+ For Jenkins automation:
1019
+
1020
+ ```powershell
1021
+ indraq jenkins pipelines
1022
+ indraq jenkins run
1023
+ ```
1024
+
1025
+ For exact flags on anything:
1026
+
1027
+ ```powershell
1028
+ indraq <command> --help
1029
+ ```
1030
+
1031
+ ---
1032
+
1033
+ # License
1034
+
1035
+ MIT © IndraQ Innovations
1036
+
1037
+ ---
1038
+
1039
+ <div align="center">
1040
+ <img src="docs/assets/indraq-mark.png" alt="IndraQ Mark" width="54" />
1041
+ <p><strong>Built and maintained by IndraQ Innovations.</strong></p>
1042
+ <sub>Automate the repetitive work. Keep infrastructure predictable.</sub>
1043
+ </div>