@bluealba/platform-cli 1.1.1-alpha.0 → 1.2.0-alpha.1

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.
@@ -167,12 +167,18 @@ platform <command-name> key1=value1 key2=value2
167
167
 
168
168
  **Description**: Adds a new application to an existing platform. An application is an independent domain (e.g. "Billing", "HR") that can include a backend service, a UI module, or both. The command adds the application to the product manifest and optionally scaffolds the service and UI skeletons.
169
169
 
170
- **Requires a platform**: Yes.
170
+ **Requires a platform**: No — when run outside a platform, additional prompts for platform name and organization name are shown, and configuration is saved to the standalone config cache.
171
+
172
+ <Aside type="note" title="Dual-mode behavior">
173
+ `create-application` works whether or not you are inside a platform repository. Inside a platform, it reads the product manifest and registers the application there. Outside a platform, it prompts for `platformName` and `organizationName`, scaffolds a standalone application monorepo, and saves initial configuration to `~/.ba-platform/standalone.json` so you can immediately use `platform standalone`.
174
+ </Aside>
171
175
 
172
176
  ### Interactive prompts
173
177
 
174
178
  | Prompt | Description |
175
179
  |--------|-------------|
180
+ | Platform name | Only shown when outside a platform — machine name for the platform (lowercase, hyphens only; e.g. `myplatform`) |
181
+ | Organization name | Only shown when outside a platform — npm scope / organization identifier (e.g. `myorg`) |
176
182
  | Application name | Machine name (lowercase, hyphens only; e.g. `billing`) |
177
183
  | Application display name | Human-readable title (e.g. `Billing`) |
178
184
  | Application description | Short description of the application's purpose |
@@ -188,6 +194,8 @@ platform <command-name> key1=value1 key2=value2
188
194
  | `applicationDescription` | Yes | Short description |
189
195
  | `hasUserInterface` | No | `yes` or `no` (default: `no`) |
190
196
  | `hasBackendService` | No | `yes` or `no` (default: `no`) |
197
+ | `platformName` | Outside a platform only | Machine name for the platform (lowercase letters, numbers, and hyphens) |
198
+ | `organizationName` | Outside a platform only | npm scope / organization identifier |
191
199
 
192
200
  ### Example
193
201
 
@@ -198,7 +206,7 @@ platform <command-name> key1=value1 key2=value2
198
206
  # Press / then type "create-application" and press Enter
199
207
  ```
200
208
  </TabItem>
201
- <TabItem label="Headless">
209
+ <TabItem label="Headless (inside a platform)">
202
210
  ```bash
203
211
  platform create-application \
204
212
  applicationName=billing \
@@ -208,6 +216,25 @@ platform <command-name> key1=value1 key2=value2
208
216
  hasBackendService=yes
209
217
  ```
210
218
  </TabItem>
219
+ <TabItem label="Headless (outside a platform)">
220
+ ```bash
221
+ platform create-application \
222
+ platformName=myplatform \
223
+ organizationName=myorg \
224
+ applicationName=billing \
225
+ applicationDisplayName="Billing" \
226
+ applicationDescription="Invoice and payment management" \
227
+ hasUserInterface=yes \
228
+ hasBackendService=yes
229
+ ```
230
+
231
+ After the command completes, navigate into the new directory and start standalone mode:
232
+
233
+ ```bash
234
+ cd myplatform-billing
235
+ platform standalone
236
+ ```
237
+ </TabItem>
211
238
  </Tabs>
212
239
 
213
240
  ---
@@ -462,6 +489,243 @@ The command presents a looping menu with four options:
462
489
 
463
490
  ---
464
491
 
492
+ ## standalone
493
+
494
+ **Description**: Starts the platform in standalone mode for the current application. Scaffolds a temporary platform core in `/tmp/platform-standalone-{platformName}/`, installs dependencies, builds, starts Docker containers, waits for the gateway to become healthy, and configures IDP and admin users. Auto-detects app identity from the bootstrap service configuration. Press Ctrl+C to stop and clean up, or use the `detach` flag to run in the background.
495
+
496
+ **Requires a platform**: No — requires being in an application monorepo root (must have `docker-compose.yml` and `package.json`, and must not be inside an initialized platform).
497
+
498
+ <Aside type="note" title="Context-aware visibility">
499
+ `standalone` is visible in the command palette only when the current directory is an application monorepo and no platform core is initialized nearby. It is hidden when inside a full platform repository.
500
+ </Aside>
501
+
502
+ ### Interactive prompts
503
+
504
+ When no configuration exists for the detected application, the CLI runs a setup wizard:
505
+
506
+ | Prompt | Description |
507
+ |--------|-------------|
508
+ | Platform name | Pre-filled from auto-detection or existing defaults |
509
+ | Organization name | Pre-filled from existing defaults if available |
510
+ | Application name | Pre-filled from auto-detection |
511
+ | Application display name | Pre-filled from auto-detection |
512
+ | Select IDP provider | Single-select: Okta or Entra ID (skipped if a default IDP exists and you confirm reuse) |
513
+ | Provider name, Issuer URL, Client ID, Client Secret | IDP credentials |
514
+ | Admin user(s) | One or more email addresses (first pre-filled from `git config user.email`) |
515
+ | Run in detached mode? | Whether to start in the background |
516
+
517
+ Once configuration is saved, subsequent runs skip the wizard and start immediately.
518
+
519
+ ### Headless arguments
520
+
521
+ | Argument | Required | Description |
522
+ |----------|----------|-------------|
523
+ | `detach` | No | `true` to run in the background (also accepted as `-d` flag) |
524
+
525
+ <Aside type="caution" title="Headless prerequisites">
526
+ In headless mode, `platform standalone` requires that configuration already exists in `~/.ba-platform/standalone.json` for the detected application. Run it interactively at least once, or use `platform standalone-config-set` to pre-configure.
527
+ </Aside>
528
+
529
+ ### Example
530
+
531
+ <Tabs>
532
+ <TabItem label="Interactive (foreground)">
533
+ ```bash
534
+ cd myplatform-billing
535
+ platform standalone
536
+ # Follow the first-time setup wizard if needed
537
+ # Press Ctrl+C to stop
538
+ ```
539
+ </TabItem>
540
+ <TabItem label="Interactive (detached)">
541
+ ```bash
542
+ cd myplatform-billing
543
+ platform standalone
544
+ # When prompted "Run in detached mode?", answer yes
545
+ ```
546
+ </TabItem>
547
+ <TabItem label="Headless (detached)">
548
+ ```bash
549
+ cd myplatform-billing
550
+ platform standalone detach=true
551
+ ```
552
+ </TabItem>
553
+ </Tabs>
554
+
555
+ ---
556
+
557
+ ## standalone-stop
558
+
559
+ **Description**: Stops a detached standalone platform and cleans up the temporary platform core in `/tmp/`. Has no effect if no detached standalone platform is running.
560
+
561
+ **Requires a platform**: No.
562
+
563
+ ### Interactive behaviour
564
+
565
+ The command locates the running standalone instance by scanning `/tmp/` for a directory matching `platform-standalone-*` that contains a running marker. It tears down all Docker Compose services (removing containers and volumes) and deletes the temporary directory.
566
+
567
+ ### Headless
568
+
569
+ `standalone-stop` requires no arguments:
570
+
571
+ ```bash
572
+ platform standalone-stop
573
+ ```
574
+
575
+ ---
576
+
577
+ ## standalone-config-show
578
+
579
+ **Description**: Shows the resolved standalone configuration for the current application. If run from outside an application monorepo, shows the full contents of `~/.ba-platform/standalone.json` including defaults and all app entries.
580
+
581
+ **Requires a platform**: No.
582
+
583
+ ### Headless arguments
584
+
585
+ | Argument | Required | Description |
586
+ |----------|----------|-------------|
587
+ | `app` | No | Specific app to show, in `platformName/applicationName` format. Auto-detected from cwd if omitted. |
588
+
589
+ ### Example
590
+
591
+ <Tabs>
592
+ <TabItem label="Current app (auto-detected)">
593
+ ```bash
594
+ platform standalone-config-show
595
+ ```
596
+ </TabItem>
597
+ <TabItem label="Specific app">
598
+ ```bash
599
+ platform standalone-config-show app=myplatform/billing
600
+ ```
601
+ </TabItem>
602
+ <TabItem label="All config (from outside app dir)">
603
+ ```bash
604
+ cd ~
605
+ platform standalone-config-show
606
+ ```
607
+ </TabItem>
608
+ </Tabs>
609
+
610
+ ---
611
+
612
+ ## standalone-config-set
613
+
614
+ **Description**: Edits standalone configuration defaults or app-specific overrides. Defaults are shared across all applications; app overrides take precedence over defaults for the specific application.
615
+
616
+ **Requires a platform**: No.
617
+
618
+ ### Interactive prompts
619
+
620
+ The command first asks whether to edit defaults or app-specific config, then presents the relevant fields pre-filled with existing values. IDP and admin user fields can only be configured in interactive mode.
621
+
622
+ ### Headless arguments
623
+
624
+ | Argument | Required | Description |
625
+ |----------|----------|-------------|
626
+ | `defaults` | No | Set to `true` to edit the defaults section. Provide field values as additional key=value pairs. |
627
+ | `app` | No | App key in `platformName/applicationName` format to edit. Auto-detected from cwd if omitted. |
628
+ | `platformName` | No | Used with `defaults=true` |
629
+ | `organizationName` | No | Used with `defaults=true` |
630
+ | `applicationName` | No | Used with `app=...` |
631
+ | `applicationDisplayName` | No | Used with `app=...` |
632
+
633
+ <Aside type="note">
634
+ IDP credentials and admin user lists can only be set or updated through interactive mode. They cannot be passed as headless arguments.
635
+ </Aside>
636
+
637
+ ### Example
638
+
639
+ <Tabs>
640
+ <TabItem label="Interactive">
641
+ ```bash
642
+ platform standalone-config-set
643
+ # Select "Defaults" or "App-specific config" and follow prompts
644
+ ```
645
+ </TabItem>
646
+ <TabItem label="Edit defaults (headless)">
647
+ ```bash
648
+ platform standalone-config-set defaults=true platformName=myplatform organizationName=myorg
649
+ ```
650
+ </TabItem>
651
+ <TabItem label="Edit app (headless)">
652
+ ```bash
653
+ platform standalone-config-set app=myplatform/billing applicationDisplayName="Billing v2"
654
+ ```
655
+ </TabItem>
656
+ </Tabs>
657
+
658
+ ---
659
+
660
+ ## standalone-config-delete
661
+
662
+ **Description**: Deletes a saved standalone app config entry from `~/.ba-platform/standalone.json`. Defaults are not affected.
663
+
664
+ **Requires a platform**: No.
665
+
666
+ ### Interactive prompts
667
+
668
+ | Prompt | Description |
669
+ |--------|-------------|
670
+ | Select app config to delete | Single-select from all saved app entries |
671
+ | Confirm deletion | Yes/No confirmation before proceeding |
672
+
673
+ ### Headless arguments
674
+
675
+ | Argument | Required | Description |
676
+ |----------|----------|-------------|
677
+ | `app` | Yes | App key in `platformName/applicationName` format |
678
+
679
+ ### Example
680
+
681
+ <Tabs>
682
+ <TabItem label="Interactive">
683
+ ```bash
684
+ platform standalone-config-delete
685
+ # Select from list and confirm
686
+ ```
687
+ </TabItem>
688
+ <TabItem label="Headless">
689
+ ```bash
690
+ platform standalone-config-delete app=myplatform/billing
691
+ ```
692
+ </TabItem>
693
+ </Tabs>
694
+
695
+ ---
696
+
697
+ ## standalone-config-list
698
+
699
+ **Description**: Lists all applications that have standalone configuration saved in `~/.ba-platform/standalone.json`, along with their resolved settings.
700
+
701
+ **Requires a platform**: No.
702
+
703
+ ### Headless
704
+
705
+ `standalone-config-list` requires no arguments:
706
+
707
+ ```bash
708
+ platform standalone-config-list
709
+ ```
710
+
711
+ Example output:
712
+
713
+ ```
714
+ Config file: /Users/you/.ba-platform/standalone.json
715
+
716
+ Defaults:
717
+ Platform: myplatform
718
+ Organization: myorg
719
+ IDP: okta (My Okta)
720
+ Admin Users: you@example.com
721
+
722
+ Apps:
723
+ myplatform/billing — Billing [IDP: yes, Admins: 1]
724
+ myplatform/hr — HR [IDP: no, Admins: 1]
725
+ ```
726
+
727
+ ---
728
+
465
729
  ## Local Environment Commands
466
730
 
467
731
  The following five commands manage the lifecycle of your local Docker Compose environment. They all share the same target-selection model: when run interactively, they present a multi-select list of available targets (`Platform (Core)` plus each registered application); when run headlessly, target names are passed as positional arguments.
@@ -591,7 +855,7 @@ The following five commands manage the lifecycle of your local Docker Compose en
591
855
  |---------|--------------|-------------|
592
856
  | `init` | No | Initialize a new platform |
593
857
  | `configure-idp` | Yes | Configure an Identity Provider (Okta, Entra ID) |
594
- | `create-application` | Yes | Add an application to the platform |
858
+ | `create-application` | No | Add an application to a platform, or create a standalone application |
595
859
  | `create-service-module` | Yes | Add a NestJS backend service to an application |
596
860
  | `create-ui-module` | Yes | Add a React UI module to an application |
597
861
  | `status` | Yes | Show platform health and guide through next steps |
@@ -602,3 +866,9 @@ The following five commands manage the lifecycle of your local Docker Compose en
602
866
  | `start` | Yes | Start the local Docker Compose environment |
603
867
  | `stop` | Yes | Stop the local Docker Compose environment |
604
868
  | `destroy` | Yes | Destroy the local environment (removes volumes) |
869
+ | `standalone` | No (app monorepo) | Start the platform in standalone mode for this application |
870
+ | `standalone-stop` | No | Stop a detached standalone platform |
871
+ | `standalone-config-show` | No | Show resolved standalone config for current or specified app |
872
+ | `standalone-config-set` | No | Edit standalone config defaults or app-specific overrides |
873
+ | `standalone-config-delete` | No | Delete a saved standalone app config entry |
874
+ | `standalone-config-list` | No | List all apps with standalone config |
@@ -5,7 +5,7 @@ description: Introduction to the Blue Alba Platform CLI — how to install it, u
5
5
 
6
6
  import { Steps, Aside, Card, CardGrid, Tabs, TabItem } from '@astrojs/starlight/components';
7
7
 
8
- The `@bluealba/platform-cli` (invoked as `platform`) is the official scaffolding and management tool for the Blue Alba Platform. It handles the complete lifecycle of a platform environment: initializing a new product repository structure, adding applications and modules, configuring identity providers, managing local development environments, and checking platform health.
8
+ The `@bluealba/platform-cli` (invoked as `platform`) is the official scaffolding and management tool for the Blue Alba Platform. It handles the complete lifecycle of a platform environment: initializing a new product repository structure, adding applications and modules, configuring identity providers, managing local development environments, checking platform health, and running individual applications in standalone mode without a full product repository.
9
9
 
10
10
  The CLI ships in two modes that can be freely combined:
11
11
 
@@ -187,9 +187,32 @@ my-product/
187
187
 
188
188
  ---
189
189
 
190
+ ## Standalone Mode
191
+
192
+ Standalone mode lets you run a single application with a fully functional platform infrastructure — gateway, database, and bootstrap service — without setting up a full product repository. It is designed for rapid application development and testing in isolation.
193
+
194
+ ```bash
195
+ # Create a new standalone application
196
+ platform create-application \
197
+ platformName=myplatform \
198
+ organizationName=myorg \
199
+ applicationName=billing
200
+
201
+ # Navigate to the new app and start the platform
202
+ cd myplatform-billing
203
+ platform standalone
204
+ ```
205
+
206
+ IDP credentials and admin users are stored once in `~/.ba-platform/standalone.json` and reused automatically for all your standalone applications.
207
+
208
+ See [Standalone Mode](./standalone-mode/) for the complete guide.
209
+
210
+ ---
211
+
190
212
  ## Next Steps
191
213
 
192
214
  - [Command Reference](./commands/) — Complete documentation for every command
215
+ - [Standalone Mode](./standalone-mode/) — Run a single application without a full product repository
193
216
  - [Quick Start Guide](../getting-started/quick-start/) — Get the platform running for the first time
194
217
  - [Creating Services Guide](../guides/creating-services/) — Add a backend service to your platform
195
218
  - [Creating UI Modules Guide](../guides/creating-ui-modules/) — Add a React micro-frontend module