You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(cli): give the two plugin artifacts distinct nouns and rewrite "Which scaffolder?" as a two-question decision (#16484)
`plugin` names two different artifacts in this CLI and nothing said which one a
reader was about to get. `os init <name> -t plugin` writes a metadata package —
declarative objects another stack loads, compiled, `private: true`. `os create
plugin <name>` writes a kernel code plugin — TypeScript implementing the kernel
`Plugin` contract, built by `tsc`, publishable. Someone who wanted a "plugin
skeleton" and reached for the nearer of the two got the wrong artifact silently.
No flag and no subcommand is renamed: `-t plugin` and `os create plugin` are
published surface and are spelled exactly as before. What moved is the NOUN each
user-facing string uses, so the two shapes stop sharing one word.
The "Which scaffolder?" guidance is now a two-question decision — metadata or
kernel code, then a new project or an addition to a directory you already have —
landing on exactly one of the four entry points with the reason to pick it:
`npm create objectstack@latest` (equivalently `npx create-objectstack`),
`os init`, `os init <name> -t plugin`, `os create plugin <name>`. `os create
example` is deliberately absent; it was retired in #16483.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YFY46JydE1gMxQG1TqBcMZ
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).)
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-package skeletons and bare configs — see [below](#os-init).)
30
30
31
31
### Add more metadata
32
32
@@ -80,20 +80,32 @@ predicate/schema/binding mistakes that fail silently at runtime), and `os dev --
80
80
81
81
Scaffolds a new ObjectStack project with configuration, TypeScript setup, and initial metadata files.
82
82
83
-
> **Which scaffolder?** For a new app, prefer **`npm create objectstack@latest`** — it
84
-
> also derives your namespace, pins the framework packages to the current release, and
85
-
> installs the AI skills bundle + `AGENTS.md`. Reach for `os init` when you want a
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 |
| 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
83
+
> **Which scaffolder? Two questions.**
84
+
>
85
+
> **1. Metadata, or kernel code?** A **metadata package** is declarative — objects
86
+
> another stack loads, built by `objectstack compile`. A **kernel code plugin** is
87
+
> TypeScript implementing the kernel `Plugin` contract, built by `tsc`.
88
+
>
89
+
> **2. A whole new project, or an addition to a directory you already have?**
90
+
91
+
| What you are building | Where it goes | Entry point | Why this one |
| An **application** — metadata you run | a brand-new project |**`npm create objectstack@latest <name>`** — equivalently `npx create-objectstack <name>`| Derives your namespace, pins the framework packages to the current release, and installs the AI skills bundle + `AGENTS.md`. Prefer it for anything green-field |
94
+
| An **application** — metadata you run | a directory you **already have**|`os init` — or `os init -t empty` for a bare config | Writes config, TypeScript setup and starter metadata in place. Derives no namespace and installs no skills bundle |
95
+
| A **metadata package** — declarative objects another stack loads, no kernel code | its own project |`os init <name> -t plugin`| The only scaffolder that emits a manifest declaring `type: 'plugin'`|
96
+
| A **kernel code plugin** — TypeScript implementing the kernel `Plugin` contract | its own project, or `--in-repo` inside an ObjectStack monorepo checkout |`os create plugin <name>`| The only scaffolder that emits a `Plugin` for you to implement |
97
+
98
+
**The CLI spells two different artifacts `plugin`; this page does not.** The flag stays
99
+
`-t plugin` and the subcommand stays `os create plugin` — what differs is the noun. A
100
+
**metadata package** is what `os init -t plugin` writes; a **kernel code plugin** is what
101
+
`os create plugin` writes. Route by the artifact you want, not by the word.
102
+
103
+
| The word `plugin` in | Names | What it emits | Built by | Publishable? | Read next |
|`os init <name> -t plugin`| A **metadata package** — declarative objects another stack loads, no kernel code |`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 |
106
+
|`os create plugin <name>`| A **kernel code plugin** — TypeScript implementing the kernel `Plugin` contract |`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)|
107
+
108
+
Every page under [Plugins & Packages](/docs/plugins) teaches the **kernel code plugin**, so
97
109
`os create plugin` is the scaffolder those pages mean — `os init -t plugin` will not give
98
110
you a `Plugin` to implement, and `os create plugin` will not give you declarative objects
99
111
to compile.
@@ -102,7 +114,7 @@ to compile.
102
114
**Why the two scaffolders are deliberately separate.** Merging the `os init` and
103
115
`os create` command families was measured and ruled against in
104
116
[#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
117
+
emit two different artifacts, so collapsing a metadata package and a kernel code plugin
106
118
under one command word would make this collision **structural** instead of merely
107
119
documented — teaching the wrong artifact to everyone, human or agent, who generates a
108
120
plugin from the CLI. The collision, and the misdirection this table replaces, are recorded
@@ -111,13 +123,13 @@ in [#15817](https://github.com/objectstack-ai/objectstack/issues/15817).
111
123
112
124
```bash
113
125
os init my-app # Create with default "app" template
114
-
os init my-plugin -t plugin # Create a metadata plugin project
126
+
os init my-package -t plugin # Create a metadata package project
115
127
os init blank -t empty # Minimal config only
116
128
os init my-app --no-install # Skip dependency installation
0 commit comments