@equinor/fusion-framework-cli 13.3.19-next.0 → 14.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.
- package/CHANGELOG.md +114 -8
- package/README.md +150 -193
- package/bin/build/bin.mjs +1 -1
- package/bin/build/cli.mjs +3 -3
- package/dist/esm/lib/app/app-manifest.js.map +1 -1
- package/dist/esm/lib/app/index.js +8 -0
- package/dist/esm/lib/app/index.js.map +1 -1
- package/dist/esm/lib/dev-server.js +8 -0
- package/dist/esm/lib/dev-server.js.map +1 -1
- package/dist/esm/lib/index.js.map +1 -1
- package/dist/esm/lib/portal/index.js +8 -0
- package/dist/esm/lib/portal/index.js.map +1 -1
- package/dist/esm/lib/portal/portal-manifest.js +20 -1
- package/dist/esm/lib/portal/portal-manifest.js.map +1 -1
- package/dist/esm/lib/utils/expect.js +16 -2
- package/dist/esm/lib/utils/expect.js.map +1 -1
- package/dist/esm/lib/utils/file-exists.js +28 -0
- package/dist/esm/lib/utils/file-exists.js.map +1 -1
- package/dist/esm/lib/utils/index.js +8 -0
- package/dist/esm/lib/utils/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/bin/app-config-publish.d.ts +9 -0
- package/dist/types/bin/index.d.ts +10 -0
- package/dist/types/bin/portal-config-publish.d.ts +10 -0
- package/dist/types/bin/utils/index.d.ts +9 -0
- package/dist/types/cli/commands/index.d.ts +9 -0
- package/dist/types/lib/app/app-manifest.d.ts +4 -14
- package/dist/types/lib/app/index.d.ts +9 -1
- package/dist/types/lib/dev-server.d.ts +8 -0
- package/dist/types/lib/index.d.ts +8 -0
- package/dist/types/lib/legacy.d.ts +1 -1
- package/dist/types/lib/portal/index.d.ts +8 -0
- package/dist/types/lib/portal/portal-manifest.d.ts +20 -0
- package/dist/types/lib/utils/expect.d.ts +18 -2
- package/dist/types/lib/utils/file-exists.d.ts +30 -0
- package/dist/types/lib/utils/index.d.ts +8 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/ai-commands.md +162 -40
- package/docs/application.md +27 -0
- package/docs/auth.md +9 -0
- package/docs/portal.md +20 -0
- package/package.json +21 -25
package/docs/ai-commands.md
CHANGED
|
@@ -19,11 +19,12 @@ The Fusion Framework CLI provides powerful AI commands for interacting with Larg
|
|
|
19
19
|
|
|
20
20
|
## Overview
|
|
21
21
|
|
|
22
|
-
The `ai` command group includes
|
|
22
|
+
The `ai` command group includes the following subcommands:
|
|
23
23
|
|
|
24
|
-
- **`chat`** - Interactive chat with AI models using vector store context retrieval
|
|
25
|
-
- **`
|
|
26
|
-
- **`search`** - Search the vector store to validate embeddings and retrieve relevant documents
|
|
24
|
+
- **`ai chat`** - Interactive chat with AI models using vector store context retrieval
|
|
25
|
+
- **`ai index add`** - Add documents to the search index by generating embeddings from source files
|
|
26
|
+
- **`ai index search`** - Search the vector store to validate embeddings and retrieve relevant documents
|
|
27
|
+
- **`ai index remove`** - Remove documents from the search index by source path or OData filter
|
|
27
28
|
|
|
28
29
|
## Prerequisites
|
|
29
30
|
|
|
@@ -81,7 +82,7 @@ For GitHub Actions workflows, configure:
|
|
|
81
82
|
|
|
82
83
|
### Configuration File
|
|
83
84
|
|
|
84
|
-
For the `
|
|
85
|
+
For the `ai index add` command, you can create a `fusion-ai.config.ts` file in your project root:
|
|
85
86
|
|
|
86
87
|
```typescript
|
|
87
88
|
import { configureFusionAI } from '@equinor/fusion-framework-cli-plugin-ai-index';
|
|
@@ -160,7 +161,6 @@ While in chat mode, you can use these special commands:
|
|
|
160
161
|
|
|
161
162
|
```bash
|
|
162
163
|
# Start interactive chat with default settings
|
|
163
|
-
# (Azure configuration loaded from .env file)
|
|
164
164
|
ffc ai chat
|
|
165
165
|
|
|
166
166
|
# Increase context retrieval limit for more comprehensive responses
|
|
@@ -180,9 +180,9 @@ ffc ai chat --verbose
|
|
|
180
180
|
3. **Streaming Response**: The AI response streams in real-time for immediate feedback
|
|
181
181
|
4. **History Management**: Conversation history is automatically compressed when it reaches 10 messages to maintain context while reducing token usage
|
|
182
182
|
|
|
183
|
-
### `ai
|
|
183
|
+
### `ai index add`
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Add documents to the AI search index by generating embeddings from markdown and TypeScript files.
|
|
186
186
|
|
|
187
187
|
#### Features
|
|
188
188
|
|
|
@@ -197,7 +197,7 @@ Generate embeddings from markdown and TypeScript files for semantic search index
|
|
|
197
197
|
#### Usage
|
|
198
198
|
|
|
199
199
|
```bash
|
|
200
|
-
ffc ai
|
|
200
|
+
ffc ai index add [options] [glob-patterns...]
|
|
201
201
|
```
|
|
202
202
|
|
|
203
203
|
#### Options
|
|
@@ -206,7 +206,6 @@ ffc ai embeddings [options] [glob-patterns...]
|
|
|
206
206
|
|--------|-------------|---------|
|
|
207
207
|
| `--dry-run` | Show what would be processed without doing it | `false` |
|
|
208
208
|
| `--config <path>` | Path to config file | `fusion-ai.config.ts` |
|
|
209
|
-
| `--recursive` | Process directories recursively | `false` |
|
|
210
209
|
| `--diff` | Process only changed files (workflow mode) | `false` |
|
|
211
210
|
| `--base-ref <ref>` | Git reference to compare against | `HEAD~1` |
|
|
212
211
|
| `--clean` | Delete all existing documents before processing | `false` |
|
|
@@ -217,25 +216,25 @@ ffc ai embeddings [options] [glob-patterns...]
|
|
|
217
216
|
|
|
218
217
|
```bash
|
|
219
218
|
# Dry run to see what would be processed
|
|
220
|
-
ffc ai
|
|
219
|
+
ffc ai index add --dry-run ./src
|
|
221
220
|
|
|
222
221
|
# Process all TypeScript and Markdown files in a directory
|
|
223
|
-
ffc ai
|
|
222
|
+
ffc ai index add ./src
|
|
224
223
|
|
|
225
224
|
# Process only changed files (useful for CI/CD)
|
|
226
|
-
ffc ai
|
|
225
|
+
ffc ai index add --diff ./src
|
|
227
226
|
|
|
228
227
|
# Process changed files compared to a specific branch
|
|
229
|
-
ffc ai
|
|
228
|
+
ffc ai index add --diff --base-ref origin/main ./src
|
|
230
229
|
|
|
231
230
|
# Clean and re-index all documents
|
|
232
|
-
ffc ai
|
|
231
|
+
ffc ai index add --clean ./src
|
|
233
232
|
|
|
234
233
|
# Process specific file patterns
|
|
235
|
-
ffc ai
|
|
234
|
+
ffc ai index add "packages/**/*.ts" "docs/**/*.md" "docs/**/*.mdx"
|
|
236
235
|
|
|
237
236
|
# Use custom config file
|
|
238
|
-
ffc ai
|
|
237
|
+
ffc ai index add --config ./custom-ai.config.ts ./src
|
|
239
238
|
```
|
|
240
239
|
|
|
241
240
|
#### Workflow Integration
|
|
@@ -268,7 +267,7 @@ Each document is enriched with metadata:
|
|
|
268
267
|
- `date` - Commit date
|
|
269
268
|
- `message` - Commit message
|
|
270
269
|
|
|
271
|
-
### `ai search`
|
|
270
|
+
### `ai index search`
|
|
272
271
|
|
|
273
272
|
Search the vector store to validate embeddings and retrieve relevant documents using semantic search.
|
|
274
273
|
|
|
@@ -283,7 +282,7 @@ Search the vector store to validate embeddings and retrieve relevant documents u
|
|
|
283
282
|
#### Usage
|
|
284
283
|
|
|
285
284
|
```bash
|
|
286
|
-
ffc ai search <query> [options]
|
|
285
|
+
ffc ai index search <query> [options]
|
|
287
286
|
```
|
|
288
287
|
|
|
289
288
|
#### Options
|
|
@@ -303,42 +302,55 @@ ffc ai search <query> [options]
|
|
|
303
302
|
|
|
304
303
|
```bash
|
|
305
304
|
# Basic search
|
|
306
|
-
ffc ai search "how to use the framework"
|
|
305
|
+
ffc ai index search "how to use the framework"
|
|
307
306
|
|
|
308
307
|
# Limit results
|
|
309
|
-
ffc ai search "authentication" --limit 5
|
|
308
|
+
ffc ai index search "authentication" --limit 5
|
|
310
309
|
|
|
311
310
|
# Filter by source file
|
|
312
|
-
ffc ai search "typescript" --filter "metadata/source eq 'src/index.ts'"
|
|
311
|
+
ffc ai index search "typescript" --filter "metadata/source eq 'src/index.ts'"
|
|
313
312
|
|
|
314
313
|
# Output as JSON for programmatic use
|
|
315
|
-
ffc ai search "documentation" --json
|
|
314
|
+
ffc ai index search "documentation" --json
|
|
316
315
|
|
|
317
316
|
# Output raw metadata structure
|
|
318
|
-
ffc ai search "documentation" --json --raw
|
|
317
|
+
ffc ai index search "documentation" --json --raw
|
|
319
318
|
|
|
320
319
|
# Enable verbose output
|
|
321
|
-
ffc ai search "API reference" --verbose
|
|
320
|
+
ffc ai index search "API reference" --verbose
|
|
322
321
|
```
|
|
323
322
|
|
|
324
323
|
#### OData Filter Examples
|
|
325
324
|
|
|
326
|
-
The `--filter` option
|
|
325
|
+
The `--filter` option accepts [Azure AI Search OData filter expressions](https://learn.microsoft.com/azure/search/search-query-odata-filter). Both `search` and `remove` support the same filter syntax.
|
|
326
|
+
|
|
327
|
+
Attributes are stored in Azure as a complex collection of `{key, value}` pairs (see [Indexed metadata](#indexed-metadata)). Use the `any()` lambda to match attribute keys and values.
|
|
327
328
|
|
|
328
329
|
```bash
|
|
329
|
-
# Filter by source file
|
|
330
|
+
# Filter by source file path (top-level field — no any() needed)
|
|
330
331
|
--filter "metadata/source eq 'packages/framework/src/index.ts'"
|
|
331
332
|
|
|
332
|
-
# Filter by multiple
|
|
333
|
+
# Filter by multiple source paths
|
|
333
334
|
--filter "metadata/source eq 'src/a.ts' or metadata/source eq 'src/b.ts'"
|
|
334
335
|
|
|
335
|
-
# Filter by
|
|
336
|
-
--filter "metadata/attributes/
|
|
336
|
+
# Filter by package name (attribute field — use any() lambda)
|
|
337
|
+
--filter "metadata/attributes/any(a: a/key eq 'pkg_name' and a/value eq '@equinor/fusion-framework')"
|
|
338
|
+
|
|
339
|
+
# Filter by document type (tsdoc or markdown)
|
|
340
|
+
--filter "metadata/attributes/any(a: a/key eq 'type' and a/value eq 'tsdoc')"
|
|
337
341
|
|
|
338
|
-
# Filter by
|
|
339
|
-
--filter "metadata/attributes/
|
|
342
|
+
# Filter by custom tag
|
|
343
|
+
--filter "metadata/attributes/any(a: a/key eq 'tags' and a/value eq 'react')"
|
|
344
|
+
|
|
345
|
+
# Filter by TypeScript declaration kind
|
|
346
|
+
--filter "metadata/attributes/any(a: a/key eq 'ts_kind' and a/value eq 'InterfaceDeclaration')"
|
|
347
|
+
|
|
348
|
+
# Filter by git commit date
|
|
349
|
+
--filter "metadata/attributes/any(a: a/key eq 'git_commit_date' and a/value gt '2025-01-01')"
|
|
340
350
|
```
|
|
341
351
|
|
|
352
|
+
> **Common mistake:** Writing `metadata/attributes/pkg_name eq '...'` instead of using `any()`. Because attributes are stored as a `{key, value}` array in Azure, dot-path access does not work — you must use the lambda form shown above.
|
|
353
|
+
|
|
342
354
|
#### Output Formats
|
|
343
355
|
|
|
344
356
|
**Human-readable format** (default):
|
|
@@ -351,6 +363,116 @@ The `--filter` option supports OData filter expressions:
|
|
|
351
363
|
- Full document content and metadata
|
|
352
364
|
- Suitable for piping to other tools or scripts
|
|
353
365
|
|
|
366
|
+
### `ai index remove`
|
|
367
|
+
|
|
368
|
+
Remove documents from the Azure AI Search index by source path or OData filter. Use this to remove stale, renamed, or excluded content without a full re-index.
|
|
369
|
+
|
|
370
|
+
#### Usage
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
ffc ai index remove [options] [source-paths...]
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### Options
|
|
377
|
+
|
|
378
|
+
| Option | Description | Default |
|
|
379
|
+
|--------|-------------|--------|
|
|
380
|
+
| `[source-paths...]` | One or more relative file paths to remove | - |
|
|
381
|
+
| `--filter <expression>` | Raw OData filter expression for advanced selection | - |
|
|
382
|
+
| `--dry-run` | Preview what would be removed without deleting anything | `false` |
|
|
383
|
+
|
|
384
|
+
**Note:** Azure configuration (API keys, endpoints, etc.) is provided via environment variables (`.env` file or GitHub Variables/Secrets), not command-line options.
|
|
385
|
+
|
|
386
|
+
#### Examples
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
# Remove by source file paths
|
|
390
|
+
ffc ai index remove packages/modules/old/src/index.ts packages/modules/old/README.md
|
|
391
|
+
|
|
392
|
+
# Preview what would be removed (dry-run)
|
|
393
|
+
ffc ai index remove --dry-run packages/modules/old/src/index.ts
|
|
394
|
+
|
|
395
|
+
# Remove all chunks from a specific package
|
|
396
|
+
ffc ai index remove --filter "metadata/attributes/any(a: a/key eq 'pkg_name' and a/value eq '@equinor/fusion-framework-module-old')"
|
|
397
|
+
|
|
398
|
+
# Remove all markdown documents from a package
|
|
399
|
+
ffc ai index remove --filter "metadata/attributes/any(a: a/key eq 'pkg_name' and a/value eq '@equinor/my-pkg') and metadata/attributes/any(a: a/key eq 'type' and a/value eq 'markdown')"
|
|
400
|
+
|
|
401
|
+
# Remove by raw source path filter
|
|
402
|
+
ffc ai index remove --filter "metadata/source eq 'src/deprecated-file.ts'"
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
#### How source-path arguments work
|
|
406
|
+
|
|
407
|
+
When you pass file paths as positional arguments, the command builds an OData filter that matches each path against the `metadata/source` field:
|
|
408
|
+
|
|
409
|
+
```bash
|
|
410
|
+
# This command:
|
|
411
|
+
ffc ai index remove src/a.ts src/b.ts
|
|
412
|
+
|
|
413
|
+
# Is equivalent to:
|
|
414
|
+
ffc ai index remove --filter "metadata/source eq 'src/a.ts' or metadata/source eq 'src/b.ts'"
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
When both source paths and `--filter` are provided, source paths take precedence to prevent accidental broad deletions.
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Indexed Metadata
|
|
422
|
+
|
|
423
|
+
Each indexed document has two kinds of metadata: **top-level fields** and **attributes** stored as a `{key, value}` array.
|
|
424
|
+
|
|
425
|
+
### Top-level fields
|
|
426
|
+
|
|
427
|
+
Access directly in OData filters:
|
|
428
|
+
|
|
429
|
+
| Field | Type | Description |
|
|
430
|
+
|-------|------|-------------|
|
|
431
|
+
| `metadata/source` | `string` | Relative file path (e.g. `packages/framework/src/index.ts`) |
|
|
432
|
+
|
|
433
|
+
### Attribute fields
|
|
434
|
+
|
|
435
|
+
Access via `metadata/attributes/any(a: a/key eq '...' and a/value eq '...')`:
|
|
436
|
+
|
|
437
|
+
| Key | Values / Type | Set by | Description |
|
|
438
|
+
|-----|---------------|--------|-------------|
|
|
439
|
+
| `type` | `'tsdoc'` \| `'markdown'` | Parser | Document type discriminator |
|
|
440
|
+
| `ts_kind` | `string` | TSDoc parser | TypeScript declaration kind (e.g. `FunctionDeclaration`, `InterfaceDeclaration`) |
|
|
441
|
+
| `ts_name` | `string` | TSDoc parser | Exported symbol name |
|
|
442
|
+
| `md_*` | `any` | Markdown parser | YAML frontmatter fields, prefixed with `md_` |
|
|
443
|
+
| `pkg_name` | `string` | Package resolver | `name` from the nearest `package.json` |
|
|
444
|
+
| `pkg_version` | `string` | Package resolver | `version` from the nearest `package.json` |
|
|
445
|
+
| `pkg_keywords` | `string[]` | Package resolver | `keywords` from `package.json` |
|
|
446
|
+
| `git_commit_hash` | `string` | Git metadata | Commit SHA of the source file |
|
|
447
|
+
| `git_commit_date` | `string` | Git metadata | ISO 8601 commit date |
|
|
448
|
+
| `git_link` | `string` | Git metadata | GitHub permalink to the file |
|
|
449
|
+
| `tags` | `string[]` | `attributeProcessor` | Custom tags set by `fusion-ai.config.ts` (e.g. `package`, `react`, `module`, `cookbook`) |
|
|
450
|
+
|
|
451
|
+
### Example: full document shape in Azure
|
|
452
|
+
|
|
453
|
+
```json
|
|
454
|
+
{
|
|
455
|
+
"id": "cGFja2FnZXMvZnJhbWV3b3JrL3NyYy9pbmRleC50cw",
|
|
456
|
+
"pageContent": "/** TSDoc comment... */\nfunction enableFramework() {...}",
|
|
457
|
+
"metadata": {
|
|
458
|
+
"source": "packages/framework/src/index.ts",
|
|
459
|
+
"attributes": [
|
|
460
|
+
{ "key": "type", "value": "tsdoc" },
|
|
461
|
+
{ "key": "ts_kind", "value": "FunctionDeclaration" },
|
|
462
|
+
{ "key": "ts_name", "value": "enableFramework" },
|
|
463
|
+
{ "key": "pkg_name", "value": "@equinor/fusion-framework" },
|
|
464
|
+
{ "key": "pkg_version", "value": "8.1.0" },
|
|
465
|
+
{ "key": "git_commit_hash", "value": "abc1234" },
|
|
466
|
+
{ "key": "git_commit_date", "value": "2025-03-14T10:30:00Z" },
|
|
467
|
+
{ "key": "git_link", "value": "https://github.com/equinor/fusion-framework/blob/main/packages/framework/src/index.ts" },
|
|
468
|
+
{ "key": "tags", "value": "[\"package\"]" }
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
354
476
|
## Common Workflows
|
|
355
477
|
|
|
356
478
|
### Initial Setup
|
|
@@ -370,12 +492,12 @@ The `--filter` option supports OData filter expressions:
|
|
|
370
492
|
|
|
371
493
|
3. **Generate initial embeddings**:
|
|
372
494
|
```bash
|
|
373
|
-
ffc ai
|
|
495
|
+
ffc ai index add --clean ./src
|
|
374
496
|
```
|
|
375
497
|
|
|
376
498
|
4. **Verify embeddings with search**:
|
|
377
499
|
```bash
|
|
378
|
-
ffc ai search "test query"
|
|
500
|
+
ffc ai index search "test query"
|
|
379
501
|
```
|
|
380
502
|
|
|
381
503
|
5. **Start using chat**:
|
|
@@ -389,7 +511,7 @@ For ongoing development, use diff-based processing:
|
|
|
389
511
|
|
|
390
512
|
```bash
|
|
391
513
|
# Process only changed files
|
|
392
|
-
ffc ai
|
|
514
|
+
ffc ai index add --diff ./src
|
|
393
515
|
```
|
|
394
516
|
|
|
395
517
|
### CI/CD Integration
|
|
@@ -424,7 +546,7 @@ jobs:
|
|
|
424
546
|
|
|
425
547
|
- name: Update embeddings
|
|
426
548
|
run: |
|
|
427
|
-
ffc ai
|
|
549
|
+
ffc ai index add --diff
|
|
428
550
|
env:
|
|
429
551
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
430
552
|
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
|
|
@@ -479,9 +601,9 @@ jobs:
|
|
|
479
601
|
- name: Index documentation
|
|
480
602
|
run: |
|
|
481
603
|
if [ -n "${{ steps.last_sha.outputs.last_sha }}" ]; then
|
|
482
|
-
ffc ai
|
|
604
|
+
ffc ai index add --diff --base-ref ${{ steps.last_sha.outputs.last_sha }}
|
|
483
605
|
else
|
|
484
|
-
ffc ai
|
|
606
|
+
ffc ai index add
|
|
485
607
|
fi
|
|
486
608
|
env:
|
|
487
609
|
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
|
|
@@ -536,7 +658,7 @@ jobs:
|
|
|
536
658
|
- Verify the index exists in your Azure Search service
|
|
537
659
|
|
|
538
660
|
**No results from search**
|
|
539
|
-
- Verify embeddings have been generated: `ffc ai
|
|
661
|
+
- Verify embeddings have been generated: `ffc ai index add --dry-run ./src`
|
|
540
662
|
- Check that the index contains documents
|
|
541
663
|
- Try a broader search query
|
|
542
664
|
|
|
@@ -556,7 +678,7 @@ Use the `--verbose` flag for detailed output:
|
|
|
556
678
|
|
|
557
679
|
```bash
|
|
558
680
|
ffc ai chat --verbose
|
|
559
|
-
ffc ai search "query" --verbose
|
|
681
|
+
ffc ai index search "query" --verbose
|
|
560
682
|
```
|
|
561
683
|
|
|
562
684
|
## Best Practices
|
package/docs/application.md
CHANGED
|
@@ -2,6 +2,9 @@ The Fusion Framework CLI empowers you to rapidly build, configure, and deploy mo
|
|
|
2
2
|
|
|
3
3
|
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!
|
|
4
4
|
|
|
5
|
+
> [!TIP]
|
|
6
|
+
> The CLI exposes two binary aliases: `fusion-framework-cli` and `ffc`. All examples below use the long form, but you can substitute `ffc` anywhere — e.g. `ffc app dev`, `ffc app build`, `ffc app publish`.
|
|
7
|
+
|
|
5
8
|
## Getting Started
|
|
6
9
|
|
|
7
10
|
### Install the CLI
|
|
@@ -83,6 +86,8 @@ export default defineAppConfig((env, args) => ({
|
|
|
83
86
|
|
|
84
87
|
```sh
|
|
85
88
|
pnpm fusion-framework-cli dev
|
|
89
|
+
# or using the short alias
|
|
90
|
+
ffc app dev
|
|
86
91
|
```
|
|
87
92
|
|
|
88
93
|
### Log in to Fusion Framework (if needed)
|
|
@@ -105,6 +110,8 @@ pnpm fusion-framework-cli auth login
|
|
|
105
110
|
```sh
|
|
106
111
|
# Publish and upload config in one command
|
|
107
112
|
pnpm fusion-framework-cli publish --env <environment> --config
|
|
113
|
+
# or using the short alias
|
|
114
|
+
ffc app publish --env <environment> --config
|
|
108
115
|
|
|
109
116
|
# Or separately
|
|
110
117
|
pnpm fusion-framework-cli publish --env <environment>
|
|
@@ -206,6 +213,9 @@ export default defineAppConfig((env, args) => {
|
|
|
206
213
|
});
|
|
207
214
|
```
|
|
208
215
|
|
|
216
|
+
> [!IMPORTANT]
|
|
217
|
+
> Endpoints defined here are **automatically registered as named HTTP clients** when the application initializes. You do not need to call `configureHttpClient(name, ...)` in `config.ts` for these endpoints — they are ready to use via `framework.modules.http.createClient('my-end-point')`. See the [HTTP client configuration docs](../../modules/http/docs/client-configuration.md) for details.
|
|
218
|
+
|
|
209
219
|
> [!TIP]
|
|
210
220
|
> In `endpoints` you can also override Service Discovery urls. This might be useful when you are
|
|
211
221
|
> testing in a PR-environment.
|
|
@@ -229,6 +239,12 @@ export default defineAppConfig((env, args) => {
|
|
|
229
239
|
> [!NOTE]
|
|
230
240
|
> If the key of an endpoint is defined, it will not check Service Discovery for that key.
|
|
231
241
|
> Service Discovery is the fallback.
|
|
242
|
+
>
|
|
243
|
+
> The full resolution priority (highest wins) is:
|
|
244
|
+
> 1. **Session overrides** — user-specific URL / scopes set at runtime
|
|
245
|
+
> 2. **Application config endpoints** — `endpoints` in `app.config.ts`
|
|
246
|
+
> 3. **Service-discovery registry** — resolved via `useFrameworkServiceClient`
|
|
247
|
+
> 4. **Explicit registration** — `configureHttpClient(name, options)` in `config.ts`
|
|
232
248
|
|
|
233
249
|
> [!NOTE]
|
|
234
250
|
> 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.
|
|
@@ -405,11 +421,13 @@ Start your application in development mode with hot reloading and environment-sp
|
|
|
405
421
|
**Usage:**
|
|
406
422
|
```sh
|
|
407
423
|
pnpm fusion-framework-cli dev [options]
|
|
424
|
+
# or: ffc app dev [options]
|
|
408
425
|
```
|
|
409
426
|
|
|
410
427
|
**Examples:**
|
|
411
428
|
```sh
|
|
412
429
|
pnpm fusion-framework-cli dev
|
|
430
|
+
ffc app dev
|
|
413
431
|
pnpm fusion-framework-cli dev --port 4000
|
|
414
432
|
pnpm fusion-framework-cli dev --manifest ./app.manifest.local.ts --config ./app.config.ts
|
|
415
433
|
```
|
|
@@ -472,11 +490,13 @@ This command uploads and tags your app for deployment. If no bundle is provided,
|
|
|
472
490
|
**Usage:**
|
|
473
491
|
```sh
|
|
474
492
|
pnpm fusion-framework-cli publish [bundle] [options]
|
|
493
|
+
# or: ffc app publish [bundle] [options]
|
|
475
494
|
```
|
|
476
495
|
|
|
477
496
|
**Examples:**
|
|
478
497
|
```sh
|
|
479
498
|
pnpm fusion-framework-cli publish
|
|
499
|
+
ffc app publish
|
|
480
500
|
pnpm fusion-framework-cli publish --env prod --manifest app.manifest.prod.ts
|
|
481
501
|
pnpm fusion-framework-cli publish --tag latest app-bundle.zip
|
|
482
502
|
pnpm fusion-framework-cli publish --config --env prod
|
|
@@ -518,6 +538,7 @@ The `config` command allows you to generate your app's configuration and either
|
|
|
518
538
|
**Usage:**
|
|
519
539
|
```sh
|
|
520
540
|
pnpm fusion-framework-cli app config [config] [options]
|
|
541
|
+
# or: ffc app config [config] [options]
|
|
521
542
|
```
|
|
522
543
|
|
|
523
544
|
**Examples:**
|
|
@@ -552,11 +573,13 @@ Build your application and generate the necessary artifacts for deployment:
|
|
|
552
573
|
**Usage:**
|
|
553
574
|
```sh
|
|
554
575
|
pnpm fusion-framework-cli build [manifest] [options]
|
|
576
|
+
# or: ffc app build [manifest] [options]
|
|
555
577
|
```
|
|
556
578
|
|
|
557
579
|
**Examples:**
|
|
558
580
|
```sh
|
|
559
581
|
pnpm fusion-framework-cli build
|
|
582
|
+
ffc app build
|
|
560
583
|
pnpm fusion-framework-cli build app.manifest.dev.ts --debug
|
|
561
584
|
```
|
|
562
585
|
|
|
@@ -582,11 +605,13 @@ Build a distributable app bundle archive for deployment.
|
|
|
582
605
|
**Usage:**
|
|
583
606
|
```sh
|
|
584
607
|
pnpm fusion-framework-cli pack [manifest] [options]
|
|
608
|
+
# or: ffc app pack [manifest] [options]
|
|
585
609
|
```
|
|
586
610
|
|
|
587
611
|
**Examples:**
|
|
588
612
|
```sh
|
|
589
613
|
pnpm fusion-framework-cli pack
|
|
614
|
+
ffc app pack
|
|
590
615
|
pnpm fusion-framework-cli pack app.manifest.dev.ts --archive my-app.zip --output ./dist
|
|
591
616
|
```
|
|
592
617
|
|
|
@@ -649,11 +674,13 @@ The `tag` command applies a tag (such as `latest`, `preview`, `dev`, `staging`,
|
|
|
649
674
|
**Usage:**
|
|
650
675
|
```sh
|
|
651
676
|
pnpm fusion-framework-cli app tag <tag> [options]
|
|
677
|
+
# or: ffc app tag <tag> [options]
|
|
652
678
|
```
|
|
653
679
|
|
|
654
680
|
**Examples:**
|
|
655
681
|
```sh
|
|
656
682
|
pnpm fusion-framework-cli app tag latest
|
|
683
|
+
ffc app tag latest
|
|
657
684
|
pnpm fusion-framework-cli app tag preview --env prod --manifest app.manifest.prod.ts
|
|
658
685
|
pnpm fusion-framework-cli app tag latest --package my-app@1.2.3
|
|
659
686
|
```
|
package/docs/auth.md
CHANGED
|
@@ -2,6 +2,9 @@ The Fusion Framework CLI provides secure, robust authentication for both automat
|
|
|
2
2
|
|
|
3
3
|
For detailed information about the underlying authentication module, see the [MSAL Node Module documentation](https://equinor.github.io/fusion-framework/modules/auth/msal-node/).
|
|
4
4
|
|
|
5
|
+
> [!TIP]
|
|
6
|
+
> The CLI exposes two binary aliases: `fusion-framework-cli` and `ffc`. All examples below use the long form, but you can substitute `ffc` anywhere — e.g. `ffc auth login`, `ffc auth token`.
|
|
7
|
+
|
|
5
8
|
## Key features
|
|
6
9
|
- **Multiple authentication modes:**
|
|
7
10
|
- `token_only`: Use a pre-provided token (e.g., for CI/CD and automation).
|
|
@@ -42,6 +45,8 @@ To log in, run:
|
|
|
42
45
|
|
|
43
46
|
```sh
|
|
44
47
|
fusion-framework-cli auth login
|
|
48
|
+
# or using the short alias
|
|
49
|
+
ffc auth login
|
|
45
50
|
```
|
|
46
51
|
|
|
47
52
|
- This will open a browser window for you to complete the Azure AD sign-in process.
|
|
@@ -52,6 +57,7 @@ If you ever need to clear your cached credentials, you can run:
|
|
|
52
57
|
|
|
53
58
|
```sh
|
|
54
59
|
fusion-framework-cli auth logout
|
|
60
|
+
# or: ffc auth logout
|
|
55
61
|
```
|
|
56
62
|
|
|
57
63
|
This will remove your stored tokens and require you to log in again for future CLI operations.
|
|
@@ -78,12 +84,15 @@ The `auth token` command is designed to show your access token for the current u
|
|
|
78
84
|
|
|
79
85
|
```sh
|
|
80
86
|
fusion-framework-cli auth token
|
|
87
|
+
# or using the short alias
|
|
88
|
+
ffc auth token
|
|
81
89
|
```
|
|
82
90
|
|
|
83
91
|
> [!TIP]
|
|
84
92
|
> The `--silent` flag outputs only the token (no extra logging), which is useful for exporting the token as an environment variable or saving it to a file for local testing or scripting:
|
|
85
93
|
> ```sh
|
|
86
94
|
> export FUSION_TOKEN=$(fusion-framework-cli auth token --silent)
|
|
95
|
+
> # or: export FUSION_TOKEN=$(ffc auth token --silent)
|
|
87
96
|
> ```
|
|
88
97
|
|
|
89
98
|
> [!Note] This command requires an interactive user context and MSAL Node. It is not suitable for CI/CD environments, as there is no user available in those scenarios. Use it for local development, testing, or whenever you need to preserve a Fusion token for your own scripts or tools.
|
package/docs/portal.md
CHANGED
|
@@ -8,6 +8,9 @@ The Fusion Framework CLI enables you to build, configure, and deploy **portal te
|
|
|
8
8
|
|
|
9
9
|
This guide covers the essential commands and best practices for developing and managing portal templates. For information on registering and configuring portals, see the Portal Admin documentation.
|
|
10
10
|
|
|
11
|
+
> [!TIP]
|
|
12
|
+
> The CLI exposes two binary aliases: `fusion-framework-cli` and `ffc`. All examples below use the long form, but you can substitute `ffc` anywhere — e.g. `ffc portal dev`, `ffc portal build`, `ffc portal publish`.
|
|
13
|
+
|
|
11
14
|
## Getting Started
|
|
12
15
|
|
|
13
16
|
### Install the CLI
|
|
@@ -38,6 +41,16 @@ pnpm init
|
|
|
38
41
|
|
|
39
42
|
The portal manifest (`portal.manifest.ts`) describes your portal's metadata, configuration, and capabilities. It is required for all portal templates. You may also define a schema file for advanced configuration validation.
|
|
40
43
|
|
|
44
|
+
```ts
|
|
45
|
+
import { definePortalManifest } from '@equinor/fusion-framework-cli/portal';
|
|
46
|
+
|
|
47
|
+
export default definePortalManifest((env, { base }) => ({
|
|
48
|
+
...base,
|
|
49
|
+
name: 'my-portal',
|
|
50
|
+
// Add more manifest fields as needed
|
|
51
|
+
}));
|
|
52
|
+
```
|
|
53
|
+
|
|
41
54
|
---
|
|
42
55
|
|
|
43
56
|
## Commands
|
|
@@ -71,11 +84,13 @@ Start the portal development server for local development and testing.
|
|
|
71
84
|
**Usage:**
|
|
72
85
|
```sh
|
|
73
86
|
pnpm fusion-framework-cli portal dev [options]
|
|
87
|
+
# or: ffc portal dev [options]
|
|
74
88
|
```
|
|
75
89
|
|
|
76
90
|
**Examples:**
|
|
77
91
|
```sh
|
|
78
92
|
pnpm fusion-framework-cli portal dev
|
|
93
|
+
ffc portal dev
|
|
79
94
|
pnpm fusion-framework-cli portal dev --port 4001 --manifest ./portal.manifest.ts
|
|
80
95
|
```
|
|
81
96
|
|
|
@@ -93,11 +108,13 @@ Build your portal template using Vite.
|
|
|
93
108
|
**Usage:**
|
|
94
109
|
```sh
|
|
95
110
|
pnpm fusion-framework-cli portal build [options]
|
|
111
|
+
# or: ffc portal build [options]
|
|
96
112
|
```
|
|
97
113
|
|
|
98
114
|
**Examples:**
|
|
99
115
|
```sh
|
|
100
116
|
pnpm fusion-framework-cli portal build
|
|
117
|
+
ffc portal build
|
|
101
118
|
pnpm fusion-framework-cli portal build --manifest ./portal.manifest.ts --env ci
|
|
102
119
|
```
|
|
103
120
|
|
|
@@ -116,6 +133,7 @@ Bundle your portal into a distributable archive for deployment.
|
|
|
116
133
|
**Usage:**
|
|
117
134
|
```sh
|
|
118
135
|
pnpm fusion-framework-cli portal pack [options]
|
|
136
|
+
# or: ffc portal pack [options]
|
|
119
137
|
```
|
|
120
138
|
|
|
121
139
|
**Examples:**
|
|
@@ -146,11 +164,13 @@ This command builds your portal template, uploads it to the Fusion portal regist
|
|
|
146
164
|
**Usage:**
|
|
147
165
|
```sh
|
|
148
166
|
pnpm fusion-framework-cli portal publish [options]
|
|
167
|
+
# or: ffc portal publish [options]
|
|
149
168
|
```
|
|
150
169
|
|
|
151
170
|
**Examples:**
|
|
152
171
|
```sh
|
|
153
172
|
pnpm fusion-framework-cli portal publish
|
|
173
|
+
ffc portal publish
|
|
154
174
|
pnpm fusion-framework-cli portal publish --env prod --manifest portal.manifest.prod.ts
|
|
155
175
|
pnpm fusion-framework-cli portal publish --tag preview --schema portal.schema.ts
|
|
156
176
|
```
|