Skip to main content

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:helloHello 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:

SectionDescription
1. IntroductionWhat it is, installation, quickstart
2. Core ConceptsTriggers, matches, config format
3. FormsInteractive form field types and controls
4. VariablesDate, clipboard, shell, form variables
5. Shell IntegrationZsh, Bash, Fish plugin setup
6. AdvancedVariable chaining, system-wide mode
7. ExamplesCommon workflow examples
8. TroubleshootingCommon issues and fixes
9. ReferenceCLI commands, config reference