{
 "kind": "tool",
 "slug": "cmdk",
 "path": "tools/cmdk/",
 "name": "cmdk",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "UI components and icons",
   "tools/ui-components/"
  ]
 ],
 "lead": "Command menu component library for React applications.",
 "chips": [
  {
   "label": "UI components and icons",
   "path": "tools/ui-components/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install cmdk"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/pacocoursey/cmdk"
  },
  {
   "label": "Website",
   "href": "https://github.com/pacocoursey/cmdk#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/pacocoursey/cmdk"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Quiet for a year",
   "status": "cond",
   "sub": "Last change Oct 29, 2025",
   "note": "Latest GitHub release Mar 14, 2025. ",
   "src": "https://github.com/pacocoursey/cmdk"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "393 projects",
   "status": "info",
   "sub": "#5 of 230 in its category",
   "note": "Dependency in 393 public GitHub projects set up for AI coding agents that we scanned (6.3%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What cmdk does",
   "parts": [
    {
     "t": "prose",
     "text": "cmdk is an unstyled React command menu where you write the items as plain composable JSX and the component filters and sorts them for you."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "cmdk popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "80",
       "of": "/ 100",
       "l": "Gid Score, #101 overall"
      },
      {
       "n": "51M",
       "l": "downloads a week, npm"
      },
      {
       "n": "13.2K",
       "l": "GitHub stars"
      },
      {
       "n": "393",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How cmdk is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "cmdk is a dependency in 393 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (8.1% of the 4,867 JavaScript/TypeScript ones), #5 of 230 in ui components and icons.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,628; those are left out of every share on this page.",
      "Projects that use it most often also use Class Variance Authority (98.7%), Lucide React (98.5%), clsx (97.2%).",
      "It is more common in projects set up for Roo Code (12.6%) than for Gemini CLI (4.2%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "228 projects, 9.3%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "189 projects, 5.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "157 projects, 5.2%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "25 projects, 5.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "23 projects, 8.2%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "20 projects, 4.2%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "18 projects, 5.2%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "14 projects, 12.6%",
       "v": "Roo Code",
       "path": "agents/roo-code/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 98.7% of its projects",
       "v": "Class Variance Authority",
       "path": "tools/class-variance-authority/"
      },
      {
       "l": "In 98.5% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 97.2% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 96.9% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 89.3% of its projects",
       "v": "Radix UI",
       "path": "tools/radix-ui/"
      },
      {
       "l": "In 83.5% of its projects",
       "v": "Sonner",
       "path": "tools/sonner/"
      },
      {
       "l": "In 83.2% of its projects",
       "v": "date-fns",
       "path": "tools/date-fns/"
      },
      {
       "l": "In 79.6% of its projects",
       "v": "next-themes",
       "path": "tools/next-themes/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "cmdk in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Items can live inside your own components",
       "v": "The README says the API is fully composable. Items can be wrapped in other components or written as static JSX. You do not have to pass them in as a data array."
      },
      {
       "l": "Styling hooks on every part",
       "v": "Every part forwards props, including <code>ref</code>, to a real element. Every part also gets a <code>cmdk-</code> data attribute such as <code>[cmdk-item]</code> or <code>[cmdk-list]</code> for CSS. The README also links drop-in stylesheets as a starting point."
      },
      {
       "l": "Ranking you can replace",
       "v": "You can pass a custom <code>filter(value, search, keywords)</code> function that scores each item. Item-level <code>keywords</code> act as aliases that can affect rank. You can also turn built-in filtering off with <code>shouldFilter={false}</code>."
      },
      {
       "l": "Accessibility checked with a screen reader",
       "v": "The FAQ says labeling, aria attributes and DOM ordering were tested with VoiceOver and Chrome DevTools. It also says the Dialog composes an accessible Dialog implementation."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "No virtualization",
       "v": "The FAQ says cmdk does not virtualize. It reports good performance up to 2,000-3,000 items. For more, pass <code>shouldFilter={false}</code> and bring your own virtualization."
      },
      {
       "l": "You wire up ⌘K yourself",
       "v": "The component does not listen for the keyboard shortcut. The README's dialog example adds its own <code>keydown</code> listener to toggle <code>open</code>."
      },
      {
       "l": "React 18 is required",
       "v": "cmdk depends on React 18 hooks. The FAQ also says it is a client component, not a React server component."
      }
     ]
    },
    {
     "t": "h3",
     "text": "A basic inline command menu"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Tsx",
       "code": "import { Command } from 'cmdk'\n\nconst CommandMenu = () => {\n  return (\n    <Command label=\"Command Menu\">\n      <Command.Input />\n      <Command.List>\n        <Command.Empty>No results found.</Command.Empty>\n\n        <Command.Group heading=\"Letters\">\n          <Command.Item>a</Command.Item>\n          <Command.Item>b</Command.Item>\n          <Command.Separator />\n          <Command.Item>c</Command.Item>\n        </Command.Group>\n\n        <Command.Item>Apple</Command.Item>\n      </Command.List>\n    </Command>\n  )\n}"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about cmdk",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/pacocoursey",
        "2 GitHub sponsors"
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "class-variance-authority: Component variant classes",
        "lucide-react: Icon set",
        "clsx: Class name joining",
        "tailwind-merge: Tailwind class merging",
        "@radix-ui: Headless UI primitives",
        "sonner: Toast notifications"
       ]
      },
      {
       "title": "More in UI components and icons",
       "path": "tools/ui-components/",
       "items": [
        {
         "text": "Lucide React",
         "path": "tools/lucide-react/"
        },
        {
         "text": "Class Variance Authority",
         "path": "tools/class-variance-authority/"
        },
        {
         "text": "Radix UI",
         "path": "tools/radix-ui/"
        },
        {
         "text": "Sonner",
         "path": "tools/sonner/"
        },
        {
         "text": "React Day Picker",
         "path": "tools/react-day-picker/"
        },
        {
         "text": "Vaul",
         "path": "tools/vaul/"
        },
        {
         "text": "react-resizable-panels",
         "path": "tools/react-resizable-panels/"
        },
        {
         "text": "shadcn/ui",
         "path": "tools/shadcn/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "cmdk",
       "me": true,
       "facts": [
        "MIT",
        "Gid 80",
        "51M/wk"
       ]
      }
     ],
     "more": "Compare cmdk with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install cmdk"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## cmdk\n- Give every `Command.Item` a `key` and a unique `value`. If `value` is omitted it is inferred from `.textContent`, and values are always trimmed.\n- Treat cmdk as a client component that requires React 18. Do not use it in a React server component.\n- Add your own `keydown` listener for ⌘K/Ctrl+K and toggle `open` on `Command.Dialog`. cmdk does not listen for the shortcut.\n- Keep `open` on `Command.Dialog` `false` during server rendering to avoid hydration mismatches.\n- For lists beyond 2,000-3,000 items, pass `shouldFilter={false}`, filter yourself and add your own virtualization.\n- Style through the `[cmdk-*]` data attributes. Groups are hidden with the `hidden` attribute, not unmounted.\n- Use `useCommandState` only for advanced cases such as a detailed empty state. Conditionally render `Command.Loading` while async items load.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm cmdk"
  ],
  [
   "Category",
   "UI components and icons"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v1.1.1, March 14, 2025"
  ],
  [
   "On GitHub since",
   "July 2022"
  ],
  [
   "Gid Score",
   "80.1"
  ],
  [
   "Rank in category",
   "#5 of 230"
  ],
  [
   "GitHub",
   "pacocoursey/cmdk"
  ],
  [
   "Last change",
   "Oct 29, 2025"
  ]
 ],
 "good": [
  "Used by Vercel, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/pacocoursey.png"
}