百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

tmux-palette

> 开发工具
开源

tmux 的射线式命令面板 — 速度快、可编写脚本、易于扩展

394 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

tmux 的射线式命令面板 — 速度快、可编写脚本、易于扩展

tmux-palette

A command palette for tmux. It runs on Bun, has no runtime dependencies, and opens quickly enough to use as a regular tmux binding.

Type a few letters, pick a command, hit enter: split a pane, jump to a window, detach a session, open a popup tool, or switch to a custom palette. User config lives in ~/.config/tmux-palette/*.json, so local changes survive repo updates.

Commands — main palette for panes, windows, sessions, and built-in tmux actions.

https://github.com/user-attachments/assets/3a8f3951-619f-46b4-a180-b9a03ccb8593

Themes + plugins — theme picker with live preview, plus custom palettes powered by shell commands.

https://github.com/user-attachments/assets/5edce838-9199-4123-8262-352bc47e989c

Status

The tool is in beta. It's stable enough to use day-to-day, but the surface area is still settling — I want the next few weeks to be about running it myself, gathering feedback, and shaking out bugs rather than growing the feature set.

If you'd like to contribute, the most useful work right now is anything that improves the existing base (refactors, perf, polish, docs) or fixes a bug. New features will likely get closed — no hard feelings, but please open an issue first to discuss before writing code.

Highlights

  • Fast startup — designed for frequent use from a tmux key binding
  • Custom palettes — define your own with a single JSON file, bind to any key
  • Hide built-ins — declutter the default palette via hidden.json
  • Mobile-aware — auto-fullscreens on narrow terminals (Moshi / Blink on iOS)
  • Curated themes — 13 built-in themes including Shades of Purple, Dracula, Tokyo Night, Catppuccin, Gruvbox, Nord, Solarized, and a transparent Terminal theme that follows your terminal colors. Pick one with live preview, or drop your own
  • Popup tools — use { "popup": "htop" } to open tools like btop, lazygit, log tails, or fzf scripts in a tmux popup
  • Scriptable sources — point a palette at a shell command that prints JSON or one item per line. Examples live in examples/
  • Small codebase — roughly 2k LOC, so it is easy to audit, fork, or patch locally
  • No fork required — every customization lives in ~/.config/tmux-palette/*.json

What you can build

  • Open lazygit, htop, btop, or log tails in a centered tmux popup.
  • Create a PR explorer from gh pr list that opens PRs in your browser.
  • Create a GitHub Actions picker that jumps straight to a workflow run.
  • Pick a Docker container and tail its logs in a popup.
  • List npm scripts from the current project and run one from tmux.
  • Bind focused palettes to separate keys, like M-t for Tools or M-a for Appearance.
  • Keep a personal favorites palette without editing the repo.

See examples/ for drop-in palettes you can copy into ~/.config/tmux-palette/palettes/.

Install

Use TPM if you already use it; otherwise manual install is the simplest path. The AI-agent option is just a guided setup flow.

Requirements

  • Bun
  • tmux 3.4+ recommended (display-popup -E support)
  • Optional tools for examples only: gh, jq, docker, npm, git, etc.

Manual install

Requires Bun: https://bun.sh

bash
git clone https://github.com/eduwass/tmux-palette ~/Sites/tmux-palette
cd ~/Sites/tmux-palette
bun install

Bind it to a tmux key in your .tmux.conf — Ctrl+Space gives the most "Raycast-feel" since it skips the prefix:

tmux
bind -n C-Space run-shell "~/Sites/tmux-palette/bin/tmux-palette.sh"

Or if you'd rather go through the tmux prefix:

tmux
bind p run-shell "~/Sites/tmux-palette/bin/tmux-palette.sh"

Reload: tmux source-file ~/.tmux.conf and hit your binding.

Install via TPM (Tmux Plugin Manager)

Requires Bun: https://bun.sh

Add to your .tmux.conf:

tmux
set -g @plugin 'eduwass/tmux-palette'
set -g @palette-key 'C-Space'             # optional, default: C-Space (no-prefix)
set -g @palette-find-pane-key 'M-f'       # optional, no binding by default
set -g @palette-move-pane-key 'M-m'       # optional, no binding by default

Then prefix + I (TPM's install key) to install. TPM clones the repo, runs bun install on first load, and binds the keys for you. Set @palette-key 'off' to skip the main binding and bind it yourself.

Guided onboarding with an AI agent

This is optional; it is just a guided setup flow. Choose it if you want an agent to drive the onboarding experience: install the repo, set up the tmux binding, test that it opens, and optionally create your first custom commands or theme.

Paste the prompt below into Claude Code, Codex, opencode, Cursor, or any AI coding agent.

…

Usage

  • Type to filter. Multi-word search is supported (split horiz).
  • Up/Down arrows or Ctrl+P / Ctrl+N to move selection; PageUp/PageDown to page. Turn on vimKeys in navigation.json for Ctrl+J/K (down/up) and Ctrl+U/D (page), replacing the search-box bindings for those keys.
  • Enter to run the selected command.
  • Esc to cancel.
  • Mouse works too — click rows, scroll the wheel.

Auto-aliases: initials of multi-word titles match automatically. Type nw for "New Window", cs for "Choose Session", sh for "Split Horizontal", etc.

Trust And Safety

  • CI runs bun test, TypeScript, Fallow dead-code, and Fallow duplication checks.
  • The codebase is intentionally small and has no runtime package dependencies.
  • Custom palettes are local JSON files, but they can run shell commands. Only copy palette examples you understand, especially if they come from outside this repo.
  • User config lives under ~/.config/tmux-palette/; normal customization should not require editing source files.

Known Limitations

  • Requires tmux popup support; tmux 3.4+ is recommended.
  • Plugin commands run each time their palette opens. Add your own cache layer for slow commands.
  • This is currently installed from the repo or via TPM, not a packaged npm release.
  • { "shell": "..." } and { "popup": "..." } actions execute through the user's shell by design.

Customize

Drop-in user config lives in ~/.config/tmux-palette/. One JSON file per concern — no source edits, no fork, survives upstream pulls.

Custom palettes

Path: ~/.config/tmux-palette/palettes/.json

Define a brand-new palette and bind any key to its name:

tmux
bind -n M-q run-shell "~/Sites/tmux-palette/bin/tmux-palette.sh my-favs"
jsonc
// ~/.config/tmux-palette/palettes/my-favs.json
{
  "title": "Favorites",
  "from": ["Toggle Diff Viewer", "Find Pane", "Choose Session"],
  "fromCategory": "Tools",
  "items": [
    {
      "icon": "",
      "title": "Custom item only in this palette",
      "action": { "tmux": "run-shell '~/scripts/x.sh'" },
    },
  ],
}
  • from — array of item titles to pull from the main commands palette (built-ins + your commands.json)
  • fromCategory — pull every item from one category
  • command — shell command that prints a JSON array of Item objects to stdout (see plugins below)
  • items — brand-new items defined inline
  • title / grouped / emptyText — same as built-in palettes

All keys optional. Resolution order: from → fromCategory → command → items.

Plugins

Drop-in ready-to-use palettes live in examples/ — git branches, GitHub PRs (with color-coded status dots), Docker container logs, npm scripts, file picker. Copy one and bind a key.

The command field is the plugin escape hatch — fzf-style. Anything that prints to stdout becomes a palette. Two output modes:

JSON mode — full control. Print a JSON array of Item objects:

jsonc
// ~/.config/tmux-palette/palettes/github-prs.json
{
  "title": "GitHub PRs",
  "command": "gh pr list --json number,title,url --jq '[.[] | {icon: \"\", title: ((.number|tostring) + \" \" + .title), action: {shell: (\"gh pr view \" + (.number|tostring) + \" --web\")}}]'",
}

Plain-text mode — fzf-style. Print one item per line, define a default action template at the palette level with {} substituted for the selected line:

jsonc
// ~/.config/tmux-palette/palettes/git-branches.json
{
  "title": "Git Branches",
  "command": "git branch --format='%(refname:short)'",
  "action": { "tmux": "send-keys 'git checkout {}' Enter" },
}

This means most "command that prints lines" tools you'd pipe through fzf can become tmux-palette palettes with no scripting — just the JSON config and an action template.

Write the command in any language, distribute it however you want (gist, repo, copy-paste). The plugin runs every time the palette opens (no caching), so for expensive calls add your own cache layer. Errors are surfaced as a single item in the palette so failures stay visible without crashing the popup.

hidden.json — hide built-in items

Drop a JSON array of item titles to skip them in the main commands palette:

json
["Toggle Status Bar", "Reload Config", "Toggle OpenTUI Top Bar"]

Items still appear if you reference them by title in a custom palette (see above) — hidden.json is just about decluttering the default.

commands.json — your own items

Append items to the commands palette without editing source:

json
[
  {
    "icon": "",
    "title": "Toggle Diff Viewer",
    "category": "Tools",
    "action": { "tmux": "run-shell '/path/to/script.sh'" }
  },
  {
    "icon": "",
    "title": "Open Project in Cursor",
    "category": "Tools",
    "action": { "shell": "cursor /path/to/project" }
  },
  {
    "icon": "",
    "title": "htop",
    "category": "Tools",
    "action": { "popup": "htop" }
  }
]

Action types: { "tmux": "..." }, { "shell": "..." }, { "popup": "..." }, { "palette": "find-pane" }.

{ "popup": "htop" } opens the given command in a centered tmux popup (80% × 80%, closes when the command exits). Handy for log viewers, htop, btop, less, fzf-driven tools, etc.

navigation.json — list navigation behavior

json
{
  "wrapAtListEnds": true,
  "vimKeys": true
}

All keys optional. wrapAtListEnds controls list navigation at the first and last selectable items. It defaults to true, so moving past either end wraps around. Set it to false to make the beginning and end hard stops.

vimKeys adds Ctrl+J/K for moving down/up and Ctrl+U/D for paging, replacing the search-box edit bindings for those keys. Default: false.

sizing.json — popup dimensions and borders

json
{
  "maxHeight": 28,
  "width": 90,
  "padX": 3,
  "mobileWidth": 80,
  "border": "none",
  "popupBorder": "none"
}

All keys optional. maxHeight caps how tall the popup gets when you have lots of commands. width is the fixed popup width. padX is the horizontal padding inside the popup.

mobileWidth is the client-width threshold for auto-fullscreen mode: when the terminal is narrower than this many columns (iOS terminals like Blink or Moshi typically run 50-60 cols), the popup goes edge-to-edge with padX=1. Defaults to 80, set to 0 to disable.

border is the main palette border, popupBorder is the border for { "popup": "..." } action popups. Both default to none. Accepted values: none, single, double, heavy, rounded, padded, simple — passed straight to tmux display-popup -b. rounded works but its corner glyphs can leave small visual gaps against the surrounding terminal, so it is not the default.

Themes

Open the main palette and pick Switch Theme... (under Appearance). Arrow-key through the list — every theme lives-previews instantly so you see the colors apply before you commit. Enter saves it and returns you to the previous palette with the new theme

Issues· 11 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptclicommand-palettetmux

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具