devbook-tui
A fast, keyboard-driven terminal user interface (TUI) for the Devbook prompt engineering workbench and developer workspace, built with Ratatui and Crossterm.
Features
- Host URL Resolution & Host Switcher:
- Environment default: When
DEVBOOK_REMOTE_URL(orDEVBOOK_URL) is set in the shell (e.g.export DEVBOOK_REMOTE_URL="http://remote-server:3008"), runningcargo runordevbook-tuiconnects directly to that URL. - Fallback: If
DEVBOOK_REMOTE_URLis not set, defaults tohttp://localhost:3000. - CLI overrides:
--url <URL>,--host <URL>,--remote(usesDEVBOOK_REMOTE_URL), and--local(http://localhost:3000) always take precedence over the environment. - Locking behavior:
- If
DEVBOOK_REMOTE_URLis set, host switching is locked by default so the TUI stays pinned to your configured instance. - Pass
--allow-switchto re-enable the Host Switcher dialog while usingDEVBOOK_REMOTE_URL. - If
DEVBOOK_REMOTE_URLis not set, Host Switcher (Horu) is enabled automatically.
- If
- Environment default: When
- 3-Pane Master–Detail Layout (Devbook Cyan & Electric Blue Theme):
- Header: Live host URL badge, workspace statistics (Prompts, Pinned, Standalone, Projects, Attachments), active Markdown view mode, and search filter badge.
- Pane 1
[1] Scopes & Projects: All Prompts, ★ Pinned, Standalone scratchpads, and all Projects with prompt counts. - Pane 2
[2] Prompts: Filtered list showing pin markers (★), prompt titles, optional checklist progress badges ([done/total]), attachment counters (📎), project badges, and updated dates. - Pane 3
[3] Prompt Detail [Preview | Raw]: Prompt metadata header (project, char/word/line counts, updated timestamp, attachment counters) and rich Markdown body.
- Template Variable Highlighting & Smart Checklists:
- Highlight prompt template placeholders (
{{ variable_name }}) with distinct styling in preview mode. v/mtoggles between Styled Preview Mode (GFM headings, fenced code blocks, blockquotes, tables, horizontal rules, bullet lists, word wrap) and Raw Markdown Mode (with line numbers).- If a prompt contains
- [ ]/- [x]checklist items,j/kin Preview mode navigates directly between tasks andSpace/Entertoggles completion state back to the server. J/K,PageDown/PageUp, andg/Gscroll the full document smoothly.
- Highlight prompt template placeholders (
- Full CRUD, Quick Append & External
$EDITOR:a: Quick Append to Prompt modal — append instructions, examples, or checklist items (- [ ]) under an optional## Sectionheader without leaving the TUI.n/e: Create or edit Projects (in Pane 1) or Prompts (in Pane 2/3).d: Delete Project (preserving prompts as standalone), Prompt, or Attachment with confirmation dialog.p: Toggle pin status on selected Prompt.K/J: Reorder pinned Prompts when viewing the Pinned scope.E: Open full Markdown prompt body in external$EDITOR(e.g.nvim,vim,nano). Suspends TUI cleanly and saves back to Devbook on exit.
- Attachments & Zero-Latency Clipboard Copy:
A: Open Context Attachment Manager modal to view attachments, upload new files by path (u), download files to disk (s), copy attachment URLs (y), or purge files (d).c/Y: Copy entire Markdown body to system clipboard (arboard).y: Yank active checklist item text (or prompt title) to system clipboard.
- Live Search:
/: Real-time full-text search across prompt titles and bodies. PressEscto clear.
Installation & Running
[!NOTE]
devbook-tuiconnects to a running Devbook backend instance (defaults toDEVBOOK_REMOTE_URLorhttp://localhost:3000).
Installation on macOS
Quick Install (One-Liner)
Download the pre-built Apple Silicon (arm64) binary directly from GitHub Releases into ~/.local/bin and make it executable:
&& \
&& \
PATH Setup
Ensure ~/.local/bin is in your $PATH. If not already configured, add it to your shell configuration (~/.zshrc or ~/.bashrc):
macOS Gatekeeper Note
If macOS displays a security prompt preventing execution of the unnotarized binary, clear the quarantine attribute:
Building from Source
Alternatively, build and install the binary from source using Cargo:
# Build release binary
# The compiled binary will be located at:
# ./target/release/devbook-tui
# Run (defaults to DEVBOOK_REMOTE_URL if set, otherwise http://localhost:3000)
# Force local host even if DEVBOOK_REMOTE_URL is set
# Specify any target host explicitly
# Allow in-app Host Switcher even when DEVBOOK_REMOTE_URL is set
Keyboard Shortcuts
| Key | Action |
|---|---|
1, 2, 3 |
Direct focus to Pane 1 (Sidebar), 2 (Prompts), 3 (Detail) |
Tab / BackTab |
Cycle focus forward / backward between panes |
h / l |
Move focus left / right |
j / k |
Move selection down / up in focused pane |
Enter |
Enter pane 2 from sidebar, or pane 3 from prompts list |
v / m |
Toggle between Preview (styled GFM with {{ variable }} highlights) and Raw (line-numbered) Markdown modes |
Space / Enter |
Toggle active checklist item [ ] ⇄ [x] (in Pane 3 when tasks exist) |
a |
Quick-append Markdown content or task (- [ ]) to current prompt |
E |
Open prompt Markdown body in $EDITOR |
J / K |
Scroll detail document down / up |
g / G |
Jump to top / bottom of detail document |
c / Y |
Copy full prompt Markdown body to system clipboard |
y |
Yank active task text or prompt title to system clipboard |
H / u |
Open Host Switcher dialog (when enabled or via --allow-switch) |
/ |
Live search & filter prompts (Esc to clear) |
n |
New Project (in pane 1) or Prompt (in pane 2/3) |
e |
Edit Project or Prompt metadata |
d |
Delete with confirmation |
p |
Toggle pin on selected Prompt |
K / J |
Reorder pinned prompts up / down (in Pinned scope) |
A |
Manage prompt attachments |
r |
Refresh data from server |
? |
Show help modal |
q |
Quit application |