What is cli-expander
cli-expander is a terminal-native text expander written in Rust. It detects when you type a specific keyword (trigger) and replaces it with predefined text or an interactive form.
Unlike traditional text expanders that use GUI popups for forms, cli-expander renders forms directly in your terminal using the Cursive TUI framework. This makes it ideal for developers and system administrators who live in the terminal.
Use Cases
- Save typing — Expand common phrases, code snippets, email templates
- Interactive templates — Forms that prompt for input before expansion
- Dynamic content — Inject dates, clipboard content, shell command output
- System-wide automation — Expand triggers in any application, not just the terminal
Architecture
┌─────────────┐
│ texpand │
│ (CLI bin) │
└──────┬──────┘
┌────────────────┼────────────────┐
v v v
┌────────────┐ ┌────────────┐ ┌──────────────┐
│ Config │ │ Match │ │ Render │
│ Parser │──▶│ Engine │──▶│ Template │
└────────────┘ └────────────┘ └──────┬───────┘
┌────────────────────────────────┼──────────┐
v v v
┌────────────┐ ┌────────────┐ ┌──────────┐
│ Detect │ │ Inject │ │ UI │
│ (evdev) │ │ (uinput) │ │(Cursive) │
└────────────┘ └────────────┘ └──────────┘
What's Next
Continue to Installation to set up cli-expander on your system.