vibe-rust-tui
Ratatui UI conventions for the Mistral Vibe Rust CLI (vibe/cli-rust). Use when adding or changing any screen, list, picker, footer hint, keyboard shortcut, list navigation, scrolling or mouse clicks, back/close behavior, search field, selection highlight, color, or onboarding/dialog copy in the Rust TUI.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 5.4k
- Forks
- 796
01 前言 Front Matter
- name
- vibe-rust-tui
- metadata
- { "display-name": "Vibe Rust TUI", "default-prompt": "Use $vibe-rust-tui to follow the Rust TUI hint, keyboard, navigation, search, list-cursor and color conventions.", "short-description": "Hint, keyboard, navigation, mouse, search, list-cursor and color conventions for the Rust TUI" }
- description
- Ratatui UI conventions for the Mistral Vibe Rust CLI (vibe/cli-rust). Use when adding or changing any screen, list, picker, footer hint, keyboard shortcut, list navigation, scrolling or mouse clicks, back/close behavior, search field, selection highlight, color, or onboarding/dialog copy in the Rust TUI.
03 SKILL.md 正文
Vibe Rust TUI
UI conventions for vibe/cli-rust/. Every screen follows them so the TUI reads as one product. Local code rules, scenarios and goldens live in vibe/cli-rust/AGENTS.md and client-e2e/AGENTS.md.
Shortcut hints
- Name keys and actions only through
src/hints.rs:key::*,action::*and the shared pairs (hints::NAVIGATE,SELECT,SEARCH,CANCEL,CLOSE,BACK). Never write a key or action as a string literal at a call site. A single letter key ("d","r") is fine as long as its action comes fromaction::*. When a key or verb is missing, add it tosrc/hints.rs. - A hint is an unpadded
(key, action)pair (hints::Hint). The renderer owns all spacing; never bake spaces into a label. - Wording: actions are lowercase verbs (
navigate,select,close); keys keep their canonical casing (Enter,Esc,Ctrl+C,Backspace). Combined keys use/(Space/Enter,Esc/Ctrl+C). - Vertical navigation is
key::NAV(↑↓/jk) whenever j/k work; usekey::ARROWS(↑↓) only where a focused text field owns the letters. Horizontal navigation iskey::LEFT_RIGHT(←→). - Footers read
key action key action, ending with the Esc hint. Inline status lines (loading line, narrator) are the one exception and readkey to action. - Render every footer through
ui/hint_line.rs(draw,draw_clipped,line,spans,styled): they apply the shared key/action styles and clip to the box. Never place hint text with hardcoded x offsets or custom key styles. Center a hint withhints::width. - Onboarding and dialogs follow the same footer form (
Enter continue,Esc back), not sentences like "Press Esc to go back".
Keyboard navigation
- Every navigable list accepts
j/kalongside↑/↓when no text field is focused. Match only plain keys (no Ctrl/Alt/Super) soCtrl+J/Ctrl+Kkeep their editing meaning. - Show the navigation keys a screen actually handles: write
↑↓/jkonly where j/k are wired. - Edges:
↑↓/jk(and←→across dialog options) wrap at both ends; PageUp/PageDown/Home/End clamp. Move anOptionList(src/option_list.rs) withstep(down, len, wrap, selectable), whoseselectableskips rows (section headers, notes, blanks) that cannot take the cursor;list_nav::wrapis only for the onboarding's fixed two-choice screens. Never hand-rollsaturating_sub/min(len - 1)for arrow moves. The only lists that do not wrap are the ones attached to the composer: Down past the newest queued prompt leaves queue mode, and Up at the top of the subagent list returns focus to the composer. - Back: Esc goes back exactly one level (field → list, detail → list, auth flow → its
/mcplist) and closes only at the top level. Backspace edits text and is never a navigation key. A nested view's footer ends withhints::BACK(Esc back); a top-level view's footer ends withhints::CLOSEorhints::CANCEL. - Digits: a row's digit shortcut exists if and only if the row displays its number (
1. Trust folder). Pressing it is the same as moving to the row and pressing Enter. Parse it withlist_nav::digit; never accept digits on unnumbered rows, and never number rows that do not accept their digit.
Scrolling
- A scrolling list is an
OptionList: its renderer callslayout(lines, area)(the option on each line,Nonefor headers) orlayout_rows(len, area), which keeps the highlight in view throughui/list_scroll.rsfollowand records the click hit map; never write its ownscroll = selectedreconciliation. It moves the viewport the least and brings the option's non-selectable neighbours along: its section header above it, the list's leading lines for the first option, the trailing lines for the last one. Wrapping from the bottom back to the top therefore always shows the very top of the list. - The wheel and the scrollbar (
wheel,detach_at) free the viewport until the next keyboard move (step,select); a freed viewport only clamps its offset.highlightmoves the highlight without reattaching it.
Mouse
- Every clickable list is an
OptionList<R>: route its press, drag and release throughmouse::option_gesture(it keeps text selection working inside the bottom app) orOptionList::mouse, and add it tomouse::option_listso it gets the wheel, scrollbar and hover. Never hit-test rows by hand. - The click rule
Ris part of the list's type and comes from the item's per-item actions, the keys that act on the highlighted item. Navigation, search, Esc and whole-list keys (rrefresh or reload, Tab switching the save target) do not count.- One action, choosing the item (tool approval, questions,
/theme,/plugins, subagents, config choices, the remote project picker):SingleAction, one click confirms. A click yields the option index. - Several actions (
/modeland/thinking: Enter ors;/resume: Enter ord;/mcp: Enter,dore;/config: Enter or Ctrl+R):MultiAction, a click highlights and a click on the highlight does what Enter does. A click yieldsClick::HighlightorClick::Confirm; a highlight click moves like an arrow key (/resumepreviews).
- One action, choosing the item (tool approval, questions,
- A row's own click targets (the
/log-levelbadges) are one action each, so a click on one acts at once. - The free-text row of a question is an input: a click places the caret and a click on its number toggles it in multi-select. It never submits.
Searchable lists
- Use
search_field::Search,search_field::handle_keyandsearch_field::pastefor any filterable list, and build its footer withsearch_field::hints. - The model: lists open with the list focused;
/focuses the field; typing filters live (letters, including j/k, go to the field);↑↓, PageUp/PageDown and Enter keep acting on the list while the field is focused; Esc first leaves the field (the filter stays), then clears the filter, then closes the screen. - Do not add other entry points into search (Tab, Left, type-to-search on open). Do not make Enter only "apply" the filter: it acts on the highlighted item.
- The list footer includes
hints::SEARCH. - The search row sits directly under the title, followed by one blank row, and reads
/ placeholder(Search plugins,Search settings). It is always visible in the list view and hidden in detail views. Draw it only withui/search_field.rsdraw_row, which owns the/and the field's indent; never put a search field at the bottom of a list or in the footer. The project picker is the one exception: its labelledSearch projects:field shares the formFieldof its create view.
Selection
- The focused row is the list-cursor bar:
ui/list_cursor.rsstyle()across the full row width (block-cursor colors, bold). No glyph cursors (›,▸,>) for focus. - Draw the bar only through
list_cursor:paint(f, area)fills a row area,styles(highlighted)/styles_on(highlighted, bg)give the(text, dim)styles of a row,marker_stylestyles the current-value marker on it. Never readtheme::block_cursor_bg/block_cursor_fgoutsideui/theme/andui/list_cursor.rs(a unit test enforces it). Text-field carets are not list cursors: usetheme::block_caret(TextArea-like fields) ortheme::fixed::input_caret(compactInput-like fields). - Horizontal options (dialog buttons) render each option as a
labelchip; the selected chip takeslist_cursor::style(). Keep labels at the same columns when switching selection. - The current value (the active model, theme, level, layer or session) is marked with
list_cursor::marker(true)(›) inlist_cursor::current_color(), in a two-column slot that stays blank (list_cursor::BLANK) on other rows. (String, Style)row renderers paint the full-width bar for rows wherelist_cursor::is_barholds, and keep a span's own background instead of overwriting it.
Colors
- Every color value lives in
src/ui/theme/: theme-dependent colors in the theme palettes (theme::foreground(),theme::muted_style(), ...), fixed brand and terminal colors inui/theme/fixed.rs(ORANGE,LOADING_GRADIENT, onboarding colors,sgr::*escape codes, the Monokai/Alabaster named palette viafixed::named), syntax colors inui/theme/syntax.rs. A fixed color such as the brand orange is fine, but it is defined once there and imported everywhere else. - Outside
src/ui/theme/, never writeColor::Rgb(..),Color::Indexed(..), a namedColor::*variant or a raw SGR color code. When a screen needs a new color, add a named constant or theme accessor first.tests/units/color_literals.rsfails on any literal outside the theme module (onlyupdate_prompt/ansi.rs, which converts anyColorto SGR, and test code are exempt).
Verification
- Any change to a hint, a key, a list behavior (wrap, back, digits, scroll, search, clicks) or a selection style is user-visible: update the affected
client-e2escenarios (screen_contains, key sequences, mouse coordinates) and regenerate their goldens as described invibe/cli-rust/AGENTS.md. A new behavior gets its own scenario (for examplemcp/mcp_wrap_scroll). - Shared helpers carry their own unit tests (
tests/units/option_list.rs,option_clicks.rs,list_nav.rs,list_scroll.rs,search_field.rs); extend them when a helper changes instead of testing the rule screen by screen. tests/units/color_literals.rsguards the color and list-cursor rules. Do not add exemptions to make it pass: move the color intosrc/ui/theme/or route the bar throughlist_cursor.
04 同仓库更多 Skills
import
Import the user's setup from other coding CLIs (Claude Code, Codex, OpenCode) into Vibe — instructions, skills, subagents, commands, hooks, MCP servers, permissions, and plugins. Load when the user wants to switch to Vibe, import or reuse another CLI's configuration, or asks whether a file from another CLI works in Vibe.
worktree
Create, reuse, and clean up git worktrees under $VIBE_HOME/worktrees. Use when the user wants to work in an isolated git worktree, create a worktree for a task, or list/remove existing worktrees.
vibe
Authoritative reference for Mistral Vibe — the CLI agent you (the model) are running inside. LOAD when the user: - asks anything about Vibe itself, even by indirect name ("this CLI", "this tool", "you"); - wants to change, inspect, or reset their setup; - asks why the agent did or did not act; - asks how to make the CLI do X, where X lives, or what a flag/command/setting does; - asks any meta question about your own behavior; - is unsure whether a command, flag, env var, or file is in scope — this skill is the source of truth. SCOPE: config under `~/.vibe/` and project-local `.vibe/`; `VIBE_*` and `LOG_*` env vars; models and providers; agents and subagents; skills; tools and their permission model; every slash command and CLI flag; hooks; MCP servers; connectors; plugins; trusted folders; `@`-file mentions; logs; themes; voice.
skill-creator
Load this skill before creating, updating, or deleting a Vibe skill, or whenever you plan to add or modify SKILL.md files under a skills directory. It explains Vibe's SKILL.md frontmatter, discovery order, support files, and the permission flow.
create-plugin
Create a Vibe plugin package — the Agent Plugins 1.0 format with optional Vibe extensions for skills, MCP servers, hooks, knowledge, agents, libraries, and connectors. Use when the user wants to create, scaffold, or author a plugin for Mistral Vibe.
prompts
暂无简介