@equinor/fusion-framework-cli 11.0.0-next.0 → 11.0.0-next.3

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.
@@ -0,0 +1,644 @@
1
+ ---
2
+ title: Developing Apps with Fusion Framework CLI
3
+ description: >
4
+ In-depth guide to building, configuring, and deploying applications using the Fusion Framework CLI. Includes setup, essential commands, configuration files, CI/CD best practices, troubleshooting, and advanced tips for modern app development.
5
+ category: cli
6
+ related:
7
+ - ./auth.md
8
+ - ./migration-v10-to-v11.md
9
+ tags:
10
+ - getting-started
11
+ - app-development
12
+ - configuration
13
+ - deployment
14
+ - ci-cd
15
+ - commands
16
+ - troubleshooting
17
+ - release-management
18
+ - automation
19
+ - best-practices
20
+ - migration
21
+ keywords:
22
+ - fusion-framework-cli upload
23
+ - fusion-framework-cli publish
24
+ - fusion-framework-cli tag
25
+ - fusion-framework-cli config
26
+ - fusion-framework-cli build
27
+ - fusion-framework-cli pack
28
+ - fusion-framework-cli check
29
+ - fusion-framework-cli manifest
30
+ - fusion-framework-cli troubleshooting
31
+ - fusion-framework-cli deployment
32
+ - fusion-framework-cli ci-cd
33
+ - fusion app upload
34
+ - fusion app publish
35
+ - fusion app tag
36
+ - fusion app config
37
+ - fusion app build
38
+ - fusion app pack
39
+ - fusion app check
40
+ - fusion app manifest
41
+ - fusion app troubleshooting
42
+ - fusion app deployment
43
+ - fusion app ci-cd
44
+ - fusion cli command reference
45
+ - fusion cli options
46
+ - fusion cli arguments
47
+ ---
48
+
49
+ # Fusion Framework CLI: Application Development Guide
50
+
51
+ > **Table of Contents**
52
+ > - [Getting Started](#getting-started)
53
+ > - [Prerequisites](#prerequisites)
54
+ > - [Troubleshooting & FAQ](#troubleshooting--faq)
55
+ > - [Configuration](#configuration)
56
+ > - [CI/CD Best Practices](#cicd)
57
+ > - [Command Reference](#commands)
58
+ > - [Migration & Deprecated Commands](#aliases)
59
+
60
+ ---
61
+
62
+ The Fusion Framework CLI empowers you to rapidly build, configure, and deploy modern applications with ease. Whether you’re starting a new project or maintaining an existing app, this CLI streamlines your workflow—from local development to production deployment.
63
+
64
+ This guide will help you get set up, understand the most important commands, and follow best practices for configuration and CI/CD. Let’s get started building robust, scalable apps with Fusion Framework!
65
+
66
+ ## Getting Started
67
+
68
+ ### 1. Install the CLI
69
+
70
+ ```sh
71
+ pnpm add -D @equinor/fusion-framework-cli
72
+ # or
73
+ npm install --save-dev @equinor/fusion-framework-cli
74
+ ```
75
+
76
+ ### 2. Scaffold a New App (if supported)
77
+
78
+ > **Tip:** If you have a template or starter, clone it. Otherwise, create a new directory and initialize your project as below.
79
+
80
+ ```sh
81
+ mkdir my-fusion-app && cd my-fusion-app
82
+ pnpm init
83
+ ```
84
+
85
+ ### 3. Create Required Files
86
+
87
+ #### Minimal `package.json` Example
88
+
89
+ ```json
90
+ {
91
+ "name": "@equinor/fusion-framework-app",
92
+ "version": "0.0.0",
93
+ "description": "Fusion Framework App",
94
+ "main": "dist/index.js",
95
+ "files": [
96
+ "dist/"
97
+ ]
98
+ }
99
+ ```
100
+
101
+ #### Example `app.manifest.ts`
102
+
103
+ ```ts
104
+ import { defineAppManifest } from '@equinor/fusion-framework-cli/app';
105
+
106
+ export default defineAppManifest(async (env, { base }) => ({
107
+ ...base,
108
+ name: 'My Fusion App',
109
+ version: '0.0.1',
110
+ // Add more manifest fields as needed
111
+ }));
112
+ ```
113
+
114
+ #### Example `app.config.ts`
115
+
116
+ ```ts
117
+ import { defineAppConfig } from '@equinor/fusion-framework-cli/app';
118
+
119
+ export default defineAppConfig((env, args) => ({
120
+ environment: {
121
+ featureFlag: env === 'dev', // Example: enable feature in dev
122
+ logLevel: 'info',
123
+ customSetting: process.env.CUSTOM_SETTING || 'default-value',
124
+ },
125
+ endpoints: {
126
+ // Define endpoints here if needed, or leave empty
127
+ },
128
+ }));
129
+ ```
130
+
131
+ ### 4. Start the Development Server
132
+
133
+ ```sh
134
+ pnpm fusion-framework-cli dev
135
+ ```
136
+
137
+ ### 5. Log in to Fusion Framework (if needed)
138
+
139
+ ```sh
140
+ pnpm fusion-framework-cli auth login
141
+ ```
142
+
143
+ ### 6. Build, Publish, and Upload Config
144
+
145
+ ```sh
146
+ pnpm fusion-framework-cli publish --env <environment>
147
+ pnpm fusion-framework-cli app config --upload --env <environment>
148
+ ```
149
+
150
+ > **Tip:** For CI/CD and automation, set the `FUSION_TOKEN` environment variable. See [Authentication](./docs/auth.md) for details.
151
+
152
+ ---
153
+
154
+ ## Prerequisites
155
+
156
+ ### For Development
157
+ - **Node.js** (LTS recommended)
158
+ - **pnpm** (or npm/yarn)
159
+ - A Fusion Framework app template or an existing project
160
+
161
+ ### For Deployment
162
+ - Your application team must have registered an app in the Fusion Application Service (App Admin)
163
+ - A service principal must be set up for deployment and publishing
164
+
165
+ ---
166
+
167
+ ## Troubleshooting & FAQ
168
+
169
+ - **Node.js version error:** Ensure you are using a supported Node.js version (LTS recommended).
170
+ - **Authentication issues:** Make sure you are logged in and have the correct permissions for publishing. Use `pnpm fusion-framework-cli auth login`.
171
+ - **Missing manifest/config:** Ensure `app.manifest.ts` and `app.config.ts` exist in your project root.
172
+ - **Environment variables:** Use `.env` files or your CI/CD system to inject secrets and config values.
173
+ - **Command help:** Run any command with `--help` for detailed usage and options.
174
+ - **Still stuck?** See [Troubleshooting](#troubleshooting--faq) or [Authentication](./docs/auth.md).
175
+
176
+ ---
177
+
178
+ ## Configuration
179
+
180
+ Fusion Framework apps are configured using two main files:
181
+
182
+ - **Application Manifest (`app.manifest.ts`)**: Defines your app's metadata, capabilities, and integration points. Supports environment-specific variants (e.g., `app.manifest.dev.ts`).
183
+ - **Application Config (`app.config.ts`)**: Contains runtime configuration, such as environment variables and endpoints. Also supports environment-specific files (e.g., `app.config.dev.ts`).
184
+
185
+ These files allow you to tailor your app for different environments and deployment scenarios. See the sections below for details and examples.
186
+
187
+ ### Application Manifest
188
+
189
+ > [!IMPORTANT]
190
+ > The application manifest is bundled with your app during the build process. It should only be generated or referenced as part of the build step in your CI/CD pipeline. The environment-specific variants (e.g., `app.manifest.dev.ts`) are for convenience—useful for local development or testing different configurations, but only the manifest present at build time is included in the final bundle.
191
+
192
+ > [!TIP]
193
+ > If no environment-specific file is found, `app.manifest.ts` is used as a fallback.
194
+ > For environment-specific setup, add files like `app.manifest.dev.ts` for development or `app.manifest.ci.ts` for CI environments.
195
+
196
+ Create an `app.manifest.ts` file to define your app's manifest. This file describes your app's metadata and configuration:
197
+
198
+ > [!IMPORTANT]
199
+ > The function passed to `defineAppManifest` should either:
200
+ > - Return a new manifest object, **or**
201
+ > - Return `void` after mutating the provided `base` manifest (which is generated from your `package.json` and environment).
202
+ >
203
+ > Mutating the `base` manifest is useful if you want to extend or override values from your package metadata or environment, while returning a new object allows you to fully customize the manifest.
204
+
205
+ ```ts
206
+ import { defineAppManifest } from '@equinor/fusion-framework-cli/app';
207
+
208
+ export default defineAppManifest(async (env, { base }) => ({
209
+ // You can mutate the base object and return void,
210
+ // or return a new manifest object.
211
+ }));
212
+ ```
213
+
214
+ > [!NOTE]
215
+ > The CLI will only include the first matching manifest file based on the environment (e.g., `app.manifest.dev.ts`). It will not merge multiple files. If you need to combine settings from different files, you must handle the merging logic yourself within your manifest or config code. You can use the provided `mergeAppManifest` utility from the CLI package to help merge manifest objects when needed.
216
+
217
+ ### Application Config
218
+
219
+ > [!TIP]
220
+ > If no environment-specific file is found, `app.config.ts` is used as a fallback.
221
+ > For environment-specific setup, add files like `app.config.dev.ts` for development or `app.config.ci.ts` for CI environments.
222
+
223
+ Create an `app.config.ts` file to define your app's configuration. This file can export a function or object with your app's runtime configuration:
224
+
225
+ ```ts
226
+ import { defineAppConfig, mergeAppManifests } from '@equinor/fusion-framework-cli/app';
227
+ import createBaseConfig from './app.config';
228
+
229
+ export default defineAppConfig((env, args) => {
230
+ const base = createBaseConfig(env, args);
231
+ return mergeAppManifests(base, {
232
+ environment: {
233
+ someAttr: 'some value',
234
+ },
235
+ endpoints: {
236
+ 'my-end-point': {
237
+ url: 'https://my-api.com',
238
+ scopes: ['https://my-api.com'],
239
+ },
240
+ },
241
+ });
242
+ });
243
+ ```
244
+
245
+ > [!NOTE]
246
+ > The CLI will only include the first matching config file for the environment (e.g., `app.config.dev.ts`). It will not merge `app.config.ts` and `app.config.dev.ts` automatically. If you want to combine base and environment-specific settings, you must implement the merging logic yourself in your configuration code. The CLI provides utilities such as `mergeAppManifests` to assist with merging configuration objects.
247
+
248
+ ---
249
+
250
+ ## CI/CD
251
+
252
+ Continuous Integration and Continuous Deployment (CI/CD) automate the process of building, testing, and deploying your application. By integrating CI/CD pipelines, you ensure that code changes are validated and delivered to your environments efficiently and reliably. This section outlines how to set up CI/CD workflows for Fusion Framework apps.
253
+
254
+ ### Best Practice: Build Once, Deploy Many
255
+
256
+ A recommended approach for CI/CD with Fusion Framework apps is to build your application once and reuse the generated artifact for deployments to multiple environments. This ensures consistency across environments and speeds up your pipeline by avoiding redundant builds.
257
+
258
+ **Workflow Overview:**
259
+
260
+ 1. **Build Stage:**
261
+ Build and bundle your application a single time. Upload the resulting artifact (e.g., `app-bundle.zip`) as a pipeline artifact.
262
+
263
+ 2. **Deploy Stage (Matrix):**
264
+ Use a matrix strategy to deploy the same artifact to multiple environments (such as `ci`, `fqa`, `fprd`). For each environment, generate and upload the appropriate configuration using environment-specific variables or secrets.
265
+
266
+ This pattern minimizes discrepancies between environments and leverages CI/CD efficiency by separating build and deploy concerns.
267
+
268
+ ### Example CI/CD Workflow
269
+
270
+ Below is an example workflow that demonstrates the recommended "build once, deploy many" pattern for Fusion Framework apps. This workflow assumes you are familiar with setting up Node.js and managing pipeline artifacts in your CI/CD system.
271
+
272
+ ```yml
273
+ jobs:
274
+ build:
275
+ steps:
276
+ - name: Setup node
277
+ - name: Bundle application
278
+ id: bundle
279
+ working-directory: ${{ env.working-directory }}
280
+ run: pnpm exec fusion-framework-cli app pack
281
+ - name: Upload artifact
282
+ deploy:
283
+ environment: ${{ matrix.env }} # use deployment environments
284
+ strategy:
285
+ max-parallel: 1
286
+ matrix:
287
+ env: ['ci', 'fqa', 'fprd'] # Fusion Environments
288
+ steps:
289
+ - name: Setup node
290
+ - name: Download Artifact
291
+ - name: Set Fusion token
292
+ - name: Publish application
293
+ run: pnpm exec fusion-framework-cli app upload --env ${{ matrix.env }} app-bundle.zip
294
+ - step: Upload configuration
295
+ run: pnpm exec fusion-framework-cli app config --upload --env ${{ matrix.env }}
296
+ ```
297
+
298
+ > [!TIP]
299
+ > see [setting-the-fusion-token-in-github](./auth.md#setting-the-fusion-token-in-github) for adding `FUSION_TOKEN` to your envirnoment
300
+
301
+
302
+ ### Example: Using Environment Variables in App Config
303
+
304
+ You can use environment variables in your app configuration to inject secrets or environment-specific values at build or deploy time. For example, to access values provided by your CI/CD pipeline:
305
+
306
+ ```yml
307
+ step: Upload configuration
308
+ run: pnpm exec fusion-framework-cli app config --upload --env ${{ matrix.env }}
309
+ with:
310
+ CONFIG_VALUE_FOO: ${{ VAR.ENVIRONMENT_CONFIG_VALUE }}
311
+ CONFIG_VALUE_BAR: ${{ SECRETS.ENVIRONMENT_CONFIG_SECRET_VALUE }}
312
+ ```
313
+
314
+ ```ts
315
+ import { defineAppConfig, mergeAppManifests } from '@equinor/fusion-framework-cli/app';
316
+
317
+ export default defineAppConfig((env, args) => {
318
+ return mergeAppManifests(args.base, {
319
+ environment: {
320
+ foo: process.env.CONFIG_VALUE_FOO,
321
+ bar: process.env.CONFIG_VALUE_BAR,
322
+ },
323
+ });
324
+ });
325
+ ```
326
+
327
+ > [!NOTE]
328
+ > if not `app.config.${{ENV}}.ts|js|json` is found it will fallback to `app.config.ts|js|json`
329
+
330
+ ---
331
+
332
+ ## Commands
333
+
334
+ ## Command Overview
335
+
336
+ The Fusion Framework CLI provides a suite of commands to support the full application lifecycle, from development to deployment. Below is an overview of all available commands with quick links to their detailed usage:
337
+
338
+ - [Dev](#dev) — Start the development server with hot reloading.
339
+ - [Publish](#publish) — Build, upload, and tag your app for deployment.
340
+ - [Config](#config) — Generate or upload your app configuration.
341
+ - [Build](#build) — Build your application and generate deployment artifacts.
342
+ - [Pack](#pack) — Bundle your app into a distributable archive.
343
+ - [Upload](#upload) — Upload your app bundle to the Fusion app store.
344
+ - [Tag](#tag) — Tag a published app version for release management.
345
+ - [Check](#check) — Verify your app's registration status.
346
+ - [Aliases](#aliases) — Deprecated commands and their replacements.
347
+
348
+ Refer to each section below for detailed options, usage, and examples.
349
+
350
+ ### Dev
351
+
352
+ Start your application in development mode with hot reloading and environment-specific configuration.
353
+
354
+ | Option | Description | Default / Example |
355
+ | ------------------- | ------------------------------------------------------------------- | ----------------- |
356
+ | `--debug` | Enable debug mode for verbose logging. | `false` |
357
+ | `--manifest <path>` | Path to the app manifest file (`app.manifest[.env]?.[ts,js,json]`). | `app.manifest.ts` |
358
+ | `--config <path>` | Path to the app config file (`app.config[.env]?.[ts,js,json]`). | `app.config.ts` |
359
+ | `--env <env>` | Runtime environment for the dev server. | `local` |
360
+ | `--port <port>` | Port for the development server. | `3000` |
361
+
362
+ **Usage:**
363
+ ```sh
364
+ pnpm fusion-framework-cli dev [options]
365
+ ```
366
+
367
+ **Examples:**
368
+ ```sh
369
+ pnpm fusion-framework-cli dev
370
+ pnpm fusion-framework-cli dev --port 4000
371
+ pnpm fusion-framework-cli dev --manifest ./app.manifest.local.ts --config ./app.config.ts
372
+ ```
373
+
374
+ > **Tip:** Use `--debug` to get detailed logs for troubleshooting during development.
375
+
376
+ ### Publish
377
+
378
+ Publish your application to the Fusion app store (registry) for deployment.
379
+
380
+ Publish your application to the Fusion app store (registry) for deployment. This command will build (if needed), upload, and tag your app in a single step.
381
+
382
+ | Option/Argument | Description | Default / Example |
383
+ | ------------------ | --------------------------------------------------------------------------------------------------- | ----------------- |
384
+ | `[bundle]` | Path to the app bundle to upload. If omitted, the CLI will build and bundle your app automatically. | |
385
+ | `-e`, `--env` | Target environment for deployment (e.g., `ci`, `fqa`, `fprd`). | |
386
+ | `-m`, `--manifest` | Manifest file to use for bundling (e.g., `app.manifest.ts`). | `app.manifest.ts` |
387
+ | `-t`, `--tag` | Tag to apply to the published app (`latest` \| `preview`). | `latest` |
388
+ | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
389
+ | `--token` | Authentication token for Fusion. | |
390
+ | `--tenantId` | Azure tenant ID for authentication. | |
391
+ | `--clientId` | Azure client ID for authentication. | |
392
+
393
+ **Usage:**
394
+ ```sh
395
+ pnpm fusion-framework-cli publish [bundle] [options]
396
+ ```
397
+
398
+ **Examples:**
399
+ ```sh
400
+ pnpm fusion-framework-cli publish
401
+ pnpm fusion-framework-cli publish --env prod --manifest app.manifest.prod.ts
402
+ pnpm fusion-framework-cli publish --tag latest app-bundle.zip
403
+ ```
404
+
405
+ > [!NOTE]
406
+ > - If you provide a bundle file, it will be uploaded directly. If not, the CLI will build and bundle your app before uploading.
407
+ > - The `--tag` option lets you mark the published version (e.g., as `latest` or `preview`) for easier deployment targeting.
408
+ > - Authentication options (`--token`, `--tenantId`, `--clientId`) can be set via CLI flags or environment variables.
409
+ > - If any step fails (build, upload, or tagging), an error will be logged and the process will exit with a non-zero code.
410
+
411
+ ### Config
412
+
413
+ Upload your application configuration to the Fusion app store (registry).
414
+
415
+ Upload or generate your application configuration for the Fusion app registry.
416
+
417
+ The `config` command allows you to generate your app's configuration and either output it locally (to stdout or a file) or publish it directly to the Fusion app registry for a specific environment.
418
+
419
+ | Option/Argument | Description | Default / Example |
420
+ | ------------------- | -------------------------------------------------------------------- | ----------------- |
421
+ | `[config]` | Config build file to use (e.g., `app.config[.env]?.[ts,js,json]`). | `app.config.ts` |
422
+ | `-e`, `--env <env>` | Target environment for the configuration. | |
423
+ | `-o`, `--output` | Output to `stdout` or a file path. Ignored with `--publish`. | `stdout` |
424
+ | `--publish` | Publish the generated config to the Fusion app registry. | |
425
+ | `--manifest <path>` | Path to the app manifest file (required with `--publish`). | |
426
+ | `--debug` | Enable debug mode for verbose logging. | `false` |
427
+ | `--silent` | Silent mode, suppresses output except errors. | `false` |
428
+ | `--token` | Authentication token for Fusion (only relevant with `--publish`). | |
429
+ | `--tenantId` | Azure tenant ID for authentication (only relevant with `--publish`). | |
430
+ | `--clientId` | Azure client ID for authentication (only relevant with `--publish`). | |
431
+
432
+ **Usage:**
433
+ ```sh
434
+ pnpm fusion-framework-cli app config [config] [options]
435
+ ```
436
+
437
+ **Examples:**
438
+ ```sh
439
+ # Output config to stdout for the current environment
440
+ pnpm fusion-framework-cli app config
441
+
442
+ # Output config for 'prod' environment to a file
443
+ pnpm fusion-framework-cli app config --env prod --output ./dist/app.config.json
444
+
445
+ # Publish config for 'prod' environment to the registry
446
+ pnpm fusion-framework-cli app config --publish --manifest app.manifest.ts --env prod
447
+
448
+ # Use a custom config file for a specific environment
449
+ pnpm fusion-framework-cli app config my-custom.config.ts --env ci
450
+ ```
451
+
452
+ > [!NOTE]
453
+ > - When using `--publish`, you must specify a manifest file with `--manifest` and cannot set `--env` to `dev`.
454
+ > - The `--output` option is ignored when publishing; the config is uploaded directly to the registry.
455
+ > - Authentication options (`--token`, `--tenantId`, `--clientId`) are only relevant when publishing and can be set via CLI flags or environment variables.
456
+ > - If any step fails, an error will be logged and the process will exit with a non-zero code.
457
+
458
+ ### Build
459
+ Build your application and generate the necessary artifacts for deployment:
460
+
461
+ | Option/Argument | Description | Default / Example |
462
+ | --------------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
463
+ | `[manifest]` | Manifest file to use for building (e.g., `app.manifest.ts`). If omitted, searches for a default manifest file. | `app.manifest.ts`, `app.manifest.js`, `app.manifest.json` |
464
+ | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
465
+
466
+ **Usage:**
467
+ ```sh
468
+ pnpm fusion-framework-cli build [manifest] [options]
469
+ ```
470
+
471
+ **Examples:**
472
+ ```sh
473
+ pnpm fusion-framework-cli build
474
+ pnpm fusion-framework-cli build app.manifest.dev.ts --debug
475
+ ```
476
+
477
+ ### Pack
478
+
479
+ Build a distributable app bundle archive for deployment.
480
+
481
+ | Option/Argument | Description | Default / Example |
482
+ | ----------------- | ----------------------------------------------------------------------------------------------------- | -------------------------------- |
483
+ | `[manifest]` | Manifest file to use for bundling (e.g., `app.manifest.ts`). If omitted, searches for a default file. | `app.manifest.ts`, etc. |
484
+ | `-a`, `--archive` | Name of the output archive file. | `app-bundle.zip` |
485
+ | `-o`, `--output` | Directory where the archive will be saved. | Current working directory (`./`) |
486
+ | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
487
+
488
+ **Usage:**
489
+ ```sh
490
+ pnpm fusion-framework-cli pack [manifest] [options]
491
+ ```
492
+
493
+ **Examples:**
494
+ ```sh
495
+ pnpm fusion-framework-cli pack
496
+ pnpm fusion-framework-cli pack app.manifest.dev.ts --archive my-app.zip --output ./dist
497
+ ```
498
+
499
+ > [!NOTE] The `pack` command will also build your application before bundling. It bundles your application and all necessary files into an archive for deployment. If no manifest is provided, it will search for a default `app.manifest.[ts|js|json]` in the current directory.
500
+ >
501
+ > Additionally, the `pack` command generates a `metadata.json` file alongside the archive. This file records the app name and version of the build, which can be useful for tracking and deployment automation.
502
+
503
+ ### Upload
504
+
505
+ Upload your Fusion application bundle to the Fusion app store (registry).
506
+
507
+ | Option/Argument | Description | Default / Example |
508
+ | ---------------- | ------------------------------------------------------------------------------------------------- | ----------------- |
509
+ | `[bundle]` | Application bundle to upload (e.g., `app-bundle.zip`). If omitted, uses the default archive name. | `app-bundle.zip` |
510
+ | `-k`, `--appKey` | Application key. If not provided, resolved from the manifest file. | |
511
+ | `-e`, `--env` | Target environment for upload (e.g., `ci`, `fqa`, `fprd`). | |
512
+ | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
513
+ | `--token` | Authentication token for Fusion. | |
514
+ | `--tenantId` | Azure tenant ID for authentication. | |
515
+ | `--clientId` | Azure client ID for authentication. | |
516
+
517
+ **Usage:**
518
+ ```sh
519
+ pnpm fusion-framework-cli app upload [bundle] [options]
520
+ ```
521
+
522
+ **Examples:**
523
+ ```sh
524
+ pnpm fusion-framework-cli app upload
525
+ pnpm fusion-framework-cli app upload my-app-bundle.zip --appKey my-app
526
+ pnpm fusion-framework-cli app upload --env prod
527
+ pnpm fusion-framework-cli app upload --debug
528
+ ```
529
+
530
+ > [!NOTE]
531
+ > The `upload` command uploads a distributable application bundle to the Fusion app registry. You can specify the application key directly or let the command resolve it from the manifest file. Supports environment selection and debug mode. If no bundle is provided, the CLI will use the default archive name (`app-bundle.zip`).
532
+ >
533
+ > If the upload fails, an error will be logged and the process will exit with a non-zero code.
534
+
535
+ ### Tag
536
+
537
+ Tag a published application version in the Fusion app store (registry).
538
+
539
+ Tag a specific version of your Fusion application in the Fusion app registry for release management.
540
+
541
+ The `tag` command applies a tag (such as `latest`, `preview`, or `stable`) to a published application version. This helps you manage which version is considered the default for deployment or preview purposes.
542
+
543
+ | Argument/Option | Description | Default / Example |
544
+ | ------------------------- | ------------------------------------------------------------------ | ----------------- |
545
+ | `<tag>` | Tag to apply (`latest` \| `preview` \| `stable`). | |
546
+ | `--appKey <string>` | Application key. If not provided, resolved from the manifest file. | |
547
+ | `-v, --version <string>` | Version to tag. If not provided, resolved from the manifest file. | |
548
+ | `-m, --manifest <string>` | Manifest file to use for resolving app key and version. | `app.manifest.ts` |
549
+ | `--debug` | Enable debug mode for verbose logging. | `false` |
550
+ | `--silent` | Silent mode, suppresses output except errors. | `false` |
551
+ | `-e, --env <env>` | Target environment. | |
552
+ | `--token` | Authentication token for Fusion. | |
553
+ | `--tenantId` | Azure tenant ID for authentication. | |
554
+ | `--clientId` | Azure client ID for authentication. | |
555
+
556
+ **Usage:**
557
+ ```sh
558
+ pnpm fusion-framework-cli app tag <tag> [options]
559
+ ```
560
+
561
+ **Examples:**
562
+ ```sh
563
+ pnpm fusion-framework-cli app tag latest
564
+ pnpm fusion-framework-cli app tag preview --env prod --manifest app.manifest.prod.ts
565
+ pnpm fusion-framework-cli app tag stable --appKey my-app --version 1.2.3
566
+ ```
567
+
568
+ > [!TIP] You can roll back a release by tagging a previous build as `latest`. Simply run the tag command with the desired version to make it the active release for deployment.
569
+
570
+ > [!NOTE]
571
+ > - The `tag` command requires a published application version. You can specify the app key and version directly, or let the CLI resolve them from your manifest file.
572
+ > - Supported tags are: `latest`, `preview`, and `stable`.
573
+ > - Authentication options (`--token`, `--tenantId`, `--clientId`) can be set via CLI flags or environment variables.
574
+ > - If tagging fails, an error will be logged and the process will exit with a non-zero code.
575
+
576
+ ### Check
577
+
578
+ Check if a Fusion application is registered in the Fusion app store (registry).
579
+
580
+ Checks if your application is registered in the Fusion app store and helps identify registration or configuration issues.
581
+
582
+ | Option/Argument | Description | Default / Example |
583
+ | --------------------- | ----------------------------------------------------- | ----------------- |
584
+ | `-d`, `--debug` | Enable debug mode for verbose logging. | `false` |
585
+ | `--environment <env>` | Specify the environment (see available environments). | |
586
+ | `--token <token>` | Provide an authentication token (if required). | |
587
+
588
+ **Usage:**
589
+ ```sh
590
+ pnpm fusion-framework-cli app check [options]
591
+ ```
592
+
593
+ **Examples:**
594
+ ```sh
595
+ pnpm fusion-framework-cli app check
596
+ pnpm fusion-framework-cli app check --environment prod --debug
597
+ ```
598
+
599
+ > [!NOTE]
600
+ > - Use this command to verify your app's registration status in the Fusion app store.
601
+ > - Supports authentication and environment selection.
602
+ > - Use `--debug` for verbose output to help troubleshoot registration issues.
603
+
604
+ ### Aliases (Deprecated Commands)
605
+
606
+ > [!IMPORTANT]
607
+ > **Deprecated Command Aliases:**
608
+ > The Fusion Framework CLI previously supported several `build-*` commands for app lifecycle tasks. These commands are now deprecated in favor of more consistent and future-proof command names (`pack`, `upload`, `manifest`, `publish`).
609
+ >
610
+ > **Why the change?**
611
+ > - The new command names are shorter, clearer, and better reflect their purpose.
612
+ > - This change aligns with industry standards and prepares for future CLI enhancements.
613
+ > - Deprecated commands will be removed in future versions—update your scripts and workflows now to avoid breaking changes.
614
+ >
615
+ > For a full migration guide, see [Migration v10 to v11](./migration-v10-to-v11.md).
616
+
617
+ The CLI will warn you and redirect to the new command when you use a deprecated alias, applying any necessary options automatically. See the table below for mappings:
618
+
619
+ | Deprecated Command | New Command | Notes |
620
+ | ------------------ | ----------- | ------------------------------------------------------------------------ |
621
+ | `build-pack` | `pack` | Warns and sets default archive if not specified. |
622
+ | `build-upload` | `upload` | Warns, maps `--service` to `--env`, and sets bundle argument if omitted. |
623
+ | `build-manifest` | `manifest` | Warns and redirects to the new command. |
624
+ | `build-publish` | `publish` | Warns, maps `--service` to `--env`. |
625
+
626
+ > [!NOTE]
627
+ > The `--service` option is deprecated and replaced by `--env`. Using `--service` will result in an error.
628
+
629
+ **Example:**
630
+ ```sh
631
+ pnpm fusion-framework-cli build-pack
632
+ # Outputs a deprecation warning and runs 'pack' with compatible options.
633
+ ```
634
+
635
+ > [!WARNING]
636
+ > The deprecated commands will be removed in future versions. Please update your scripts and workflows to use the new command names (`pack`, `upload`, `manifest`, `publish`) to ensure compatibility with v11 and beyond.
637
+ > For a full migration guide, see [Migration v10 to v11](./migration-v10-to-v11.md).
638
+
639
+ ---
640
+
641
+ > **Need more examples?**
642
+ > - See the [cookbooks/](../../cookbooks/) directory for real-world app examples.
643
+ > - For migration help, see [Migration v10 to v11](./migration-v10-to-v11.md).
644
+ > - For advanced configuration, see [Authentication](./auth.md) and [CI/CD](#cicd).