Skip to main content

Crate rootle

Crate rootle 

Source

Modules§

action
Central action enum — components emit these, the root dispatcher routes.
app
Root: mode stack, action dispatch, component tree (PLAN.md §6). GitHub calls run on worker threads (blocking reqwest); results return over an mpsc channel as AppEvents, drained once per event-loop tick.
cli
CLI arguments (PLAN.md milestone 8) + the provider manager subcommand tree (plans/0010 M3).
clipboard
Clipboard (plans/0003 §1): OSC 52 first — works over SSH and tmux with zero deps — plus a best-effort local tool fallback (wayland/X/ macOS). ROOTLE_CLIPBOARD=<path> redirects to a file for e2e/CI (no clipboard exists there).
commands
Command registry (plans/0003 §3): the : command line’s option list is derived from this table — one source of truth, like the keymap tables. Adding a command = one row + one RunCommand arm.
components
Component contract (PLAN.md §6). Components own state, emit Actions, render into a caller-given Rect. See .agents/skills/rootle-component.
config
~/.config/rootle/config.toml — [editor], [theme], [cache], [provider], [ui]. Settings view edits a subset live.
editor
Editor integration (PLAN.md §12): materialize the cached blob to a real file, suspend the terminal, spawn the editor read-only, resume with a full redraw — the one legitimate terminal.clear().
event
App events from background workers (GitHub API calls run on worker threads; results return over this channel into the event loop).
github
GitHub REST backend (PLAN.md §7) — wire models + raw client. The UI-facing seam is crate::provider; provider/github.rs wraps this. Blocking client on worker threads; results return over an mpsc channel as AppEvents. Auth resolution: ROOTLE_TOKEN → GITHUB_TOKEN → gh auth token → anonymous (60 req/h).
highlight
syntect highlighting mapped onto the active palette (PLAN.md §11). Pure-Rust fancy-regex backend (musl-static friendly). The syntect theme is built from the Theme’s syntax roles, so it follows theme switches (embedded palettes and themes/<name>.toml alike).
keymap
Keymap tables: mode → key → Action, plus the hint rows derived from the same source (PLAN.md §6). Dispatch and hints can never drift apart.
mode
Modal modes. The modeline chip is derived from these.
provider
Provider seam (plans/0005): the TUI talks to source-control backends through this trait — never to a concrete API. github is the in-tree reference implementation; external providers are child processes speaking NDJSON-RPC over stdio (stdio.rs), so any internal system can be wrapped with a small script.
sanitize
Sanitization boundary: remote bytes are hostile terminal input. Everything the UI draws from network/disk passes through here (PLAN.md §9).
state
Persisted app state: ~/.local/state/rootle/state.json (PLAN.md §10). Distinct from the cache — state survives cache eviction. Atomic tmp+rename writes on state transitions; corrupt/missing → defaults.
theme
Themes: Catppuccin Mocha is the embedded default; the other famous dark palettes (Dracula, One Dark, Gruvbox Dark, Nord, Tokyo Night, Solarized Dark) plus four light ones (Catppuccin Latte, GitHub Light, One Light, Solarized Light) ship embedded too. ~/.config/rootle/themes/<name>.toml overrides merge on top of the embedded base — fork a builtin by writing a file with its name.
update
App updates (plans/0017): rootle update for tarball installs and the 24h-cached startup check behind the modeline notice.