@peterhauge/apiops-cli 0.2.1-alpha.0 → 0.4.0-alpha.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 +166 -0
- package/README.md +173 -169
- package/dist/cli/extract-command.d.ts +2 -2
- package/dist/cli/extract-command.d.ts.map +1 -1
- package/dist/cli/extract-command.js +3 -5
- package/dist/cli/extract-command.js.map +1 -1
- package/dist/cli/index.js +2 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init-command.d.ts +1 -1
- package/dist/cli/init-command.js +6 -6
- package/dist/cli/init-command.js.map +1 -1
- package/dist/cli/publish-command.d.ts +2 -2
- package/dist/cli/publish-command.js +3 -3
- package/dist/clients/apim-client.d.ts +16 -5
- package/dist/clients/apim-client.d.ts.map +1 -1
- package/dist/clients/apim-client.js +22 -7
- package/dist/clients/apim-client.js.map +1 -1
- package/dist/clients/artifact-store.d.ts +4 -4
- package/dist/clients/artifact-store.d.ts.map +1 -1
- package/dist/clients/artifact-store.js +10 -4
- package/dist/clients/artifact-store.js.map +1 -1
- package/dist/clients/iapim-client.d.ts +14 -2
- package/dist/clients/iapim-client.d.ts.map +1 -1
- package/dist/clients/iapim-client.js +1 -1
- package/dist/clients/iartifact-store.d.ts +10 -5
- package/dist/clients/iartifact-store.d.ts.map +1 -1
- package/dist/clients/iartifact-store.js +1 -1
- package/dist/lib/cloud-config.d.ts +1 -1
- package/dist/lib/cloud-config.js +1 -1
- package/dist/lib/config-loader.d.ts +2 -7
- package/dist/lib/config-loader.d.ts.map +1 -1
- package/dist/lib/config-loader.js +3 -22
- package/dist/lib/config-loader.js.map +1 -1
- package/dist/lib/dependency-graph.d.ts +1 -1
- package/dist/lib/dependency-graph.js +1 -1
- package/dist/lib/exit-codes.d.ts +1 -1
- package/dist/lib/exit-codes.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/parallel-runner.d.ts +2 -2
- package/dist/lib/parallel-runner.js +2 -2
- package/dist/lib/render-template.d.ts +10 -0
- package/dist/lib/render-template.d.ts.map +1 -0
- package/dist/lib/render-template.js +14 -0
- package/dist/lib/render-template.js.map +1 -0
- package/dist/lib/resource-path.d.ts +1 -1
- package/dist/lib/resource-path.js +1 -1
- package/dist/lib/resource-uri.d.ts +1 -1
- package/dist/lib/resource-uri.js +1 -1
- package/dist/lib/workspace-link.d.ts +31 -3
- package/dist/lib/workspace-link.d.ts.map +1 -1
- package/dist/lib/workspace-link.js +49 -3
- package/dist/lib/workspace-link.js.map +1 -1
- package/dist/models/config.d.ts +2 -4
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +1 -1
- package/dist/models/resource-types.d.ts +1 -1
- package/dist/models/resource-types.d.ts.map +1 -1
- package/dist/models/resource-types.js +5 -3
- package/dist/models/resource-types.js.map +1 -1
- package/dist/models/types.d.ts +22 -1
- package/dist/models/types.d.ts.map +1 -1
- package/dist/models/types.js +1 -1
- package/dist/services/api-extractor.d.ts +1 -1
- package/dist/services/api-extractor.d.ts.map +1 -1
- package/dist/services/api-extractor.js +39 -133
- package/dist/services/api-extractor.js.map +1 -1
- package/dist/services/api-publisher.d.ts +1 -1
- package/dist/services/api-publisher.d.ts.map +1 -1
- package/dist/services/api-publisher.js +50 -18
- package/dist/services/api-publisher.js.map +1 -1
- package/dist/services/delete-unmatched-service.d.ts +1 -1
- package/dist/services/delete-unmatched-service.js +1 -1
- package/dist/services/dry-run-reporter.d.ts +1 -1
- package/dist/services/dry-run-reporter.js +1 -1
- package/dist/services/extract-service.d.ts +1 -1
- package/dist/services/extract-service.d.ts.map +1 -1
- package/dist/services/extract-service.js +5 -3
- package/dist/services/extract-service.js.map +1 -1
- package/dist/services/filter-service.d.ts +19 -1
- package/dist/services/filter-service.d.ts.map +1 -1
- package/dist/services/filter-service.js +40 -2
- package/dist/services/filter-service.js.map +1 -1
- package/dist/services/git-diff-service.d.ts +1 -1
- package/dist/services/git-diff-service.js +1 -1
- package/dist/services/identity-guide-service.d.ts +4 -5
- package/dist/services/identity-guide-service.d.ts.map +1 -1
- package/dist/services/identity-guide-service.js +7 -41
- package/dist/services/identity-guide-service.js.map +1 -1
- package/dist/services/init-service.d.ts +1 -1
- package/dist/services/init-service.d.ts.map +1 -1
- package/dist/services/init-service.js +62 -29
- package/dist/services/init-service.js.map +1 -1
- package/dist/services/override-merger.d.ts +1 -1
- package/dist/services/override-merger.js +1 -1
- package/dist/services/product-extractor.d.ts +1 -1
- package/dist/services/product-extractor.d.ts.map +1 -1
- package/dist/services/product-extractor.js +31 -28
- package/dist/services/product-extractor.js.map +1 -1
- package/dist/services/product-publisher.d.ts.map +1 -1
- package/dist/services/product-publisher.js +25 -9
- package/dist/services/product-publisher.js.map +1 -1
- package/dist/services/prompt-service.d.ts +1 -1
- package/dist/services/prompt-service.js +1 -1
- package/dist/services/publish-service.d.ts +1 -1
- package/dist/services/publish-service.d.ts.map +1 -1
- package/dist/services/publish-service.js +31 -1
- package/dist/services/publish-service.js.map +1 -1
- package/dist/services/resource-extractor.d.ts +1 -1
- package/dist/services/resource-extractor.js +1 -1
- package/dist/services/resource-publisher.d.ts +14 -1
- package/dist/services/resource-publisher.d.ts.map +1 -1
- package/dist/services/resource-publisher.js +45 -10
- package/dist/services/resource-publisher.js.map +1 -1
- package/dist/services/secret-redaction-guard.d.ts +40 -0
- package/dist/services/secret-redaction-guard.d.ts.map +1 -0
- package/dist/services/secret-redaction-guard.js +92 -0
- package/dist/services/secret-redaction-guard.js.map +1 -0
- package/dist/services/secret-redactor.d.ts +19 -1
- package/dist/services/secret-redactor.d.ts.map +1 -1
- package/dist/services/secret-redactor.js +173 -1
- package/dist/services/secret-redactor.js.map +1 -1
- package/dist/services/transitive-resolver.d.ts +1 -1
- package/dist/services/transitive-resolver.js +1 -1
- package/dist/services/workspace-extractor.d.ts +7 -1
- package/dist/services/workspace-extractor.d.ts.map +1 -1
- package/dist/services/workspace-extractor.js +75 -10
- package/dist/services/workspace-extractor.js.map +1 -1
- package/dist/templates/azure-devops/extract-pipeline.d.ts +1 -1
- package/dist/templates/azure-devops/extract-pipeline.js +142 -142
- package/dist/templates/azure-devops/publish-pipeline.d.ts +1 -1
- package/dist/templates/azure-devops/publish-pipeline.d.ts.map +1 -1
- package/dist/templates/azure-devops/publish-pipeline.js +151 -117
- package/dist/templates/azure-devops/publish-pipeline.js.map +1 -1
- package/dist/templates/configs/filter-config.d.ts +1 -1
- package/dist/templates/configs/filter-config.d.ts.map +1 -1
- package/dist/templates/configs/filter-config.js +7 -110
- package/dist/templates/configs/filter-config.js.map +1 -1
- package/dist/templates/configs/override-config.d.ts +1 -1
- package/dist/templates/configs/override-config.d.ts.map +1 -1
- package/dist/templates/configs/override-config.js +8 -92
- package/dist/templates/configs/override-config.js.map +1 -1
- package/dist/templates/configs/schema-ref.d.ts +18 -0
- package/dist/templates/configs/schema-ref.d.ts.map +1 -0
- package/dist/templates/configs/schema-ref.js +26 -0
- package/dist/templates/configs/schema-ref.js.map +1 -0
- package/dist/templates/copilot/configure-filter-prompt.d.ts +10 -0
- package/dist/templates/copilot/configure-filter-prompt.d.ts.map +1 -0
- package/dist/templates/copilot/configure-filter-prompt.js +14 -0
- package/dist/templates/copilot/configure-filter-prompt.js.map +1 -0
- package/dist/templates/copilot/configure-overrides-prompt.d.ts +7 -0
- package/dist/templates/copilot/configure-overrides-prompt.d.ts.map +1 -0
- package/dist/templates/copilot/configure-overrides-prompt.js +12 -0
- package/dist/templates/copilot/configure-overrides-prompt.js.map +1 -0
- package/dist/templates/copilot/identity-setup-prompt.d.ts.map +1 -1
- package/dist/templates/copilot/identity-setup-prompt.js +19 -24
- package/dist/templates/copilot/identity-setup-prompt.js.map +1 -1
- package/dist/templates/generated/embedded-markdown.d.ts +8 -5
- package/dist/templates/generated/embedded-markdown.d.ts.map +1 -1
- package/dist/templates/generated/embedded-markdown.js +8 -5
- package/dist/templates/generated/embedded-markdown.js.map +1 -1
- package/dist/templates/github-actions/extract-workflow.d.ts +1 -1
- package/dist/templates/github-actions/extract-workflow.js +119 -119
- package/dist/templates/github-actions/publish-workflow.d.ts +3 -2
- package/dist/templates/github-actions/publish-workflow.d.ts.map +1 -1
- package/dist/templates/github-actions/publish-workflow.js +180 -112
- package/dist/templates/github-actions/publish-workflow.js.map +1 -1
- package/package.json +72 -69
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the APIOps CLI are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is inspired by [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
This project uses [Semantic Versioning](https://semver.org/) with alpha pre-release tags.
|
|
7
|
+
|
|
8
|
+
## [0.4.0-alpha.0] — 2026-07-01
|
|
9
|
+
|
|
10
|
+
### Breaking Changes
|
|
11
|
+
|
|
12
|
+
- **`apiops init` output filenames renamed** — identity setup guides and Copilot prompts are now emitted as `APIOPS-PIPELINE-IDENTITY-SETUP.md` / `APIOPS-WORKFLOW-IDENTITY-SETUP.md` and `apiops-setup-pipeline-identity.prompt.md` / `apiops-setup-workflow-identity.prompt.md`. Generated pipeline files are now named `run-apiops-extractor.yml` / `run-apiops-publisher.yml`. Users who re-run `apiops init` after upgrading will see the new files alongside any previously generated ones; delete the old files if you no longer want them tracked ([#200](https://github.com/Azure/apiops-cli/pull/200))
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- **Secret redaction in policy XML** — `apiops extract` now redacts inline secrets (including literal bearer tokens in `Authorization` headers) from extracted policy files while preserving named-value references. `apiops publish` performs a pre-flight scan of all artifacts and aborts (including in dry-run mode) if any `*** REDACTED ***` markers remain, preventing accidental secret exposure ([#199](https://github.com/Azure/apiops-cli/pull/199))
|
|
17
|
+
- **JSON schemas and Copilot prompts for filter/override configuration** — new `schemas/extractor-config.schema.json` and `schemas/override-config.schema.json` provide IDE autocompletion for `configuration.extractor.yaml` and `configuration.{env}.yaml` via the `yaml-language-server` `$schema` directive. `apiops init` now also lays down `apiops-configure-filter.prompt.md` and `apiops-configure-overrides.prompt.md` to conversationally guide users through building these files. Schemas are auto-generated from the TypeScript types on every build so they stay in sync ([#183](https://github.com/Azure/apiops-cli/pull/183))
|
|
18
|
+
- **Dry-run validation gate in generated publish pipelines** — GitHub Actions and Azure DevOps publish templates emitted by `apiops init` now run `apiops publish --dry-run` before every real publish step. If the dry-run fails (connectivity, invalid resources, permission errors), the pipeline halts before touching APIM, preventing partial-failure states ([#182](https://github.com/Azure/apiops-cli/pull/182))
|
|
19
|
+
- **Identity setup guides rewritten for UI workflows** — the manual identity setup guides emitted by `apiops init` now walk users through the Azure portal, Azure DevOps, and GitHub web UIs with step-by-step instructions and links to official docs, while the companion `.prompt.md` files remain the CLI/scripted path for Copilot-driven setup ([#200](https://github.com/Azure/apiops-cli/pull/200))
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
- **Removed stale `mcpServerInformation.json` references** — follow-up to #173, which moved MCP server configuration into `apiInformation.json`. Documentation (`docs/reference/artifact-format.md`, `docs/reference/resource-types.md`) and the `all-resource-types` integration test manifest now match the post-#173 artifact layout ([#205](https://github.com/Azure/apiops-cli/pull/205))
|
|
24
|
+
|
|
25
|
+
## [0.3.0-alpha.0] — 2026-06-25
|
|
26
|
+
|
|
27
|
+
### Breaking Changes
|
|
28
|
+
|
|
29
|
+
- **Removed unimplemented CLI options** — `--spec-format` (extract command) and `--otel` (global) have been removed from the CLI, docs, and specs. Both were documented but never implemented, so no functional behavior changes for users who weren't relying on them ([#165](https://github.com/Azure/apiops-cli/pull/165))
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
- **Wildcard pattern matching in filter configuration** — all name-based filter fields (`apis`, `backends`, `namedValues`, etc.) now accept glob-style patterns with `*` and `?`. Exact names still work alongside patterns ([#160](https://github.com/Azure/apiops-cli/pull/160))
|
|
34
|
+
- **Workspace sub-resource filtering** — nested workspace filters are now applied at runtime (previously documented but not implemented). Wildcard patterns in the `workspaces` list trigger discovery-then-filter instead of being used as literal names. Adds `schemas` field on `WorkspaceSubFilter` ([#160](https://github.com/Azure/apiops-cli/pull/160))
|
|
35
|
+
- **Token substitution validation in generated GitHub Actions publish workflow** — `apiops init` now adds a validation step between token substitution and publish that greps for unresolved \`{#[...]#}\` tokens and fails the job with a clear list of unmapped names. Mirrors the existing Azure DevOps behavior ([#158](https://github.com/Azure/apiops-cli/pull/158))
|
|
36
|
+
- **MCP publish from embedded API metadata** — MCP configuration is now read/written exclusively from `apiInformation.json`; the redundant `mcpServerInformation.json` sidecar is no longer produced or consumed. Legacy sidecars are ignored. Tool operation references are rewritten from source to target ARM IDs before override application so overrides still win ([#173](https://github.com/Azure/apiops-cli/pull/173))
|
|
37
|
+
- **Association scope tracking for round-trip correctness** — extract/publish now records and reconstructs whether each linked resource (e.g. workspace product → built-in group) is service-scoped or workspace-scoped, producing correct ARM paths in both directions. Backward-compatible with legacy artifact files that only contain `name`. 409 "link already exists" responses are treated as idempotent successes ([#175](https://github.com/Azure/apiops-cli/pull/175))
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
- **Resource group log masking preserves meaningful segments** — `Protect-ResourceGroupName` now detects resource group names ending with a long numeric suffix (>=6 digits, typical of GitHub `run_id` values) and preserves the last dash-separated segment before the number. Output goes from `rg-...1553476` to `rg-...src-27781553476`, making source vs target groups distinguishable in logs ([#168](https://github.com/Azure/apiops-cli/pull/168))
|
|
42
|
+
- **Override config template no longer hardcodes a secret** — the generated `configuration.override.yaml` from `apiops init` now uses a \`{#[DB\_Connection\_String]#}\` token placeholder for the connection-string example (aligned with the pipeline substitution format) and drops the confusing "APIOps Toolkit" reference comment ([#164](https://github.com/Azure/apiops-cli/pull/164))
|
|
43
|
+
|
|
44
|
+
### Docs & Testing
|
|
45
|
+
|
|
46
|
+
- **Incremental publish behavior documented** — clarified that changes to override files alone don't trigger incremental publish; only API/policy/etc. artifact changes do ([#159](https://github.com/Azure/apiops-cli/pull/159))
|
|
47
|
+
- **Environment overrides guide improvements** — expanded examples and clarifications in `docs/guides/environment-overrides.md` ([#166](https://github.com/Azure/apiops-cli/pull/166))
|
|
48
|
+
- **All-types round-trip test imports Petstore Swagger** — the all-resource-types integration test now imports the canonical Petstore Swagger spec in both V2 and V3 forms, exercising a broader surface ([#171](https://github.com/Azure/apiops-cli/pull/171))
|
|
49
|
+
|
|
50
|
+
## [0.2.1-alpha.0] — 2026-06-12
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
- **Token substitution in publish pipelines** — \`{#[TOKEN\_NAME]#}\` placeholders are now resolved during publish, matching APIOps Toolkit behavior ([#127](https://github.com/Azure/apiops-cli/pull/127))
|
|
55
|
+
|
|
56
|
+
### Bug Fixes
|
|
57
|
+
|
|
58
|
+
- **Named value reference resolution** — logger credentials now correctly resolve `{{displayName}}` refs across environments; auto-generated named values are published when an override is provided ([#145](https://github.com/Azure/apiops-cli/pull/145))
|
|
59
|
+
- **Redacted secret guard** — secret named values with `*** REDACTED ***` placeholder are skipped during publish with a clear warning ([#145](https://github.com/Azure/apiops-cli/pull/145))
|
|
60
|
+
- **Schema ref stripping extended** — removes stale `schemaId`/`typeName` from `queryParameters`, `headers`, `templateParameters`, and response headers during operation PATCH ([#145](https://github.com/Azure/apiops-cli/pull/145))
|
|
61
|
+
- **Workspace ARM paths** — use workspace-specific ARM paths for association resources (tag links, product links) ([#136](https://github.com/Azure/apiops-cli/pull/136))
|
|
62
|
+
|
|
63
|
+
### Docs & Testing
|
|
64
|
+
|
|
65
|
+
- **Comprehensive environment override documentation** — added examples for all resource types, auto-generated named value walkthrough, and gotchas for secrets and loggers ([#145](https://github.com/Azure/apiops-cli/pull/145))
|
|
66
|
+
- **Override config template** — added logger `credentials.instrumentationKey` example ([#145](https://github.com/Azure/apiops-cli/pull/145))
|
|
67
|
+
|
|
68
|
+
## [0.2.0-alpha.0] — 2026-06-10
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
- **A2A (Agent-to-Agent) API support** — full extract/publish round-trip for A2A protocol APIs ([#89](https://github.com/Azure/apiops-cli/pull/89))
|
|
73
|
+
- **ApiOperation as first-class resource** — operations are persisted individually with PATCH reconciliation for drift-free round-trips ([#104](https://github.com/Azure/apiops-cli/pull/104))
|
|
74
|
+
- **Async LRO polling** — long-running APIM operations are polled to completion; OpenAPI specs are sanitized before import ([#112](https://github.com/Azure/apiops-cli/pull/112))
|
|
75
|
+
- **Workspace support on V2 SKUs** — workspace-scoped resources (APIs, products, backends, named values, tags) are extracted and published with correct ARM paths ([#128](https://github.com/Azure/apiops-cli/pull/128), [#129](https://github.com/Azure/apiops-cli/pull/129))
|
|
76
|
+
- **Integration test split into 7 phases** — deploy, extract, validate, override, publish, compare, teardown — each runnable independently ([#92](https://github.com/Azure/apiops-cli/pull/92))
|
|
77
|
+
|
|
78
|
+
### Bug Fixes
|
|
79
|
+
|
|
80
|
+
- **Override & filter config alignment** — fully aligned with APIOps Toolkit array-based format ([#102](https://github.com/Azure/apiops-cli/pull/102), [#115](https://github.com/Azure/apiops-cli/pull/115))
|
|
81
|
+
- **Schema ref stripping** — removes stale `schemaId`/`typeName` from operation representations during post-import PATCH reconciliation ([#111](https://github.com/Azure/apiops-cli/pull/111))
|
|
82
|
+
- **Windows cmd.exe quoting** — fixed stdin and argument quoting issues in `Invoke-MaskedProcess` ([#110](https://github.com/Azure/apiops-cli/pull/110))
|
|
83
|
+
|
|
84
|
+
### Docs & Testing
|
|
85
|
+
|
|
86
|
+
- **Extract filter documentation** — documented full filter surface and explicit exclude-all semantics ([#103](https://github.com/Azure/apiops-cli/pull/103))
|
|
87
|
+
- **Hardened teardown** — Phase 7 handles APIM delete/purge races and soft-delete conflicts ([#122](https://github.com/Azure/apiops-cli/pull/122))
|
|
88
|
+
- **Package-build test README** — added single-test run command for quick iteration ([#87](https://github.com/Azure/apiops-cli/pull/87))
|
|
89
|
+
|
|
90
|
+
## [0.1.7-alpha.0] — 2026-06-01
|
|
91
|
+
|
|
92
|
+
### Features
|
|
93
|
+
|
|
94
|
+
- **Workspace-scoped resource refactor** — uses `workspaceSupported` flag to determine which resource types are available in workspace containers ([#84](https://github.com/Azure/apiops-cli/pull/84))
|
|
95
|
+
|
|
96
|
+
### Bug Fixes
|
|
97
|
+
|
|
98
|
+
- **Premium SKU round-trip fixes** — resolved test failures specific to Premium tier ([#80](https://github.com/Azure/apiops-cli/pull/80))
|
|
99
|
+
- **Workspace unit test fixes** — corrected test failures introduced by workspace refactor ([#93](https://github.com/Azure/apiops-cli/pull/93))
|
|
100
|
+
|
|
101
|
+
### Docs & Testing
|
|
102
|
+
|
|
103
|
+
- **Air-gapped setup walkthroughs** — step-by-step guides for GitHub Actions and Azure DevOps in disconnected environments ([#77](https://github.com/Azure/apiops-cli/pull/77))
|
|
104
|
+
- **APIOps terminology update** — replaced "APIOps v1/v2" with "APIOps Toolkit/CLI" across all docs ([#94](https://github.com/Azure/apiops-cli/pull/94))
|
|
105
|
+
- **API version docs correction** — fixed default API version in documentation ([#81](https://github.com/Azure/apiops-cli/pull/81))
|
|
106
|
+
- **Integration test skill notes** — added AADSTS700016 and UI access troubleshooting ([#83](https://github.com/Azure/apiops-cli/pull/83))
|
|
107
|
+
|
|
108
|
+
## [0.1.6-alpha.0] — 2026-05-21
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
- **MCP server support** — extract and publish MCP server configurations ([#36](https://github.com/Azure/apiops-cli/pull/36), [#51](https://github.com/Azure/apiops-cli/pull/51))
|
|
113
|
+
- **Publish `--commit-id` flag** — CLI-over-env precedence for commit tracking ([#47](https://github.com/Azure/apiops-cli/pull/47))
|
|
114
|
+
- **Reusable integration test workflow** — `workflow_call` support for CI reuse ([#42](https://github.com/Azure/apiops-cli/pull/42))
|
|
115
|
+
|
|
116
|
+
### Bug Fixes
|
|
117
|
+
|
|
118
|
+
- **AzDO publish pipeline flag** — corrected `--overrides` (was `--override`) in Azure DevOps template ([#75](https://github.com/Azure/apiops-cli/pull/75))
|
|
119
|
+
- **Empty override file handling** — gracefully handles empty or missing override files ([#33](https://github.com/Azure/apiops-cli/pull/33))
|
|
120
|
+
|
|
121
|
+
### Docs & Testing
|
|
122
|
+
|
|
123
|
+
- **User-facing documentation** — added getting started guides, architecture diagram, and agent charters ([#69](https://github.com/Azure/apiops-cli/pull/69), [#56](https://github.com/Azure/apiops-cli/pull/56))
|
|
124
|
+
- **Open-source readiness** — copyright headers, sensitivity audit, accuracy policies ([#78](https://github.com/Azure/apiops-cli/pull/78))
|
|
125
|
+
- **Security hardening** — added SecurityExpert to Squad team ([#70](https://github.com/Azure/apiops-cli/pull/70))
|
|
126
|
+
|
|
127
|
+
## [0.1.5-alpha.1] — 2026-05-07
|
|
128
|
+
|
|
129
|
+
### Features
|
|
130
|
+
|
|
131
|
+
- **Azure DevOps `init`** — interactive Copilot prompt with managed identity / WIF support ([#31](https://github.com/Azure/apiops-cli/pull/31))
|
|
132
|
+
- **Public npm registry support** — install directly from `@peterhauge/apiops-cli` on npmjs.com ([#28](https://github.com/Azure/apiops-cli/pull/28))
|
|
133
|
+
|
|
134
|
+
### Bug Fixes
|
|
135
|
+
|
|
136
|
+
- **Empty override file** — fixed crash when override file exists but is empty ([#33](https://github.com/Azure/apiops-cli/pull/33))
|
|
137
|
+
- **Dependency bump** — updated `uuid` and `@azure/msal-node` ([#26](https://github.com/Azure/apiops-cli/pull/26))
|
|
138
|
+
|
|
139
|
+
### Docs & Testing
|
|
140
|
+
|
|
141
|
+
- **Auth documentation** — clarified OIDC vs client-secret auth paths ([#27](https://github.com/Azure/apiops-cli/pull/27))
|
|
142
|
+
- **Azure DevOps manual setup** — updated instructions for `apiops init --ci azure-devops` ([#30](https://github.com/Azure/apiops-cli/pull/30))
|
|
143
|
+
|
|
144
|
+
## [0.1.4-alpha.1] — 2026-04-29
|
|
145
|
+
|
|
146
|
+
### Features
|
|
147
|
+
|
|
148
|
+
- **User-Agent header** — all REST API calls now include a `User-Agent` header for tracing ([#21](https://github.com/Azure/apiops-cli/pull/21))
|
|
149
|
+
- **Optional `--cli-package` parameter** — enables using apiops from the public npm registry without specifying a local package path ([#20](https://github.com/Azure/apiops-cli/pull/20))
|
|
150
|
+
|
|
151
|
+
## [0.1.2-alpha.0] — 2026-04-28
|
|
152
|
+
|
|
153
|
+
### Features
|
|
154
|
+
|
|
155
|
+
- **Initial release** — core extract, publish, and init commands for Azure API Management ([#15](https://github.com/Azure/apiops-cli/pull/15))
|
|
156
|
+
- **CodeQL analysis** — automated security scanning workflow ([#19](https://github.com/Azure/apiops-cli/pull/19))
|
|
157
|
+
|
|
158
|
+
[0.4.0-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.3.0-alpha.0...v0.4.0-alpha.0
|
|
159
|
+
[0.3.0-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.2.1-alpha.0...v0.3.0-alpha.0
|
|
160
|
+
[0.2.1-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.2.0-alpha.0...v0.2.1-alpha.0
|
|
161
|
+
[0.2.0-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.1.7-alpha.0...v0.2.0-alpha.0
|
|
162
|
+
[0.1.7-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.1.6-alpha.0...v0.1.7-alpha.0
|
|
163
|
+
[0.1.6-alpha.0]: https://github.com/Azure/apiops-cli/compare/v0.1.5-alpha.1...v0.1.6-alpha.0
|
|
164
|
+
[0.1.5-alpha.1]: https://github.com/Azure/apiops-cli/compare/v0.1.4-alpha.1...v0.1.5-alpha.1
|
|
165
|
+
[0.1.4-alpha.1]: https://github.com/Azure/apiops-cli/compare/v0.1.2-alpha.0...v0.1.4-alpha.1
|
|
166
|
+
[0.1.2-alpha.0]: https://github.com/Azure/apiops-cli/releases/tag/v0.1.2-alpha.0
|
package/README.md
CHANGED
|
@@ -1,169 +1,173 @@
|
|
|
1
|
-
# apiops
|
|
2
|
-
|
|
3
|
-
`apiops` is a CLI tool for Azure API Management (APIM) configuration-as-code. Extract your APIM service configuration to local artifact files, publish those artifacts back to Azure, and scaffold CI/CD pipelines — all from the command line.
|
|
4
|
-
|
|
5
|
-
| | |
|
|
6
|
-
|---|---|
|
|
7
|
-
| **Source code** | [github.com/Azure/apiops-cli](https://github.com/Azure/apiops-cli) |
|
|
8
|
-
| **Issues** | [GitHub Issues](https://github.com/Azure/apiops-cli/issues) |
|
|
9
|
-
| **Architecture** | [docs/architecture.md](./docs/architecture.md) |
|
|
10
|
-
|
|
11
|
-
## Getting started
|
|
12
|
-
|
|
13
|
-
**Prerequisites:** An Azure subscription with an existing APIM resource, and Node.js ≥ 22.
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install -g @peterhauge/apiops-cli
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Authentication
|
|
20
|
-
|
|
21
|
-
`apiops` uses [`@azure/identity`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity) `DefaultAzureCredential` for authentication.
|
|
22
|
-
|
|
23
|
-
### Generated GitHub Actions workflows (`apiops init`)
|
|
24
|
-
|
|
25
|
-
Workflows scaffolded by `apiops init` authenticate via **OIDC (workload identity federation)** — no client secret is stored or needed. Run `apiops init` and use the generated `identity-setup.prompt.md` to create an Azure AD application with federated credentials for your GitHub repository.
|
|
26
|
-
|
|
27
|
-
Required repository secrets: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`
|
|
28
|
-
|
|
29
|
-
### Local CLI / other CI systems
|
|
30
|
-
|
|
31
|
-
When running `apiops` outside a GitHub Actions OIDC context you can supply credentials explicitly:
|
|
32
|
-
|
|
33
|
-
- **Environment variables:** `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID`, `AZURE_SUBSCRIPTION_ID`
|
|
34
|
-
- **CLI flags:** `--client-id`, `--client-secret`, `--tenant-id`, `--subscription-id`
|
|
35
|
-
- **Managed Identity / Workload Identity:** Supported automatically via `DefaultAzureCredential` when running on Azure-hosted infrastructure (VMs, App Service, etc.) or in Azure Pipelines with workload identity federation configured.
|
|
36
|
-
|
|
37
|
-
## Commands
|
|
38
|
-
|
|
39
|
-
### `apiops extract`
|
|
40
|
-
|
|
41
|
-
Extract APIM service configuration to local artifact files.
|
|
42
|
-
|
|
43
|
-
| Flag | Default | Description |
|
|
44
|
-
|------|---------|-------------|
|
|
45
|
-
| `--resource-group <rg>` | *(required)* | Azure resource group |
|
|
46
|
-
| `--service-name <name>` | *(required)* | APIM service name |
|
|
47
|
-
| `--output <dir>` | `./apim-artifacts` | Output directory |
|
|
48
|
-
| `--filter <path>` | | Extract only matching resources |
|
|
49
|
-
| `--no-transitive` | | Skip transitive dependencies |
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
--
|
|
58
|
-
--
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
--
|
|
64
|
-
--
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
--
|
|
71
|
-
--
|
|
72
|
-
--
|
|
73
|
-
--
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
|
83
|
-
|
|
84
|
-
| `--
|
|
85
|
-
| `--
|
|
86
|
-
| `--
|
|
87
|
-
| `--
|
|
88
|
-
| `--
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
--
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
--
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
--
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
|
119
|
-
|
|
120
|
-
| `--
|
|
121
|
-
| `--
|
|
122
|
-
| `--
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
apiops init
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
138
|
-
| `--
|
|
139
|
-
| `--
|
|
140
|
-
| `--
|
|
141
|
-
| `--
|
|
142
|
-
| `--
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
[
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
1
|
+
# apiops
|
|
2
|
+
|
|
3
|
+
`apiops` is a CLI tool for Azure API Management (APIM) configuration-as-code. Extract your APIM service configuration to local artifact files, publish those artifacts back to Azure, and scaffold CI/CD pipelines — all from the command line.
|
|
4
|
+
|
|
5
|
+
| | |
|
|
6
|
+
|---|---|
|
|
7
|
+
| **Source code** | [github.com/Azure/apiops-cli](https://github.com/Azure/apiops-cli) |
|
|
8
|
+
| **Issues** | [GitHub Issues](https://github.com/Azure/apiops-cli/issues) |
|
|
9
|
+
| **Architecture** | [docs/architecture.md](./docs/architecture.md) |
|
|
10
|
+
|
|
11
|
+
## Getting started
|
|
12
|
+
|
|
13
|
+
**Prerequisites:** An Azure subscription with an existing APIM resource, and Node.js ≥ 22.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @peterhauge/apiops-cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Authentication
|
|
20
|
+
|
|
21
|
+
`apiops` uses [`@azure/identity`](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity) `DefaultAzureCredential` for authentication.
|
|
22
|
+
|
|
23
|
+
### Generated GitHub Actions workflows (`apiops init`)
|
|
24
|
+
|
|
25
|
+
Workflows scaffolded by `apiops init` authenticate via **OIDC (workload identity federation)** — no client secret is stored or needed. Run `apiops init` and use the generated `identity-setup.prompt.md` to create an Azure AD application with federated credentials for your GitHub repository.
|
|
26
|
+
|
|
27
|
+
Required repository secrets: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`
|
|
28
|
+
|
|
29
|
+
### Local CLI / other CI systems
|
|
30
|
+
|
|
31
|
+
When running `apiops` outside a GitHub Actions OIDC context you can supply credentials explicitly:
|
|
32
|
+
|
|
33
|
+
- **Environment variables:** `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID`, `AZURE_SUBSCRIPTION_ID`
|
|
34
|
+
- **CLI flags:** `--client-id`, `--client-secret`, `--tenant-id`, `--subscription-id`
|
|
35
|
+
- **Managed Identity / Workload Identity:** Supported automatically via `DefaultAzureCredential` when running on Azure-hosted infrastructure (VMs, App Service, etc.) or in Azure Pipelines with workload identity federation configured.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### `apiops extract`
|
|
40
|
+
|
|
41
|
+
Extract APIM service configuration to local artifact files.
|
|
42
|
+
|
|
43
|
+
| Flag | Default | Description |
|
|
44
|
+
|------|---------|-------------|
|
|
45
|
+
| `--resource-group <rg>` | *(required)* | Azure resource group |
|
|
46
|
+
| `--service-name <name>` | *(required)* | APIM service name |
|
|
47
|
+
| `--output <dir>` | `./apim-artifacts` | Output directory |
|
|
48
|
+
| `--filter <path>` | | Extract only matching resources |
|
|
49
|
+
| `--no-transitive` | | Skip transitive dependencies |
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
apiops extract --help
|
|
53
|
+
|
|
54
|
+
# Basic extraction to the default output directory
|
|
55
|
+
apiops extract \
|
|
56
|
+
--resource-group <rg> \
|
|
57
|
+
--service-name <name> \
|
|
58
|
+
--output ./apim-artifacts
|
|
59
|
+
|
|
60
|
+
# Extract a filtered subset of resources
|
|
61
|
+
apiops extract \
|
|
62
|
+
--resource-group <rg> \
|
|
63
|
+
--service-name <name> \
|
|
64
|
+
--filter ./filter.yaml
|
|
65
|
+
|
|
66
|
+
# Authenticate explicitly with a service principal
|
|
67
|
+
apiops extract \
|
|
68
|
+
--resource-group <rg> \
|
|
69
|
+
--service-name <name> \
|
|
70
|
+
--client-id $AZURE_CLIENT_ID \
|
|
71
|
+
--client-secret $AZURE_CLIENT_SECRET \
|
|
72
|
+
--tenant-id $AZURE_TENANT_ID \
|
|
73
|
+
--subscription-id $AZURE_SUBSCRIPTION_ID
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### `apiops publish`
|
|
77
|
+
|
|
78
|
+
Publish local artifact files to an Azure APIM service.
|
|
79
|
+
|
|
80
|
+
| Flag | Default | Description |
|
|
81
|
+
|------|---------|-------------|
|
|
82
|
+
| `--resource-group <rg>` | *(required)* | Azure resource group |
|
|
83
|
+
| `--service-name <name>` | *(required)* | APIM service name |
|
|
84
|
+
| `--source <dir>` | `./apim-artifacts` | Source artifacts directory |
|
|
85
|
+
| `--overrides <path>` | | Path to overrides file |
|
|
86
|
+
| `--commit-id <sha>` | | Git commit SHA for incremental publish |
|
|
87
|
+
| `--dry-run` | | Preview changes without applying |
|
|
88
|
+
| `--delete-unmatched` | | Delete resources not in artifacts (mutually exclusive with `--commit-id`) |
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
apiops publish --help
|
|
92
|
+
|
|
93
|
+
# Preview changes without applying them
|
|
94
|
+
apiops publish \
|
|
95
|
+
--resource-group <rg> \
|
|
96
|
+
--service-name <name> \
|
|
97
|
+
--dry-run
|
|
98
|
+
|
|
99
|
+
# Publish and remove resources not present in the local artifacts
|
|
100
|
+
apiops publish \
|
|
101
|
+
--resource-group <rg> \
|
|
102
|
+
--service-name <name> \
|
|
103
|
+
--delete-unmatched
|
|
104
|
+
|
|
105
|
+
# Incremental publish for a specific commit
|
|
106
|
+
apiops publish \
|
|
107
|
+
--resource-group <rg> \
|
|
108
|
+
--service-name <name> \
|
|
109
|
+
--commit-id <sha>
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### `apiops init`
|
|
113
|
+
|
|
114
|
+
Scaffold a new APIM artifacts repository with CI/CD pipelines.
|
|
115
|
+
|
|
116
|
+
| Flag | Description |
|
|
117
|
+
|------|-------------|
|
|
118
|
+
| `--cli-package <path>` | Path to a local `.tgz` tarball |
|
|
119
|
+
| `--ci <platform>` | `github-actions` or `azure-devops` |
|
|
120
|
+
| `--environments <list>` | Comma-separated environments (e.g. `dev,prod`) |
|
|
121
|
+
| `--non-interactive` | Skip all prompts |
|
|
122
|
+
| `--force` | Overwrite existing files |
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
apiops init --help
|
|
126
|
+
|
|
127
|
+
apiops init \
|
|
128
|
+
--ci github-actions \
|
|
129
|
+
--environments dev,prod
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Global options
|
|
133
|
+
|
|
134
|
+
| Option | Default | Description |
|
|
135
|
+
|--------|---------|-------------|
|
|
136
|
+
| `--subscription-id <id>` | `AZURE_SUBSCRIPTION_ID` env var | Azure subscription ID |
|
|
137
|
+
| `--cloud <name>` | `public` | `public`, `china`, `usgov`, `germany` |
|
|
138
|
+
| `--log-level <level>` | `info` | `debug`, `info`, `warn`, `error` |
|
|
139
|
+
| `--format <type>` | `text` | `text` or `json` |
|
|
140
|
+
| `--client-id <id>` | `AZURE_CLIENT_ID` env var | Service principal client ID |
|
|
141
|
+
| `--client-secret <secret>` | `AZURE_CLIENT_SECRET` env var | Service principal secret |
|
|
142
|
+
| `--tenant-id <id>` | `AZURE_TENANT_ID` env var | Azure AD tenant ID |
|
|
143
|
+
|
|
144
|
+
## Changelog
|
|
145
|
+
|
|
146
|
+
See [CHANGELOG.md](./CHANGELOG.md) for release notes and the list of changes in each version. To see what has changed
|
|
147
|
+
since the version you have installed, compare tags on GitHub
|
|
148
|
+
(e.g. [`v0.2.1-alpha.0...main`](https://github.com/Azure/apiops-cli/compare/v0.2.1-alpha.0...main)).
|
|
149
|
+
|
|
150
|
+
## Contributing
|
|
151
|
+
|
|
152
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for how to build, test, debug, and submit changes.
|
|
153
|
+
|
|
154
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
155
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact
|
|
156
|
+
[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
|
157
|
+
|
|
158
|
+
## Security
|
|
159
|
+
|
|
160
|
+
Please do not report security vulnerabilities through public GitHub issues. Instead, please follow the instructions in
|
|
161
|
+
our [SECURITY.md](./SECURITY.md).
|
|
162
|
+
|
|
163
|
+
## Trademarks
|
|
164
|
+
|
|
165
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
|
|
166
|
+
trademarks or logos is subject to and must follow
|
|
167
|
+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
|
|
168
|
+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
|
|
169
|
+
Any use of third-party trademarks or logos are subject to those third-party's policies.
|
|
170
|
+
|
|
171
|
+
## License
|
|
172
|
+
|
|
173
|
+
[MIT](./LICENSE.md)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Extract command CLI registration
|
|
3
3
|
* Commander subcommand with --resource-group, --service-name, --output,
|
|
4
|
-
* --filter, --no-transitive
|
|
4
|
+
* --filter, --no-transitive flags.
|
|
5
5
|
* Includes --format json: machine-readable JSON output mode.
|
|
6
6
|
*/
|
|
7
7
|
import { Command } from 'commander';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-command.d.ts","sourceRoot":"","sources":["../../src/cli/extract-command.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"extract-command.d.ts","sourceRoot":"","sources":["../../src/cli/extract-command.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAqB9C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Extract command CLI registration
|
|
5
5
|
* Commander subcommand with --resource-group, --service-name, --output,
|
|
6
|
-
* --filter, --no-transitive
|
|
6
|
+
* --filter, --no-transitive flags.
|
|
7
7
|
* Includes --format json: machine-readable JSON output mode.
|
|
8
8
|
*/
|
|
9
9
|
import { Command } from 'commander';
|
|
@@ -24,7 +24,6 @@ export function createExtractCommand() {
|
|
|
24
24
|
.option('--output <dir>', 'Output directory path', './apim-artifacts')
|
|
25
25
|
.option('--filter <path>', 'Filter configuration YAML file')
|
|
26
26
|
.option('--no-transitive', 'Disable transitive dependency inclusion')
|
|
27
|
-
.option('--spec-format <format>', 'API specification format (openapi-v2-json, openapi-v3-json, openapi-v3-yaml)')
|
|
28
27
|
.action(async (options, command) => {
|
|
29
28
|
const globalOpts = command.optsWithGlobals();
|
|
30
29
|
await executeExtract(options, globalOpts);
|
|
@@ -70,7 +69,6 @@ async function executeExtract(options, globalOpts) {
|
|
|
70
69
|
outputDir: options.output,
|
|
71
70
|
filter: filterConfig,
|
|
72
71
|
includeTransitive: options.transitive,
|
|
73
|
-
specFormat: options.specFormat,
|
|
74
72
|
logLevel: parseLogLevel(globalOpts.logLevel ?? 'info'),
|
|
75
73
|
};
|
|
76
74
|
// Create client and store
|
|
@@ -88,7 +86,7 @@ async function executeExtract(options, globalOpts) {
|
|
|
88
86
|
process.exit(result.exitCode);
|
|
89
87
|
}
|
|
90
88
|
/**
|
|
91
|
-
*
|
|
89
|
+
* JSON output mode for extract.
|
|
92
90
|
* Machine-readable JSON to stdout with resource counts and file paths.
|
|
93
91
|
*/
|
|
94
92
|
function outputJson(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-command.js","sourceRoot":"","sources":["../../src/cli/extract-command.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAoB,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"extract-command.js","sourceRoot":"","sources":["../../src/cli/extract-command.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAoB,MAAM,gCA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CAAC,KAAK,CAClB,YAAY,MAAM,CAAC,cAAc,yBAAyB,MAAM,CAAC,WAAW,WAAW,CACxF,CAAC;AACJ,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Commander program entry point
|
|
6
6
|
* Sets up global options and subcommand registration pattern
|
|
7
7
|
*/
|
|
8
8
|
import { Command, Option } from 'commander';
|
|
@@ -24,7 +24,6 @@ program
|
|
|
24
24
|
.addOption(new Option('--log-level <level>', 'Log level: debug, info, warn, or error')
|
|
25
25
|
.choices(['debug', 'info', 'warn', 'error'])
|
|
26
26
|
.default('info'))
|
|
27
|
-
.option('--otel <path>', 'Path to OpenTelemetry config YAML')
|
|
28
27
|
.option('--format <type>', 'Output format: text or json', 'text')
|
|
29
28
|
.option('--subscription-id <id>', 'Azure subscription ID')
|
|
30
29
|
.option('--cloud <name>', 'Sovereign cloud: public, china, usgov, germany', 'public')
|
|
@@ -35,7 +34,7 @@ program
|
|
|
35
34
|
program.hook('preAction', (thisCommand) => {
|
|
36
35
|
const opts = thisCommand.optsWithGlobals();
|
|
37
36
|
logger.configure({ level: parseLogLevel(opts.logLevel ?? 'info') });
|
|
38
|
-
//
|
|
37
|
+
// Set DefaultAzureCredential env vars from explicit auth flags.
|
|
39
38
|
// This ensures the ServicePrincipal credential is tried first,
|
|
40
39
|
// avoiding interactive browser prompts in CI/CD pipelines.
|
|
41
40
|
if (opts.clientId) {
|