@directus-labs/command-palette-module

中文文档
2.0.0发布于 2026/10/29ES Module构建来源已验证近 30 天下载 6132

Command palette module for Directus.

原始使用文档
文档目录4 节
  1. Features
  2. Requirements
  3. Installation
  4. Configuration

Command Palette Module

A command palette and configurable global search for Directus Studio.

Search Demo

Features

  • Open from anywhere with Cmd/Ctrl + K
  • Fuzzy command matching, keyboard navigation, command recents, recent searches, and recently selected collection items
  • Navigate content, files, users, insights, data-model settings, project settings, and deployments
  • Search individual collections
  • Search opted-in collections directly from the palette
  • Create items, upload files, copy version-aware API URLs, and run context-aware manual flows
  • On an item page: switch content versions, open the live preview or Visual Editor, and copy the item link or ID
  • Open your bookmarks, go to your profile, toggle light/dark theme, and sign out
  • Use the dedicated global search page for all configured collections
  • Configure per-collection fields, templates, descriptions, filters, sorting, result limits, and debounce rate
  • Ask the Directus AI Assistant about your query (Directus 11.14+ with an AI provider configured)

Requirements

Directus 11.6 or newer, including Directus 12.

Installation

Refer to the official extension installation guide for Marketplace and manual installation options.

Configuration

  1. Enable the module in Directus project settings. Enable Module
  2. Open the module settings and create the command palette settings field when prompted. Module Settings
  3. Configure searchable collections and fields. Search Setup
  4. Enable Available Globally only for collections that should return results directly in the palette.

Global palette search runs permission-aware item requests from the browser. It starts at two characters, searches at most 20 opted-in readable collections with five concurrent requests, and caps each collection at 25 results. Keep the opted-in set and limits small on large projects.

Directus 12 only lets non-admin users read an allowlisted set of project settings, so they can't read the command palette settings field. To keep search working for them, the extension keeps a read-only copy of the configuration in a global preset (no collection, layout command-palette). It's created and updated automatically when an admin saves the settings or loads the Studio, and it appears under Settings → Presets & Bookmarks. If it's deleted, the next admin visit recreates it.

Recent searches and selected collection items are stored locally, scoped to the current Directus project and user.

Disable this extension on Directus versions that provide a built-in command palette; otherwise both palettes respond to the same shortcut and open event.

版本与发布记录

@directus-labs/command-palette-module 共发布 5 个版本,首次发布于 2024/09/04;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.0latest2026/10/2914 天前
1.1.12026/02/198 个月前
1.1.02025/04/081.6 年前
1.0.12024/09/042 年前
1.0.02024/09/042 年前

关于 @directus-labs/command-palette-module 的常见问题

@directus-labs/command-palette-module 是什么?

Command palette module for Directus.

如何安装 @directus-labs/command-palette-module?

在项目目录运行 npm install @directus-labs/command-palette-module,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:zod(4.1.12)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@directus-labs/command-palette-module 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/directus-labs__command-palette-module 是否存在。

@directus-labs/command-palette-module 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@directus-labs/command-palette-module 可以商用吗?

@directus-labs/command-palette-module 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@directus-labs/command-palette-module 的下载量有多少?

根据 npm 官方下载统计,@directus-labs/command-palette-module 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,132 次,日均约 204 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@directus-labs/command-palette-module 还在维护吗?

最新版本 2.0.0 发布于 2026/10/29(14 天前);至今共发布 5 个版本,其中过去 12 个月发布了 2 个;首次发布于 2024/09/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。