Skip to content

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

TypeScript

fix(cli): the documented hook example referenced a hook that does not exist (#4742)

Joeyd1b7d8229546
diff --git a/.changeset/cli-fix-hook-example.md b/.changeset/cli-fix-hook-example.md
new file mode 100644
index 0000000000..83e2aa6612
--- /dev/null
+++ b/.changeset/cli-fix-hook-example.md
@@ -0,0 +1,8 @@
+---
+'@astryxdesign/cli': patch
+---
+
+[fix] The documented `hook` example referenced `useToggle`, which is not a hook in the design system — running it failed with `ERR_UNKNOWN_HOOK`. It now uses `useFocusTrap`.
+
+This shipped in two places a consumer sees: `astryx manifest --json`, which agents read to learn the CLI, and the `hook` CommandDoc that feeds `--help`. Replaced in both.
+@josephfarina
diff --git a/packages/cli/clients/cli/commands/hook.doc.mjs b/packages/cli/clients/cli/commands/hook.doc.mjs
index 643e2cc8ec..f30c013955 100644
--- a/packages/cli/clients/cli/commands/hook.doc.mjs
+++ b/packages/cli/clients/cli/commands/hook.doc.mjs
@@ -38,7 +38,7 @@ export const doc = {
],
examples: [
{label: 'Browse the catalog', cli: 'astryx hook --list'},
- {label: 'One hook as JSON', cli: 'astryx hook useToggle --json'},
+ {label: 'One hook as JSON', cli: 'astryx hook useFocusTrap --json'},
],
exitCodes: [
{code: 0, when: 'success'},
diff --git a/packages/cli/clients/cli/lib/manifest.mjs b/packages/cli/clients/cli/lib/manifest.mjs
index b7a35df4c8..8d7510d957 100644
--- a/packages/cli/clients/cli/lib/manifest.mjs
+++ b/packages/cli/clients/cli/lib/manifest.mjs
@@ -103,7 +103,7 @@ const EXAMPLES = {
build: ['astryx build', 'astryx build "analytics dashboard" --json'],
swizzle: ['astryx swizzle XDSButton'],
template: ['astryx template --json', 'astryx template dashboard ./src/app'],
- hook: ['astryx hook', 'astryx hook useToggle --json'],
+ hook: ['astryx hook', 'astryx hook useFocusTrap --json'],
'theme build': [
'astryx theme build ./src/themes/ocean.ts --out ./dist/ocean.css',
'astryx theme build ./src/themes/ocean.ts --check',