Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copilot/skills/release-apiops-version/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Skill: Release apiops-cli Version

**Confidence:** high
**Scope:** Any agent (or human) cutting a new release of `@peterhauge/apiops-cli`
**Scope:** Any agent (or human) cutting a new release of `@azure-tools/apiops-cli`

## What

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ body:
id: version
attributes:
label: apiops CLI version
description: "Run `apiops --version` (or `npm list -g @peterhauge/apiops-cli`) to find the installed version."
description: "Run `apiops --version` (or `npm list -g @azure-tools/apiops-cli`) to find the installed version."
validations:
required: true

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Desktop.ini
*~
.idea/

# VS Code local debug config (may contain local subscription IDs / paths)
.vscode/launch.json

# Local testing output (use --output .local-extract for local runs)
.local-extract*/

Expand Down
2 changes: 1 addition & 1 deletion .squad/agents/nodejsdev/charter.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ These are the concrete conventions I enforce in this project.
- CLI commands wire Commander options to service functions — thin layer, no business logic in commands

#### Dual-Mode Package Consumption (Decision: 2026-04-29)
- **Public npm mode** (default): `--cli-package` omitted → generates `package.json` referencing `"@peterhauge/apiops-cli": "latest"` from npm
- **Public npm mode** (default): `--cli-package` omitted → generates `package.json` referencing `"@azure-tools/apiops-cli": "latest"` from npm
- **Local tarball mode**: `--cli-package <path>` → copies tarball to `.apiops/` directory, generates `package.json` with `"apiops": "file:.apiops/{tarball}"`
- Both modes must work — backward compatibility is non-negotiable

Expand Down
4 changes: 2 additions & 2 deletions .squad/agents/nodejsdev/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ program.version(packageJson.version);

### 2026-04-29: Dual-Mode Init — Public npm vs Local Tarball

**Problem:** After publishing `@peterhauge/apiops-cli` to npm, `apiops init` still required `--cli-package <path>` pointing to a local .tgz tarball, making the workflow cumbersome for users who just want to use the public package.
**Problem:** After publishing `@azure-tools/apiops-cli` to npm, `apiops init` still required `--cli-package <path>` pointing to a local .tgz tarball, making the workflow cumbersome for users who just want to use the public package.

**Solution:** Made `--cli-package` optional and implemented two modes:

Expand All @@ -133,7 +133,7 @@ program.version(packageJson.version);

2. **Public npm mode** (when `--cli-package` NOT provided):
- No tarball copy, no `.apiops/` directory
- Generates package.json with `"@peterhauge/apiops-cli": "latest"`
- Generates package.json with `"@azure-tools/apiops-cli": "latest"`
- Use case: Standard consumption after publishing to npm

**Implementation Details:**
Expand Down
2 changes: 1 addition & 1 deletion .squad/agents/testengineer/history.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
- Updated local mode tests to use `{ mode: 'local', tarballRelPath: '...' }`
- Added 6 new tests for npm mode covering:
- Valid JSON generation
- `@peterhauge/apiops-cli` dependency with `latest` version
- `@azure-tools/apiops-cli` dependency with `latest` version
- No `apiops` dependency (should be undefined)
- Standard package.json properties (private, name, version)
- Newline termination
Expand Down
4 changes: 2 additions & 2 deletions .squad/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
### 2026-04-29T14:30:00Z: apiops init Dual-Mode Package Consumption
**By:** NodeJsDev
**Status:** Implemented
**What:** Made `--cli-package` optional in `apiops init`. The command now supports two package consumption modes: (1) **Public npm mode** (default, when `--cli-package` NOT provided): generates package.json with `"@peterhauge/apiops-cli": "latest"`, no local tarball copy, no `.apiops/` directory created, standard consumption pattern after npm publish. (2) **Local tarball mode** (when `--cli-package <path>` provided): copies tarball to `.apiops/` directory, generates package.json with `"apiops": "file:.apiops/{tarball}"`, preserves existing behavior for local development/testing.
**Why:** After publishing to npm as `@peterhauge/apiops-cli`, requiring users to download the package and run `apiops init --cli-package ./tarball.tgz` added unnecessary friction. Most users want to reference the public package directly. The change is backward compatible — existing workflows with `--cli-package` continue to work unchanged. Improves user experience with simpler onboarding.
**What:** Made `--cli-package` optional in `apiops init`. The command now supports two package consumption modes: (1) **Public npm mode** (default, when `--cli-package` NOT provided): generates package.json with `"@azure-tools/apiops-cli": "latest"`, no local tarball copy, no `.apiops/` directory created, standard consumption pattern after npm publish. (2) **Local tarball mode** (when `--cli-package <path>` provided): copies tarball to `.apiops/` directory, generates package.json with `"apiops": "file:.apiops/{tarball}"`, preserves existing behavior for local development/testing.
**Why:** After publishing to npm as `@azure-tools/apiops-cli`, requiring users to download the package and run `apiops init --cli-package ./tarball.tgz` added unnecessary friction. Most users want to reference the public package directly. The change is backward compatible — existing workflows with `--cli-package` continue to work unchanged. Improves user experience with simpler onboarding.

### 2026-04-21T19:35:00Z: SOAP/WADL spec extraction prefers link format with inline XML fallback
**By:** ApimExpert (via Squad session with a user)
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ This project uses [Semantic Versioning](https://semver.org/) with alpha pre-rele
### Features

- **Azure DevOps `init`** — interactive Copilot prompt with managed identity / WIF support ([#31](https://github.com/Azure/apiops-cli/pull/31))
- **Public npm registry support** — install directly from `@peterhauge/apiops-cli` on npmjs.com ([#28](https://github.com/Azure/apiops-cli/pull/28))
- **Public npm registry support** — install directly from `@azure-tools/apiops-cli` on npmjs.com ([#28](https://github.com/Azure/apiops-cli/pull/28))

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
**Prerequisites:** An Azure subscription with an existing APIM resource, and Node.js ≥ 22.

```bash
npm install -g @peterhauge/apiops-cli
npm install -g @azure-tools/apiops-cli
```

## Authentication
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ flowchart LR
## Install

```bash
npm install -g @peterhauge/apiops-cli
npm install -g @azure-tools/apiops-cli
```

Requires Node.js 22 or later.
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-cd/azure-devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ In your `package.json`, pin to a specific version:
```json
{
"dependencies": {
"@peterhauge/apiops-cli": "1.2.3"
"@azure-tools/apiops-cli": "1.2.3"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ In interactive mode (the default when running in a terminal), `apiops init` prom

## Package consumption modes

By default, generated pipeline files reference the published npm package `@peterhauge/apiops-cli`. This is the standard consumption pattern — no local files are needed.
By default, generated pipeline files reference the published npm package `@azure-tools/apiops-cli`. This is the standard consumption pattern — no local files are needed.

If you pass `--cli-package <path>`, the tarball is copied into a `.apiops/` directory and the generated `package.json` references it as a local file dependency. This mode is useful for local development and testing before the package is published to npm.

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Extract your Azure API Management configuration, version it in git, and publish
## Install

```bash
npm install -g @peterhauge/apiops-cli
npm install -g @azure-tools/apiops-cli
```

Verify the installation:
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/migration-from-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ apiops-cli is a single Node.js CLI that covers the full workflow with less setup
|---------|-------------------|-----------------|
| **Runtime** | .NET SDK or Docker | Node.js 22+ |
| **CLI** | Separate Extractor/Publisher binaries | Single `apiops` CLI |
| **Install** | Docker pull or .NET tool install | `npm install -g @peterhauge/apiops-cli` |
| **Install** | Docker pull or .NET tool install | `npm install -g @azure-tools/apiops-cli` |
| **Configuration** | `configuration.extractor.yaml` + `configuration.publisher.yaml` | Single filter YAML + override YAML |
| **Authentication** | Azure service connections / env vars | `DefaultAzureCredential` (Azure CLI, OIDC, service principal, managed identity) |
| **Scaffolding** | Manual pipeline setup | `apiops init` generates pipelines, config, directory structure |
Expand All @@ -44,7 +44,7 @@ apiops-cli supports all APIOps Toolkit resource types plus: `GlobalSchema`, `Pol
### 1. Install apiops-cli

```bash
npm install -g @peterhauge/apiops-cli
npm install -g @azure-tools/apiops-cli
```

Verify:
Expand Down Expand Up @@ -274,7 +274,7 @@ apiops extract --cloud usgov ...

| Issue | Cause | Fix |
|-------|-------|-----|
| `apiops: command not found` | CLI not installed globally | Run `npm install -g @peterhauge/apiops-cli` |
| `apiops: command not found` | CLI not installed globally | Run `npm install -g @azure-tools/apiops-cli` |
| Artifacts not recognized | Unexpected directory structure | Verify your artifacts follow the standard layout (`apis/{name}/apiInformation.json`, etc.) |
| Authentication fails in pipeline | APIOps Toolkit used service connection env vars; apiops-cli uses `DefaultAzureCredential` | See [Authentication Guide](./authentication.md). For GitHub Actions, use `azure/login` with OIDC. For Azure DevOps, use `AzureCLI@2` task. |
| Override values not applied | Wrong override file format or path | Check YAML structure matches apiops-cli format. Pass with `--overrides <path>`. |
Expand Down
8 changes: 4 additions & 4 deletions docs/walkthrough/air-gapped-azure-devops-local-registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ az devops invoke \

### 1.2 Configure an upstream source

**[Configure an upstream source](https://learn.microsoft.com/en-us/azure/devops/artifacts/how-to/set-up-upstream-sources?view=azure-devops)** pointing to `https://registry.npmjs.org`. The upstream is only used during controlled sync windows; once `@peterhauge/apiops-cli` and its dependencies are cached, the feed serves them locally.
**[Configure an upstream source](https://learn.microsoft.com/en-us/azure/devops/artifacts/how-to/set-up-upstream-sources?view=azure-devops)** pointing to `https://registry.npmjs.org`. The upstream is only used during controlled sync windows; once `@azure-tools/apiops-cli` and its dependencies are cached, the feed serves them locally.

```bash
cat > feed-upstream.json <<'JSON'
Expand All @@ -121,10 +121,10 @@ az devops invoke \
```
### 1.3 Populate the feed

**[Populate the feed](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops)** from a connected workstation by running `npm install @peterhauge/apiops-cli` against the feed registry URL. This pulls the package and its transitive dependencies into the feed cache.
**[Populate the feed](https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops)** from a connected workstation by running `npm install @azure-tools/apiops-cli` against the feed registry URL. This pulls the package and its transitive dependencies into the feed cache.

```bash
npm install @peterhauge/apiops-cli \
npm install @azure-tools/apiops-cli \
--registry "$FEED_REGISTRY" \
--//pkgs.dev.azure.com/${ORG}/${PROJECT}/_packaging/${FEED}/npm/registry/:_authToken="$(az account get-access-token --resource https://app.vssps.visualstudio.com --query accessToken -o tsv)"
```
Expand Down Expand Up @@ -272,7 +272,7 @@ Sync the feed during a connectivity window to pull the new version, then update

```bash
# Update package.json to the latest CLI version available in the feed
npm install @peterhauge/apiops-cli --registry "$FEED_REGISTRY" --//pkgs.dev.azure.com/${ORG}/${PROJECT}/_packaging/${FEED}/npm/registry/:_authToken="$(az account get-access-token --resource https://app.vssps.visualstudio.com --query accessToken -o tsv)"
npm install @azure-tools/apiops-cli --registry "$FEED_REGISTRY" --//pkgs.dev.azure.com/${ORG}/${PROJECT}/_packaging/${FEED}/npm/registry/:_authToken="$(az account get-access-token --resource https://app.vssps.visualstudio.com --query accessToken -o tsv)"

# Rebuild lock file from package.json
npm install
Expand Down
16 changes: 8 additions & 8 deletions docs/walkthrough/air-gapped-azure-devops-offline-tarball.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ flowchart LR
On the connected workstation:

```bash
npm pack @peterhauge/apiops-cli
npm pack @azure-tools/apiops-cli
```

This produces `peterhauge-apiops-cli-<version>.tgz` in the current directory.
This produces `azure-tools-apiops-cli-<version>.tgz` in the current directory.

---

Expand All @@ -70,7 +70,7 @@ Pass `--cli-package` so the generated `package.json` references the local tarbal
apiops init \
--ci azure-devops \
--environments dev,prod \
--cli-package <path-to-tarball>/peterhauge-apiops-cli-<version>.tgz
--cli-package <path-to-tarball>/azure-tools-apiops-cli-<version>.tgz
```

This command generates:
Expand Down Expand Up @@ -111,7 +111,7 @@ For the offline-tarball workflow, commit the files that make the pipeline fully

| File Name | Description |
|-----------|-------------|
| `.apiops/peterhauge-apiops-cli-<version>.tgz` | CLI package consumed by the pipelines. |
| `.apiops/azure-tools-apiops-cli-<version>.tgz` | CLI package consumed by the pipelines. |
| `package.json` | Contains the `file:` dependency pointing to the tarball. |
| `package-lock.json` | Required for deterministic offline installs with `npm ci --offline`. |
| `.azdo/pipelines/run-apiops-extractor.yml` | Azure DevOps extract pipeline definition. |
Expand All @@ -120,7 +120,7 @@ For the offline-tarball workflow, commit the files that make the pipeline fully

```bash
git add \
.apiops/peterhauge-apiops-cli-*.tgz \
.apiops/azure-tools-apiops-cli-*.tgz \
package.json \
package-lock.json \
.azdo/pipelines/run-apiops-extractor.yml \
Expand Down Expand Up @@ -179,8 +179,8 @@ Trigger the extract pipeline manually from **Pipelines → Run pipeline** and ve

## Upgrading the CLI Version

1. On a connected workstation, run `npm pack @peterhauge/apiops-cli` for the new version
2. Replace `.apiops/peterhauge-apiops-cli-*.tgz` with the new tarball and update the `file:` path in `package.json`
1. On a connected workstation, run `npm pack @azure-tools/apiops-cli` for the new version
2. Replace `.apiops/azure-tools-apiops-cli-*.tgz` with the new tarball and update the `file:` path in `package.json`
3. Regenerate `package-lock.json`
```bash
npm install
Expand All @@ -197,7 +197,7 @@ Trigger the extract pipeline manually from **Pipelines → Run pipeline** and ve
5. Commit the tarball and updated lock file
```bash
git add \
.apiops/peterhauge-apiops-cli-*.tgz \
.apiops/azure-tools-apiops-cli-*.tgz \
package.json \
package-lock.json \
git commit -m "chore: commit updated offline-tarball apiops bootstrap files"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ flowchart LR
Set up the [GitHub Packages](https://docs.github.com/en/enterprise-server@latest/admin/packages/getting-started-with-github-packages-for-your-enterprise) npm registry on your GHES instance so it serves packages to your air-gapped runners without requiring internet access at install time.

1. **[Enable GitHub Packages on GHES](https://docs.github.com/en/enterprise-server@latest/admin/packages/getting-started-with-github-packages-for-your-enterprise)** — turn on the Packages service for your enterprise and configure the storage backend. The npm registry endpoint is `https://npm.<ghes-host>/`.
2. **Populate the registry** from a connected workstation by running `npm install @peterhauge/apiops-cli` against the GHES npm registry URL. This pulls the package and its transitive dependencies into the registry cache.
2. **Populate the registry** from a connected workstation by running `npm install @azure-tools/apiops-cli` against the GHES npm registry URL. This pulls the package and its transitive dependencies into the registry cache.
3. **Add a project `.npmrc`** that points `registry=` at your GHES npm endpoint and sets `//npm.<ghes-host>/:_authToken=${NODE_AUTH_TOKEN}` so authentication is read from an environment variable injected at workflow runtime. Commit `.npmrc` so workflows and developers resolve against the local registry.

> **Tip:** Follow [Authenticating to GitHub Packages](https://docs.github.com/en/enterprise-server@latest/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages) for the exact `.npmrc` format your GHES version expects.
Expand Down
14 changes: 7 additions & 7 deletions docs/walkthrough/air-gapped-github-actions-offline-tarball.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ flowchart LR
On the connected workstation:

```bash
npm pack @peterhauge/apiops-cli
npm pack @azure-tools/apiops-cli
```

This produces `peterhauge-apiops-cli-<version>.tgz` in the current directory.
This produces `azure-tools-apiops-cli-<version>.tgz` in the current directory.

Commit the tarball into your repository (e.g., under `.apiops/`) so the workflow can reference it by path:

```bash
mkdir -p .apiops
mv peterhauge-apiops-cli-*.tgz .apiops/
git add .apiops/peterhauge-apiops-cli-*.tgz
mv azure-tools-apiops-cli-*.tgz .apiops/
git add .apiops/azure-tools-apiops-cli-*.tgz
```

---
Expand All @@ -76,7 +76,7 @@ Pass `--cli-package` so the generated `package.json` references the local tarbal
apiops init \
--ci github-actions \
--environments dev,prod \
--cli-package ./.apiops/peterhauge-apiops-cli-<version>.tgz \
--cli-package ./.apiops/azure-tools-apiops-cli-<version>.tgz \
--non-interactive
```

Expand Down Expand Up @@ -215,8 +215,8 @@ Trigger the extract workflow manually from **Actions → Run workflow** and veri

## Upgrading the CLI Version

1. On a connected workstation, run `npm pack @peterhauge/apiops-cli` for the new version
2. Replace `.apiops/peterhauge-apiops-cli-*.tgz` with the new tarball and update the `file:` path in `package.json`
1. On a connected workstation, run `npm pack @azure-tools/apiops-cli` for the new version
2. Replace `.apiops/azure-tools-apiops-cli-*.tgz` with the new tarball and update the `file:` path in `package.json`
3. Regenerate `package-lock.json` (`npm install`)
4. Re-populate and re-transfer the npm cache (`npm ci` on the workstation, then copy `~/.npm/_cacache/`)
5. Commit the tarball and updated lock file
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@peterhauge/apiops-cli",
"name": "@azure-tools/apiops-cli",
"version": "0.4.0-alpha.2",
"schemaVersion": "1",
"description": "CLI tool for Azure API Management configuration-as-code",
Expand Down
Loading