cli-expander
A terminal-native text expander designed to help CLI usage. Written in Rust.
Type a short trigger like :hello and it expands to a full sentence. Need user input? Forms render directly in your terminal — no GUI popups.
Learning Focus
By the end of this documentation, you will understand:
- How to create and manage text expansion triggers
- How to build interactive forms that render in your terminal
- How to use variables for dynamic content (date, clipboard, shell commands)
- How to integrate with your shell for in-prompt expansion
- How to configure system-wide keyboard detection
Features
- Trigger expansion —
:hello→Hello World! - Prompt-first workflow — Type
:trigger[Space], fill a TUI form, then edit or run the generated command from the shell prompt - Interactive forms — Text, password, checkbox, multiline, choice dropdowns, list selectors, and cascade fields — all in-terminal via Cursive TUI
- Variable system — Date, clipboard, shell command output, and form field injection
- Shell plugins — Expansion hooks for Zsh, Bash, and Fish
- Privacy-first — 100% local, no data leaves your machine
Quick Start
# Build from source
git clone https://github.com/donnyaw/cli-expander.git
cd cli-expander
cargo build --release
cp target/release/te ~/.local/bin/
# Create your first match file
mkdir -p ~/.config/texpand/matches
cat > ~/.config/texpand/matches/base.yml << 'EOF'
matches:
- trigger: ":hello"
replace: "Hello World!"
EOF
# Try it
te :hello
# Output: Hello World!
Documentation Structure
This guide is organized into 9 sections:
| Section | Description |
|---|---|
| 1. Introduction | What it is, installation, quickstart |
| 2. Core Concepts | Triggers, matches, config format |
| 3. Forms | Interactive form field types and controls |
| 4. Variables | Date, clipboard, shell, form variables |
| 5. Shell Integration | Zsh, Bash, Fish plugin setup |
| 6. Advanced | Variable chaining, system-wide mode |
| 7. Examples | Common workflow examples |
| 8. Troubleshooting | Common issues and fixes |
| 9. Reference | CLI commands, config reference |