Open Source

Permission-aware command palette engine

Works with cmdk or Base UI. Auto-discover routes, fuzzy search with synonyms, RBAC filtering, frecency ranking, CLI tooling. The Quick Start stack (provider, register hook, cmdk adapter and shortcut) is about 8.3 kB min + brotli on top of React and cmdk.

$npm install cmdk-engine cmdk

Try it: press ⌘K or Ctrl+K anywhere on this site.

Everything your command palette needs

cmdk gives you beautiful primitives. cmdk-engine adds the brain.

🔍

Route Discovery

Auto-scan React Router and Next.js routes. The CLI writes a sitemap, and sitemapToCommands turns it into commands.

⚡

Fuzzy Search

Built-in lightweight fuzzy search: exact > prefix > substring > word initials > fuzzy. Words match in any order, and accents are ignored.

🔐

RBAC Filtering

Filter commands by user permissions. Supports any/all modes with a pluggable access provider.

📈

Frecency Ranking

Frequently and recently used commands float to the top. Exponential decay algorithm, zero config.

🔤

Keyword Synonyms

Bidirectional synonym engine. "money" finds "billing", and a synonym match never outranks a direct match.

📦

3.7 kB Core

Tree-shakeable, zero runtime dependencies. Core engine is 3.7 kB minified + brotli; the Quick Start stack (provider, register hook, cmdk adapter and shortcut) is 8.3 kB.

cmdk vs cmdk-engine

Keep cmdk's composable UI. Upgrade the brain behind it.

Featurecmdkcmdk-engine
Composable UI
Route auto-discovery
RBAC / permissions
Frecency ranking
Keyword synonyms
Deterministic sorting
Open upstream issues (#264, #375)
First item auto-select
Open upstream issue (#280)
Dynamic content updates
Open upstream issue (#267)
CLI tooling
UI-agnostic core

Architecture

Route Config ─→ Route Adapter ─→ Command Registry ─→ Keyword Engine
                                       │
                                       ├─→ Access Control Filter
                                       │
                                       ├─→ Search Engine (fuzzy / match-sorter)
                                       │
                                       └─→ Frecency Ranking
                                              │
                                              ▼
                                      Headless API / Hooks
                                              │
                                              ▼
                                      UI Adapter (cmdk / Base UI)

Package Entry Points

ImportSizePurpose
cmdk-engine3.7 kBCore engine (types, registry, search, keywords, access control, frecency)
cmdk-engine/react4.4 kBReact hooks (provider, useCommandPalette, useCommandRegister)
cmdk-engine/adapters/cmdk1.8 kBPre-wired cmdk components
cmdk-engine/adapters/react-router1.1 kBReact Router v6/v7/v8 route scanner
cmdk-engine/search/match-sorter0.55 kBOptional match-sorter search backend
cmdk-engine/adapters/base-ui1.8 kBPre-wired Base UI components
cmdk-engine/adapters/sitemap0.23 kBTurns the CLI route sitemap into commands

Minified + brotli, each entry's own code; siblings and peers excluded. The Quick Start stack (provider, register hook, cmdk adapter and shortcut) is 8.3 kB in total. All entry points are tree-shakeable. The core has zero runtime dependencies.