diff --git a/.changeset/plugin-cli-registry-url-flag.md b/.changeset/plugin-cli-registry-url-flag.md new file mode 100644 index 000000000..746a9ad6b --- /dev/null +++ b/.changeset/plugin-cli-registry-url-flag.md @@ -0,0 +1,17 @@ +--- +"@emdash-cms/plugin-cli": patch +--- + +Renames the `--aggregator` flag on `search` and `info` to `--registry-url` for consistency with the `EMDASH_REGISTRY_URL` env var and the rest of the user-facing surface. Internally the override still selects the aggregator service to query — the rename only affects what users type. + +Old: + +```sh +emdash-plugin search "image" --aggregator https://registry.example.com +``` + +New: + +```sh +emdash-plugin search "image" --registry-url https://registry.example.com +``` diff --git a/packages/plugin-cli/README.md b/packages/plugin-cli/README.md index a6ce4bf5c..b8dc06b76 100644 --- a/packages/plugin-cli/README.md +++ b/packages/plugin-cli/README.md @@ -34,7 +34,7 @@ emdash-plugin search Free-text search emdash-plugin info Show package details ``` -All commands accept `--json`. Discovery commands accept `--aggregator ` (or `EMDASH_REGISTRY_URL`). +The non-interactive output commands (`whoami`, `validate`, `search`, `info`, `login`, `publish`) accept `--json` for machine-readable output. Discovery commands (`search`, `info`) accept `--registry-url ` (or `EMDASH_REGISTRY_URL`). ## Authoring diff --git a/packages/plugin-cli/src/commands/info.ts b/packages/plugin-cli/src/commands/info.ts index 5a0120bb1..f88f3c6bd 100644 --- a/packages/plugin-cli/src/commands/info.ts +++ b/packages/plugin-cli/src/commands/info.ts @@ -35,9 +35,9 @@ export const infoCommand = defineCommand({ description: "Package slug", required: true, }, - aggregator: { + "registry-url": { type: "string", - description: "Override aggregator URL", + description: "Override registry URL", }, json: { type: "boolean", @@ -45,7 +45,7 @@ export const infoCommand = defineCommand({ }, }, async run({ args }) { - const aggregatorUrl = resolveAggregatorUrl(args.aggregator); + const aggregatorUrl = resolveAggregatorUrl(args["registry-url"]); const client = new DiscoveryClient({ aggregatorUrl }); let result; diff --git a/packages/plugin-cli/src/commands/search.ts b/packages/plugin-cli/src/commands/search.ts index 89bdb1299..81f0dd291 100644 --- a/packages/plugin-cli/src/commands/search.ts +++ b/packages/plugin-cli/src/commands/search.ts @@ -36,9 +36,9 @@ export const searchCommand = defineCommand({ description: "Continuation cursor from a previous search result (printed at the end when more results exist)", }, - aggregator: { + "registry-url": { type: "string", - description: "Override aggregator URL (defaults to EMDASH_REGISTRY_URL or experimental host)", + description: "Override registry URL (defaults to EMDASH_REGISTRY_URL or experimental host)", }, json: { type: "boolean", @@ -46,7 +46,7 @@ export const searchCommand = defineCommand({ }, }, async run({ args }) { - const aggregatorUrl = resolveAggregatorUrl(args.aggregator); + const aggregatorUrl = resolveAggregatorUrl(args["registry-url"]); const limit = clamp(parseInt(args.limit, 10) || 25, 1, 100); const client = new DiscoveryClient({ aggregatorUrl }); diff --git a/packages/plugin-cli/src/config.ts b/packages/plugin-cli/src/config.ts index c2447b593..13f4a43de 100644 --- a/packages/plugin-cli/src/config.ts +++ b/packages/plugin-cli/src/config.ts @@ -2,7 +2,7 @@ * Shared config for the registry CLI. * * The aggregator URL defaults to the experimental host but can be overridden - * per-invocation via `--aggregator ` or by the `EMDASH_REGISTRY_URL` + * per-invocation via `--registry-url ` or by the `EMDASH_REGISTRY_URL` * env var. We resolve in that order, falling back to the default. * * EXPERIMENTAL: the default host is provisional. It will be retired and