Add the Nook "Command" component to this project, exactly as Nook ships it. A searchable list of actions, on the page or in a dialog. Steps 1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`. 2. Run `npx nook-ui@latest add command`. It writes `components/ui/command.tsx` together with everything the component needs. Do not write the component from memory. 3. If you cannot run commands, fetch http://localhost:3000/r/command.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`. 4. Use it where I ask. Start from this example: ```tsx "use client"; import * as React from "react"; import { CalendarIcon, PlusIcon, SearchIcon, SidebarIcon } from "@/components/icons"; import { Button } from "@/components/ui/button"; import { CommandDialog, type CommandGroup } from "@/components/ui/command"; const GROUPS: CommandGroup[] = [ { heading: "Actions", items: [ { value: "new-task", label: "New task", icon: , shortcut: "N", keywords: ["create", "add"] }, { value: "schedule", label: "Schedule a review", icon: , keywords: ["meeting", "date"] }, { value: "toggle-sidebar", label: "Hide sidebar", icon: , shortcut: "⌘B" }, ], }, { heading: "Go to", items: [ { value: "inbox", label: "Inbox", keywords: ["messages"] }, { value: "projects", label: "Projects" }, { value: "reports", label: "Reports", keywords: ["charts", "numbers"] }, { value: "billing", label: "Billing", disabled: true }, ], }, ]; export default function CommandDefault() { const [open, setOpen] = React.useState(false); const [last, setLast] = React.useState(null); React.useEffect(() => { const onKeyDown = (event: KeyboardEvent) => { if (event.key.toLowerCase() === "k" && (event.metaKey || event.ctrlKey)) { event.preventDefault(); setOpen((value) => !value); } }; window.addEventListener("keydown", onKeyDown); return () => window.removeEventListener("keydown", onKeyDown); }, []); return (

{last ? `Ran: ${last}` : "Nothing run yet."}

setLast(item.label)} />
); } ``` API - `Command`: The search field and the list. - `groups` (`{ heading?: string; items: CommandItem[] }[]`): The items, in groups. An item has `value`, `label` and optionally `icon`, `shortcut`, `keywords`, `disabled`, `onSelect`. - `onSelect` (`(item: CommandItem) => void`): Called with the chosen item. - `placeholder` (`string`): Hint in the search field. - `emptyText` (`string`, default "Nothing matches."): Shown when nothing matches. - `label` (`string`, default "Command menu"): Names the field for assistive tech. - `CommandDialog`: The same, in a dialog. Closes once an item is chosen. - `open` (`boolean`): Whether the dialog is open. - `onOpenChange` (`(open: boolean) => void`): Called when it opens or closes. - `title` (`string`, default "Command menu"): The dialog title, for assistive tech. Rules - Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them. - Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme. - It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles. - Accessibility: The search field has role=combobox and controls a listbox; focus stays in the field. Arrow keys move, Home and End jump, Enter runs the item, Escape closes the dialog. Disabled items are skipped. Done when the component renders like the example in light and dark mode and the project type-checks.