Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(cli): align layout deprecation (DEP-0006) with the envelope schema and precedent (#7175)

Joey0e97faa47046
diff --git a/.changeset/fix-layout-deprecation-shape.md b/.changeset/fix-layout-deprecation-shape.md
new file mode 100644
index 0000000000..d9233b2de6
--- /dev/null
+++ b/.changeset/fix-layout-deprecation-shape.md
@@ -0,0 +1,14 @@
+---
+'@astryxdesign/cli': patch
+---
+
+[fix] Align the layout deprecation (DEP-0006) with the documented envelope and precedent
+
+The layout command's JSON envelope now emits `meta.deprecations: [{id, replacements}]`,
+matching the response schema doc and the DEP-0005 theme add precedent. The `deprecated`
+CommandDoc field renders in `--help` and the manifest. The programmatic API exports
+(`layoutExpand`, `layoutCheck`, `layoutGrammar`) carry `@deprecated` in their declarations
+and generated types. Command and function reference pages name DEP-0006 and the replacement.
+The DEP-0006 record names its direct authority. All released data fields are unchanged.
+
+@josephfarina
diff --git a/docs/specs/AST-042-cli-command-admission/spec.md b/docs/specs/AST-042-cli-command-admission/spec.md
index 49bd06f214..244bf157a8 100644
--- a/docs/specs/AST-042-cli-command-admission/spec.md
+++ b/docs/specs/AST-042-cli-command-admission/spec.md
@@ -245,13 +245,14 @@ bar.
| id | `DEP-0006` |
| cleanup | `CLN-0006` |
| package | `@astryxdesign/cli` |
-| surface | CLI command group: `astryx layout` (`expand`, `check`, `grammar`) and its three JSON response types (`layout.expand`, `layout.check`, `layout.grammar`) |
+| surface | CLI command group: `astryx layout` (`expand`, `check`, `grammar`), its three JSON response types (`layout.expand`, `layout.check`, `layout.grammar`), and the programmatic API exports `layoutExpand`, `layoutCheck`, `layoutGrammar` from `@astryxdesign/cli` |
| old contract | Compressed XLE/XLO expressions parsed, validated, and expanded into XDS TSX; expression validation with canonical-surface echo; grammar cheatsheet with alias table |
| replacement | `astryx build` chooses the closest template to start from. `astryx template <name> <path>` scaffolds it. `astryx docs layout` teaches the layout principles (scaffold, structure, spacing, breakpoints). |
-| warning | Human mode: one stderr line per invocation naming DEP-0006 and the replacement commands. JSON mode: `meta.deprecation` object in the response envelope carrying `id`, `cleanup`, and `replacement`. |
+| warning | Human mode: one stderr line per invocation naming DEP-0006 and the replacement commands. JSON mode: `meta.deprecations` array in the response envelope, each entry `{id, replacements}`, matching the documented envelope schema. |
| migration | Non-mechanical. The XLE/XLO expression language has no source-level equivalent in the replacement commands. Use `astryx build` to find the right template, `astryx template <name>` to scaffold it, and edit the scaffolded code directly. |
| codemod | None — vacuous: expressions are ad-hoc input, not persisted source that a codemod can rewrite. |
| downstream | Maintained agent-docs teach `build` as the front door. The layout guide (`astryx docs layout`) is unaffected. |
+| direct authority | `spec:AST-042` (CLI command admission and programmatic parity) |
| state | `deprecated` |
| target plan | `CLN-0006` removal in the next scheduled minor |
diff --git a/packages/cli/README.md b/packages/cli/README.md
index e6d0749bc6..006602e6e8 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -78,24 +78,24 @@ Options:
<!-- BEGIN GENERATED: commands -->
-| Command | Description |
-| ------------- | ----------------------------------------------------------------------------- |
-| `blog` | Read the Astryx blog from the published feed |
-| `build` | Build a page: the template to start from, or the workflow playbook (no query) |
-| `component` | List components or print component docs |
-| `discover` | Browse and search integrations: the ones you have and the ones you could add |
-| `docs` | Print reference docs |
-| `doctor` | Diagnose Astryx projects and integration packages |
-| `gap-report` | Report a missing component or feature to the package that owns it |
-| `hook` | List hooks or print hook docs |
-| `init` | Initialize the design system in your project |
-| `integration` | Author and verify an Astryx integration package |
-| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) |
-| `search` | Search components, hooks, docs, templates, and themes in one ranked list |
-| `swizzle` | Copy component source for customization |
-| `template` | List, show, or scaffold page and block templates |
-| `theme` | Add, switch, build, and author themes |
-| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
+| Command | Description |
+| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `blog` | Read the Astryx blog from the published feed |
+| `build` | Build a page: the template to start from, or the workflow playbook (no query) |
+| `component` | List components or print component docs |
+| `discover` | Browse and search integrations: the ones you have and the ones you could add |
+| `docs` | Print reference docs |
+| `doctor` | Diagnose Astryx projects and integration packages |
+| `gap-report` | Report a missing component or feature to the package that owns it |
+| `hook` | List hooks or print hook docs |
+| `init` | Initialize the design system in your project |
+| `integration` | Author and verify an Astryx integration package |
+| `layout` | Generate XDS layouts from compressed expressions (XLE/XLO) [DEPRECATED: DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.] |
+| `search` | Search components, hooks, docs, templates, and themes in one ranked list |
+| `swizzle` | Copy component source for customization |
+| `template` | List, show, or scaffold page and block templates |
+| `theme` | Add, switch, build, and author themes |
+| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
<!-- END GENERATED: commands -->
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
@@ -482,9 +482,9 @@ Every response has a `type` discriminant. The full set is below (generated from
| `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
| `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
| `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
-| `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). |
-| `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). |
-| `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. |
+| `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
+| `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
+| `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
<!-- END GENERATED: response-types -->
<!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
diff --git a/packages/cli/api/layout/check/check.mjs b/packages/cli/api/layout/check/check.mjs
index c69678446b..9b782ce1fa 100644
--- a/packages/cli/api/layout/check/check.mjs
+++ b/packages/cli/api/layout/check/check.mjs
@@ -15,6 +15,7 @@ import {toCompact, toOutline} from '../../../foundation/xle/print.mjs';
import {analyze, formatIssue} from '../_adapter.mjs';
/**
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
* `astryx layout check "<expr>" [--form compact|outline]`
* Validates without expanding; echoes both canonical surfaces.
*
diff --git a/packages/cli/api/layout/expand/expand.mjs b/packages/cli/api/layout/expand/expand.mjs
index 5907128e4c..9eff40d30a 100644
--- a/packages/cli/api/layout/expand/expand.mjs
+++ b/packages/cli/api/layout/expand/expand.mjs
@@ -88,6 +88,7 @@ function buildBlockModules(doc, blocks) {
}
/**
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
* `astryx layout expand "<expr>" [path]`
*
* @param {string} expression
diff --git a/packages/cli/api/layout/grammar/grammar.mjs b/packages/cli/api/layout/grammar/grammar.mjs
index b7bc5f4cee..214bb03e78 100644
--- a/packages/cli/api/layout/grammar/grammar.mjs
+++ b/packages/cli/api/layout/grammar/grammar.mjs
@@ -13,6 +13,7 @@ import {buildRegistry} from '../../../foundation/xle/registry.mjs';
import {MAX_REPEAT} from '../../../foundation/xle/expand.mjs';
/**
+ * @deprecated DEP-0006: Use `build`, `template`, and `docs layout` instead. Removal in CLN-0006.
* `astryx layout grammar` — the agent cheatsheet, with the alias table
* generated from this branch's registry (never hand-maintained).
*
diff --git a/packages/cli/api/layout/layoutCheck.doc.mjs b/packages/cli/api/layout/layoutCheck.doc.mjs
index c284854804..1fd1b3e03d 100644
--- a/packages/cli/api/layout/layoutCheck.doc.mjs
+++ b/packages/cli/api/layout/layoutCheck.doc.mjs
@@ -20,7 +20,7 @@ export const doc = {
'expression without generating any TSX, and echoes it back in both canonical surfaces ' +
'(compact and outline). Validation failures are reported in the layout.check envelope ' +
'(valid: false) with line/col and suggestions (not thrown) so callers can lint an ' +
- 'expression and surface fixes.',
+ 'expression and surface fixes. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
importPath: '@astryxdesign/cli/api',
signature:
'layoutCheck(expression: string, options?: LayoutCheckOptions): Promise<LayoutCheckResponse>',
diff --git a/packages/cli/api/layout/layoutExpand.doc.mjs b/packages/cli/api/layout/layoutExpand.doc.mjs
index bf95b805a6..f36039714b 100644
--- a/packages/cli/api/layout/layoutExpand.doc.mjs
+++ b/packages/cli/api/layout/layoutExpand.doc.mjs
@@ -20,7 +20,7 @@ export const doc = {
'expression, then expands it into ready-to-use XDS TSX, auto-routing structural children ' +
'into the right slots, scaffolding typed useState for interactive controls, and splicing or ' +
'importing any referenced template blocks. Returns the code (and metadata) in a layout.expand ' +
- 'envelope, optionally writing it to a path within cwd.',
+ 'envelope, optionally writing it to a path within cwd. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
importPath: '@astryxdesign/cli/api',
signature:
'layoutExpand(expression: string, options?: LayoutExpandOptions): Promise<LayoutExpandResponse>',
diff --git a/packages/cli/api/layout/layoutGrammar.doc.mjs b/packages/cli/api/layout/layoutGrammar.doc.mjs
index b68fe9d628..0d9e9f2c67 100644
--- a/packages/cli/api/layout/layoutGrammar.doc.mjs
+++ b/packages/cli/api/layout/layoutGrammar.doc.mjs
@@ -18,7 +18,7 @@ export const doc = {
description:
'The reference behind `astryx layout grammar`: the agent cheatsheet for writing XLE/XLO ' +
"layout expressions, with the alias table generated from this branch's registry rather than " +
- 'hand-maintained, so short names always reflect the components actually installed.',
+ 'hand-maintained, so short names always reflect the components actually installed. **Deprecated (DEP-0006).** Use `build`, `template`, and `docs layout` instead. This function will be removed in a future minor release.',
importPath: '@astryxdesign/cli/api',
signature:
'layoutGrammar(options?: LayoutGrammarOptions): Promise<LayoutGrammarResponse>',
diff --git a/packages/cli/clients/cli/commands/layout-check.doc.mjs b/packages/cli/clients/cli/commands/layout-check.doc.mjs
index 98e128f9c1..d0efbd34d2 100644
--- a/packages/cli/clients/cli/commands/layout-check.doc.mjs
+++ b/packages/cli/clients/cli/commands/layout-check.doc.mjs
@@ -62,5 +62,6 @@ export const doc = {
},
],
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
+ notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
related: ['layout expand', 'layout grammar'],
};
diff --git a/packages/cli/clients/cli/commands/layout-expand.doc.mjs b/packages/cli/clients/cli/commands/layout-expand.doc.mjs
index 0ca1b06908..3a29e66147 100644
--- a/packages/cli/clients/cli/commands/layout-expand.doc.mjs
+++ b/packages/cli/clients/cli/commands/layout-expand.doc.mjs
@@ -82,5 +82,6 @@ export const doc = {
},
],
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
+ notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
related: ['layout check', 'layout grammar'],
};
diff --git a/packages/cli/clients/cli/commands/layout-grammar.doc.mjs b/packages/cli/clients/cli/commands/layout-grammar.doc.mjs
index dd2b048ff2..89c8ec55e9 100644
--- a/packages/cli/clients/cli/commands/layout-grammar.doc.mjs
+++ b/packages/cli/clients/cli/commands/layout-grammar.doc.mjs
@@ -27,5 +27,6 @@ export const doc = {
{code: 1, when: 'the component registry cannot be read'},
],
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
+ notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
related: ['layout expand', 'layout check'],
};
diff --git a/packages/cli/clients/cli/commands/layout.deprecation-lifecycle.test.mjs b/packages/cli/clients/cli/commands/layout.deprecation-lifecycle.test.mjs
new file mode 100644
index 0000000000..8c250116f1
--- /dev/null
+++ b/packages/cli/clients/cli/commands/layout.deprecation-lifecycle.test.mjs
@@ -0,0 +1,140 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/**
+ * @file Deprecation lifecycle coverage for the layout command group (DEP-0006).
+ *
+ * Mirrors the DEP-0005 theme-add-lifecycle tests: pins the JSON
+ * `meta.deprecations` entry, the human-mode stderr warning, the help label,
+ * and the docs reference pages.
+ */
+
+import {describe, it, expect} from 'vitest';
+import {runCli} from '../../../test-utils/run-cli.mjs';
+
+const SLOW = 30_000;
+
+describe('layout DEP-0006 lifecycle', () => {
+ it('JSON mode carries meta.deprecations with DEP-0006 and its replacements', async () => {
+ const result = await runCli(['layout', 'grammar', '--json']);
+ expect(result.status).toBe(0);
+ const envelope = JSON.parse(result.stdout);
+ expect(envelope.meta).toBeDefined();
+ expect(envelope.meta.deprecations).toEqual([
+ {
+ id: 'DEP-0006',
+ replacements: ['build', 'template', 'docs layout'],
+ },
+ ]);
+ // Canonical data is unchanged
+ expect(envelope.type).toBe('layout.grammar');
+ expect(envelope.data.text).toBeDefined();
+ expect(envelope.data.aliases).toBeDefined();
+ }, SLOW);
+
+ it('human mode emits one stderr deprecation warning', async () => {
+ const result = await runCli(['layout', 'grammar']);
+ expect(result.status).toBe(0);
+ expect(result.stderr).toContain('[DEP-0006]');
+ expect(result.stderr).toContain('astryx layout is deprecated');
+ expect(result.stderr).toContain('astryx build');
+ expect(result.stderr).toContain('astryx template');
+ expect(result.stderr).toContain('astryx docs layout');
+ }, SLOW);
+
+ it('JSON mode does NOT emit the stderr warning', async () => {
+ const result = await runCli(['layout', 'grammar', '--json']);
+ expect(result.stderr).not.toContain('[DEP-0006]');
+ }, SLOW);
+
+ it('layout --help labels the command as deprecated', async () => {
+ const result = await runCli(['layout', '--help']);
+ expect(result.stdout).toContain('DEPRECATED');
+ expect(result.stdout).toContain('DEP-0006');
+ });
+
+ it('layout expand --json carries the same meta.deprecations', async () => {
+ const result = await runCli([
+ 'layout', 'expand', 'V[g6] > C*2', '--json',
+ ]);
+ expect(result.status).toBe(0);
+ const envelope = JSON.parse(result.stdout);
+ expect(envelope.meta.deprecations).toEqual([
+ {
+ id: 'DEP-0006',
+ replacements: ['build', 'template', 'docs layout'],
+ },
+ ]);
+ expect(envelope.type).toBe('layout.expand');
+ }, SLOW);
+
+ it('layout check --json carries the same meta.deprecations', async () => {
+ const result = await runCli([
+ 'layout', 'check', 'V[g6] > C*2', '--json',
+ ]);
+ expect(result.status).toBe(0);
+ const envelope = JSON.parse(result.stdout);
+ expect(envelope.meta.deprecations).toEqual([
+ {
+ id: 'DEP-0006',
+ replacements: ['build', 'template', 'docs layout'],
+ },
+ ]);
+ expect(envelope.type).toBe('layout.check');
+ }, SLOW);
+
+ // FR29d: every reference page names DEP-0006 and the replacements.
+ // Removing the label from any single page must fail this test.
+ describe('docs reference pages name DEP-0006', () => {
+ const COMMAND_PAGES = [
+ 'cli/commands/layout',
+ 'cli/commands/layout-expand',
+ 'cli/commands/layout-check',
+ 'cli/commands/layout-grammar',
+ ];
+
+ const FUNCTION_PAGES = [
+ 'cli/api/functions/layout-expand',
+ 'cli/api/functions/layout-check',
+ 'cli/api/functions/layout-grammar',
+ ];
+
+ for (const page of COMMAND_PAGES) {
+ it(`${page} names DEP-0006 and replacements`, async () => {
+ const result = await runCli(['docs', page, '--json']);
+ expect(result.status, result.stderr).toBe(0);
+ const body = result.stdout;
+ expect(body).toContain('DEP-0006');
+ expect(body).toContain('build');
+ expect(body).toContain('template');
+ expect(body).toContain('docs layout');
+ }, SLOW);
+ }
+
+ for (const page of FUNCTION_PAGES) {
+ it(`${page} names DEP-0006 and replacements`, async () => {
+ const result = await runCli(['docs', page, '--json']);
+ expect(result.status, result.stderr).toBe(0);
+ const body = result.stdout;
+ expect(body).toContain('DEP-0006');
+ expect(body).toContain('build');
+ expect(body).toContain('template');
+ expect(body).toContain('docs layout');
+ }, SLOW);
+ }
+ });
+
+ it('response-types reference names DEP-0006 in each layout entry description', async () => {
+ const result = await runCli(['docs', 'cli/api/enums/response-types', '--json']);
+ expect(result.status, result.stderr).toBe(0);
+ const envelope = JSON.parse(result.stdout);
+ // The enum page has a table in its content; each row is [value, description].
+ const tables = envelope.data.content.filter(b => b.type === 'table');
+ const rows = tables.flatMap(t => t.rows || []);
+ for (const type of ['layout.expand', 'layout.check', 'layout.grammar']) {
+ const row = rows.find(r => r[0] && r[0].includes(type));
+ expect(row, `${type} not found in response-types table`).toBeDefined();
+ expect(row[1], `${type} description missing DEP-0006`).toContain('DEP-0006');
+ expect(row[1], `${type} description missing replacements`).toContain('replacement');
+ }
+ }, SLOW);
+});
diff --git a/packages/cli/clients/cli/commands/layout.doc.mjs b/packages/cli/clients/cli/commands/layout.doc.mjs
index 12f162993c..62256cd6f4 100644
--- a/packages/cli/clients/cli/commands/layout.doc.mjs
+++ b/packages/cli/clients/cli/commands/layout.doc.mjs
@@ -31,5 +31,6 @@ export const doc = {
{code: 1, when: 'no subcommand (help is printed) or an unknown subcommand'},
],
deprecated: 'DEP-0006: Use `astryx build` to start from a template, `astryx template` to scaffold, and `astryx docs layout` for guidance.',
+ notes: [{"type": "prose", "text": "**Deprecated (DEP-0006).** Use `astryx build` to choose the template to start from, `astryx template` to scaffold it, and `astryx docs layout` for layout guidance. This command will be removed in a future minor release."}],
related: ['template', 'build'],
};
diff --git a/packages/cli/clients/cli/commands/layout.mjs b/packages/cli/clients/cli/commands/layout.mjs
index cdf2668a59..ac82f1eebe 100644
--- a/packages/cli/clients/cli/commands/layout.mjs
+++ b/packages/cli/clients/cli/commands/layout.mjs
@@ -63,17 +63,12 @@ import {NO_RESULT_SET, resultSet} from '../../../foundation/debug/index.mjs';
* DEP-0006: the `astryx layout` command group is deprecated.
*
* Human mode: one stderr warning per invocation.
- * JSON mode: `meta.deprecation` in the response envelope.
+ * JSON mode: `meta.deprecations` array in the response envelope.
*/
-const DEPRECATION = {
+const LAYOUT_DEPRECATION = Object.freeze({
id: 'DEP-0006',
- cleanup: 'CLN-0006',
- replacement: [
- 'astryx build "<idea>" — choose the template to start from',
- 'astryx template <name> <path> — scaffold it',
- 'astryx docs layout — layout guidance',
- ],
-};
+ replacements: ['build', 'template', 'docs layout'],
+});
function warnDeprecated() {
if (!isJsonMode()) {
@@ -91,10 +86,10 @@ function warnDeprecated() {
* Add deprecation metadata to a JSON response before output.
* Canonical stdout (type, data) is unchanged; the metadata sits in `meta`.
* @param {{type: string, data: unknown}} result
- * @returns {{type: string, data: unknown, meta: {deprecation: typeof DEPRECATION}}}
+ * @returns {{type: string, data: unknown, meta: {deprecations: [typeof LAYOUT_DEPRECATION]}}}
*/
function withDeprecation(result) {
- return {...result, meta: {deprecation: DEPRECATION}};
+ return {...result, meta: {deprecations: [LAYOUT_DEPRECATION]}};
}
/** The largest layout expression read from --file or stdin. */
diff --git a/packages/cli/clients/cli/lib/define-command.mjs b/packages/cli/clients/cli/lib/define-command.mjs
index 7d63ef5ccd..3eb528743b 100644
--- a/packages/cli/clients/cli/lib/define-command.mjs
+++ b/packages/cli/clients/cli/lib/define-command.mjs
@@ -122,6 +122,10 @@ export function defineCommand(parent, doc, {fn, action} = {}) {
const cmd = parent.command(argSpec ? `${token} ${argSpec}` : token);
Object.defineProperty(cmd, COMMAND_DOCS, {value: {doc, fn}, configurable: true});
if (doc.summary) cmd.description(doc.summary);
+ if (doc.deprecated) {
+ const base = cmd.description() || '';
+ cmd.description(`${base} [DEPRECATED: ${doc.deprecated}]`);
+ }
const paramDesc = (/** @type {string | undefined} */ name) =>
(fn?.params ?? []).find(p => p.name === name)?.description ?? '';
diff --git a/packages/cli/foundation/response/response-types.doc.mjs b/packages/cli/foundation/response/response-types.doc.mjs
index ff9063da47..76fedaa06e 100644
--- a/packages/cli/foundation/response/response-types.doc.mjs
+++ b/packages/cli/foundation/response/response-types.doc.mjs
@@ -357,17 +357,17 @@ export const doc = {
{
value: 'layout.expand',
description:
- 'The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders).',
+ 'The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands.',
},
{
value: 'layout.check',
description:
- 'The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline).',
+ 'The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands.',
},
{
value: 'layout.grammar',
description:
- "The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry.",
+ "The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands.",
},
],
};