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
9 changes: 9 additions & 0 deletions .changeset/21286-cli-extension-tsdoc-discover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@objectstack/spec': patch
---

The `kernel/cli-extension` module documentation no longer tells plugin authors to run `os plugins install`. Step 2, "Discover", said the plugin is listed in `@objectstack/cli`'s `oclif.plugins` array, or that users install it with `os plugins install`. Neither is true: `@objectstack/cli` declares no `oclif.plugins` and ships no plugin manager, so `os plugins` is not a command. The step now says what loads a plugin: oclif loads a plugin that the CLI's own `package.json` lists in both `oclif.plugins` and `dependencies`. To add a plugin's commands to `os`, build an `os` distribution whose own `package.json` lists the plugin in both places. The generated reference page carries the same text.

Clause-②: no

Documentation only. No schema, export or type changes.
7 changes: 5 additions & 2 deletions content/docs/references/kernel/cli-extension.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ built-in plugin system.

1. **Declare** — Plugin's `package.json` includes an `oclif` config section
declaring its commands directory and any topics.
2. **Discover** — The main CLI (`@objectstack/cli`) lists the plugin in its
`oclif.plugins` array, or users install it via `os plugins install <pkg>`.
2. **Discover** — oclif loads a plugin that the CLI's own `package.json`
lists in both `oclif.plugins` and `dependencies`. `@objectstack/cli`
lists none and ships no plugin manager, so `os plugins` is not a
command. To add a plugin's commands to `os`, build an `os` distribution:
a package whose own `package.json` lists the plugin in both places.
3. **Load** — oclif automatically discovers and registers all Command classes
exported from the plugin's commands directory.

Expand Down
7 changes: 5 additions & 2 deletions packages/spec/src/kernel/cli-extension.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ import { z } from 'zod';
*
* 1. **Declare** — Plugin's `package.json` includes an `oclif` config section
* declaring its commands directory and any topics.
* 2. **Discover** — The main CLI (`@objectstack/cli`) lists the plugin in its
* `oclif.plugins` array, or users install it via `os plugins install <pkg>`.
* 2. **Discover** — oclif loads a plugin that the CLI's own `package.json`
* lists in both `oclif.plugins` and `dependencies`. `@objectstack/cli`
* lists none and ships no plugin manager, so `os plugins` is not a
* command. To add a plugin's commands to `os`, build an `os` distribution:
* a package whose own `package.json` lists the plugin in both places.
* 3. **Load** — oclif automatically discovers and registers all Command classes
* exported from the plugin's commands directory.
*
Expand Down
Loading