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
17 changes: 17 additions & 0 deletions .changeset/plugin-cli-registry-url-flag.md
Original file line number Diff line number Diff line change
@@ -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.
Comment on lines +2 to +5

Old:

```sh
emdash-plugin search "image" --aggregator https://registry.example.com
```

New:

```sh
emdash-plugin search "image" --registry-url https://registry.example.com
```
2 changes: 1 addition & 1 deletion packages/plugin-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ emdash-plugin search <query> Free-text search
emdash-plugin info <handle-or-did> <slug> Show package details
```

All commands accept `--json`. Discovery commands accept `--aggregator <url>` (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 <url>` (or `EMDASH_REGISTRY_URL`).

## Authoring

Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-cli/src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ 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",
description: "Output as JSON",
},
},
async run({ args }) {
const aggregatorUrl = resolveAggregatorUrl(args.aggregator);
const aggregatorUrl = resolveAggregatorUrl(args["registry-url"]);
const client = new DiscoveryClient({ aggregatorUrl });
Comment on lines +38 to 49

let result;
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-cli/src/commands/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ 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",
description: "Output as JSON",
},
},
async run({ args }) {
const aggregatorUrl = resolveAggregatorUrl(args.aggregator);
const aggregatorUrl = resolveAggregatorUrl(args["registry-url"]);
const limit = clamp(parseInt(args.limit, 10) || 25, 1, 100);
Comment on lines +39 to 50

const client = new DiscoveryClient({ aggregatorUrl });
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <url>` or by the `EMDASH_REGISTRY_URL`
* per-invocation via `--registry-url <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
Expand Down
Loading