Show HN: 我为终端构建了一个命令面板 —— 6.2MB,纯 Go 编写,无需 fzf
Show HN: I built a command palette for the terminal – 6.2MB, pure Go, no fzf

原始链接: https://github.com/matheuzgomes/decoreba

**Decoreba** 是一款高性能、零依赖的命令行工具,专为管理和执行个人命令库而设计,且几乎不占用任何额外资源。它由 Go 语言编写,以轻量级(6.2 MB)的内联浮窗形式运行,直接显示在光标下方,而不会覆盖整个终端屏幕。 **核心功能包括:** * **智能搜索:** 利用模糊匹配(支持容错算法 Damerau-Levenshtein)和基于时效性的排序,即刻呈现相关命令。 * **工作流支持:** 支持多步命令和带内联输入提示(`{{placeholder}}`)的交互式模板。 * **无缝集成:** 提供 Shell 组件支持以实现直接执行,支持基于 Git 的命令库同步(可选 AES 加密),以及自动补全功能。 * **AI 就绪:** 内置模型上下文协议(MCP)服务器,允许 AI 代理搜索、编辑或执行你命令库中的指令。 * **安全可靠:** 零依赖运行,采用原子文件写入以确保数据完整性,并内置黑名单机制,防止意外执行危险命令。 Decoreba 专为追求速度和键盘操作的工作流而设计,为你提供了一种持久且便捷的方式来管理命令库,同时完全不会干扰你的终端环境。

Hacker News 社区近日对一个名为“Show HN: I built a command palette for the terminal”的 Go 语言编写的新 CLI 工具反应冷淡。 评论者普遍对该项目的营销方式和功能集不以为然。批评者质疑其 6.2MB 的文件大小,认为对于一个 CLI 工具来说过于“臃肿”,并对诸如 MCP 支持和内置同步等不必要的功能表示怀疑。 相当一部分反馈集中在该项目的文档上,用户认为其文档显然是由大语言模型(LLM)生成的。读者抱怨 README 的语言“不合时宜”且过于笼统,掩盖了工具的实际效用,让人难以理解其用途,也难以看出它为何比 `fzf` 等成熟的替代品更具优势。总的来说,这一反馈凸显了开发者群体中对未经编辑的 AI 生成项目描述日益增长的不满——这些描述往往追求流行词汇,却忽视了清晰且实质性的沟通。
相关文章

原文

  • Inline overlay — Opens below the cursor, not as a fullscreen app. Dismiss without trace. Pure ANSI escape codes, no libraries.
  • Fuzzy search + typo tolerance — Damerau-Levenshtein distance catches typos. Accent normalization (próximo matches proximo).
  • Recency ranking — Score = fuzzy match + usage count + exponential decay (48h half-life). Pinned commands stay at top.
  • Workflows — Multi-step commands with interactive runner. Each step is a title + command pair. Enter steps forward, Ctrl+X runs all.
  • Zero dependencies — Pure Go standard library. No ncurses, no fzf, no daemon. Single 6.2 MB binary.
  • MCP server — Model Context Protocol over stdin/stdout. Lets AI agents search, add, edit, and execute from your vault.

Downloads a prebuilt binary for your platform. No Go toolchain needed.

go install github.com/matheuzgomes/decoreba/cmd/decoreba@latest
decoreba                    # auto-detect context from cwd
decoreba git                # search within "git" context
decoreba add                # add a command
decoreba edit 0c9           # edit by id prefix
decoreba stats              # vault statistics

See the full reference below.


The overlay appears below your prompt, not fullscreen. Type to fuzzy-search. Enter copies the command. Ctrl+X executes it.

Note

Shift+Enter also executes, but only in terminals that implement the kitty keyboard protocol (kitty, WezTerm, Ghostty). In most terminals Shift+Enter sends the same byte as Enter and will copy instead.

When results exceed the viewport, an overflow indicator appears (… 3 more). If the terminal is 3 rows or shorter, a graceful message is shown instead. NO_COLOR or --no-color disables all ANSI codes.

Universal (every terminal emulator)

Key Action
/ Ctrl+K Navigate up
/ Ctrl+J Navigate down
Enter Copy selected
19 Direct select (empty search)
Ctrl+X Execute selected (press twice, or y to confirm)
Ctrl+E Edit selected
Ctrl+S Toggle pin
Backspace (empty) Remove context chip
Tab / Shift+Tab Next / previous field (form)
Esc / Ctrl+C Cancel

Kitty protocol only (kitty, WezTerm, Ghostty)

Key Action
Shift+Enter Execute selected

Ctrl+X triggers execution. A confirmation prompt appears: Run this command? y/yes n/no. Press Ctrl+X again or y to confirm. Any other key cancels.

With --shell-output, the command text is printed to stdout instead of the clipboard. The shell widget (below) strips the prefix automatically:

decoreba docker ps --shell-output   # prints "✓ docker ps" or "EXEC:docker ps"

decoreba add

Five fields: context, title, command, tags, notes. Context autocompletes from existing entries. Tags render as colored chips. Ctrl+W turns the command into a multi-step workflow editor.

decoreba edit <id> or Ctrl+E from the palette reopens the form pre-filled.

Commands can have multiple steps. Each step is a title + command pair.

Enter runs the next step. Ctrl+X runs all remaining (confirms first). Esc aborts. Failed steps show . Subprocess I/O routes through /dev/tty so interactive programs still work when piped.

Use {{placeholder}} or {{name:default}} in any command. On copy or execute, decoreba prompts for each value inline:

$ decoreba deploy

  Container name: [web]

Generate tab completions for subcommands, contexts, and sync actions:

eval "$(decoreba completion bash)"   # or zsh / fish

Opens the palette pre-filled with whatever you typed. Enter inserts the command at the cursor. Ctrl+X executes (confirms first).

source <(decoreba shell bash)   # or zsh

Installs both widget and completions into your shell rc file in one step. Creates a backup before modifying.

decoreba init              # interactive
decoreba init --yes        # non-interactive

Sync your vault across machines via a private GitHub Gist.

decoreba sync init          # create a new Gist and upload
decoreba sync push          # upload local changes
decoreba sync pull          # download remote changes
decoreba sync status        # show ahead/behind/diverged/clean

Requires DECOREBA_GIST_TOKEN (classic PAT with gist scope). Pass --encrypt to encrypt with AES-256-GCM before upload. The key is derived from the token.


Runs a Model Context Protocol server over stdin/stdout. Lets AI agents (Claude Desktop, Cline, etc.) interact with your command vault directly.

Tool Action
decoreba_search Fuzzy search across all contexts
decoreba_get Look up a command by ID
decoreba_list_contexts List all contexts with counts
decoreba_add Add a new command
decoreba_edit Update an existing command
decoreba_remove Delete by ID
decoreba_execute Run a command and return output
decoreba_stats Vault statistics

Write and delete tools require confirm: true. Dangerous commands (rm -rf /, > /dev/sda, etc.) are blocked by a built-in denylist. Auto-backup runs before every modification.


Single JSON file. Atomic writes (save to .tmp, rename over target).

OS Path
Linux $XDG_CONFIG_HOME/decoreba/commands.json
macOS ~/Library/Application Support/decoreba/commands.json
Windows %AppData%\decoreba\commands.json

Override the directory with $DECOREBA_CONFIG (the filename is always commands.json).


Metric Value
Binary 6.2 MB (CLI, stripped with -s -w)
Startup ~2 ms
RSS ~7 MB
Dependencies zero (pure Go stdlib)
Targets linux amd64/arm64, macOS amd64/arm64, windows amd64

  • Appear, don't replace. Inline overlay, not alternate screen. The terminal is exactly as it was before.
  • Right answer before you finish typing. Fuzzy + typo tolerance + recency + pinning.
  • Keyboard-first. Every action has a shortcut. The hint line teaches them progressively. No mouse.
  • Context over categories. Commands live under the tool they belong to. Auto-detection from cwd.
  • Accessible. NO_COLOR and --no-color disable all ANSI escape codes.
联系我们 contact @ memedata.com