ask-cmdk

Implements command palette interfaces with fuzzy search and keyboard navigation using the cmdk React library.

1|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/NalinDalal/skillset --skill ask-cmdk-nalindalal
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ask-cmdk
Source: https://github.com/NalinDalal/skillset/tree/main/skills/ui/ask-cmdk
Command: npx skills add https://github.com/NalinDalal/skillset --skill ask-cmdk-nalindalal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires cmdk, fuse.js.

What problem does it solve? Building a global command palette (⌘K) with fuzzy search, grouped commands, keyboard shortcuts, and async loading requires wiring together many pieces; this Skill provides ready-to-use cmdk patterns so you don't start from scratch. ## Core Features & Use Cases - Command Palette Setup: Complete React component with CommandInput, CommandList, CommandGroup, and CommandItem wired for search and selection. - Fuzzy Search & Highlighting: Fuse.js integration for ranked results with match highlighting, plus a simple built-in filter alternative. - Advanced Patterns: Debounced async loading, global ⌘K keyboard listener hook, contextual commands, and MRU (recent commands) history via localStorage. - Use Case: Add a ⌘K command palette to a Next.js app where users search global and page-specific actions, see recent commands, and trigger actions with keyboard shortcuts. ## Quick Start Ask the agent to add a command palette with ⌘K shortcut and fuzzy search to your React app using cmdk.

Frequently Asked Questions about ask-cmdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a command palette in React with cmdk?▼

Install cmdk and compose Command, CommandInput, CommandList, CommandGroup, and CommandItem components. Filter items by search text, group them with a reduce over a group field, and handle selection via onSelect callbacks.

How to add fuzzy search to a cmdk command palette?▼

Use Fuse.js with keys like label, description, and keywords and a threshold around 0.3 for ranked results. Fuse returns match indices you can render as highlighted mark elements in each item.

How do I open a command palette with ⌘K keyboard shortcut?▼

Add a global keydown listener that checks for metaKey or ctrlKey plus the k key, calls preventDefault, and toggles palette state. Also handle Escape to close, and clean up the listener on unmount.

Does cmdk support async loading of command items?▼

Yes, cmdk provides a CommandLoading component for loading states. Debounce your async loader by around 150ms, fetch items based on the search query, and render CommandLoading while results are pending.

Why is my cmdk palette not filtering items correctly?▼

Filtering fails when the search logic doesn't check all relevant fields. Verify your fuzzy filter includes label, description, and keywords in the haystack, and that every search term is matched against the lowercased combined string.