Skip to content

Commit fccd098

Browse files
committed
docs(devx): route the CLI scaffolder callout by artifact — plugin names two things
`content/docs/deployment/cli.mdx` carried a "Which scaffolder?" callout whose only job is to choose for the reader, and it chose wrong: it sent anyone wanting "a plugin skeleton" to `os init -t plugin`, which emits a METADATA plugin (`objectstack compile`, `private: true`, declarative objects), while every page under /docs/plugins teaches the KERNEL CODE plugin that `os create plugin` emits (`tsc`, publishable, implements the `Plugin` contract with `init` / `destroy`). The callout now routes by ARTIFACT rather than by command word, with a table naming both artifacts, their commands, their build tool, whether they publish, and the page to read next for each. A short paragraph on the same page records WHY the two scaffolders are not merged (#15531: collapsing both under one word would make the collision structural instead of documented), so the reason lives in the docs and not only in the issue. Docs only — no `packages/cli` change; a command-word rename is an interface change that needs its own domain:cli card. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk
1 parent b237592 commit fccd098

1 file changed

Lines changed: 31 additions & 6 deletions

File tree

content/docs/deployment/cli.mdx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ npm create objectstack@latest my-app
2626
cd my-app
2727
```
2828

29-
This scaffolds a working project with `objectstack.config.ts`, a sample object, and all dependencies installed — plus the AI skills bundle and an `AGENTS.md` for coding agents. (`os init` is the CLI's own scaffolder for plugin skeletons and bare configs — see [below](#os-init).)
29+
This scaffolds a working project with `objectstack.config.ts`, a sample object, and all dependencies installed — plus the AI skills bundle and an `AGENTS.md` for coding agents. (`os init` is the CLI's own scaffolder for metadata-plugin skeletons and bare configs — see [below](#os-init).)
3030

3131
### Add more metadata
3232

@@ -83,11 +83,35 @@ Scaffolds a new ObjectStack project with configuration, TypeScript setup, and in
8383
> **Which scaffolder?** For a new app, prefer **`npm create objectstack@latest`** — it
8484
> also derives your namespace, pins the framework packages to the current release, and
8585
> installs the AI skills bundle + `AGENTS.md`. Reach for `os init` when you want a
86-
> **plugin** skeleton or a **bare config** in an existing directory.
86+
> **bare config** in an existing directory — or a **metadata plugin**, which is only one
87+
> of the two different artifacts the word `plugin` names in this CLI.
88+
89+
**`plugin` names two artifacts. Route by the artifact you want, not by the word.**
90+
91+
| You want | Command | What it emits | Built by | Publishable? | Read next |
92+
|:---------|:--------|:--------------|:---------|:-------------|:----------|
93+
| A **metadata plugin** — declarative objects another stack loads, no kernel code | `os init <name> -t plugin` | `objectstack.config.ts` whose manifest declares `type: 'plugin'`, plus `src/objects/*.object.ts` | `objectstack compile` (its `build` script) | **No** — the emitted `package.json` is `private: true` | [`os init`](#os-init) below, and [Object Metadata](/docs/data-modeling/objects) for the objects it holds |
94+
| A **kernel code plugin** — TypeScript implementing the kernel `Plugin` contract | `os create plugin <name>` | `src/index.ts` exporting a `Plugin` with `init` / `destroy` | `tsc` (its `build` script) | **Yes** — a publishable `@objectstack/plugin-<name>` package | [`os create`](#os-create) below, then [Plugin Anatomy](/docs/plugins/anatomy) and [Plugin Development](/docs/plugins/development) |
95+
96+
Every page under [Plugins & Packages](/docs/plugins) teaches the **kernel code** plugin, so
97+
`os create plugin` is the scaffolder those pages mean — `os init -t plugin` will not give
98+
you a `Plugin` to implement, and `os create plugin` will not give you declarative objects
99+
to compile.
100+
101+
<Callout type="info">
102+
**Why the two scaffolders are deliberately separate.** Merging the `os init` and
103+
`os create` command families was measured and ruled against in
104+
[#15531](https://github.com/objectstack-ai/objectstack/issues/15531): the two commands
105+
emit two different artifacts, so collapsing a metadata plugin and a kernel code plugin
106+
under one command word would make this collision **structural** instead of merely
107+
documented — teaching the wrong artifact to everyone, human or agent, who generates a
108+
plugin from the CLI. The collision, and the misdirection this table replaces, are recorded
109+
in [#15817](https://github.com/objectstack-ai/objectstack/issues/15817).
110+
</Callout>
87111

88112
```bash
89113
os init my-app # Create with default "app" template
90-
os init my-plugin -t plugin # Create a plugin project
114+
os init my-plugin -t plugin # Create a metadata plugin project
91115
os init blank -t empty # Minimal config only
92116
os init my-app --no-install # Skip dependency installation
93117
```
@@ -102,7 +126,7 @@ os init my-app --no-install # Skip dependency installation
102126
| Template | What it creates |
103127
|----------|-----------------|
104128
| `app` | Full application with objects, barrel imports |
105-
| `plugin` | Reusable plugin package with objects |
129+
| `plugin` | **Metadata** plugin: declarative objects, built by `objectstack compile`, `private`*not* the kernel code plugin `os create plugin` emits |
106130
| `empty` | Minimal project with just `objectstack.config.ts` |
107131

108132
#### `os dev`
@@ -1263,8 +1287,9 @@ third-party extension primitive, authored as `src/skills/<name>.skill.ts` with
12631287

12641288
#### `os create`
12651289

1266-
Scaffolds a **standalone** project — a plugin, or an example application — into
1267-
the current directory:
1290+
Scaffolds a **standalone** project — a **kernel code** plugin (the `Plugin` contract,
1291+
built by `tsc`, publishable; *not* the metadata plugin `os init -t plugin` emits — see
1292+
[Which scaffolder?](#os-init)), or an example application — into the current directory:
12681293

12691294
```bash
12701295
os create plugin analytics # Create ./plugin-analytics

0 commit comments

Comments
 (0)