System-Wide Mode
By default, cli-expander works with explicit invocation (texpand expand). System-wide mode enables automatic trigger detection in any application.
How It Works
System-wide mode uses two Linux kernel subsystems:
- evdev — Reads keyboard events from
/dev/input/event*devices (requiresinputgroup) - uinput — Creates a virtual keyboard to inject typed text (requires
uinputgroup)
Permission Setup
sudo usermod -aG input $USER
sudo usermod -aG uinput $USER
# Log out and back in
Injection Fallback Chain
When uinput is unavailable, cli-expander tries these alternatives:
| Method | Requirement | Scope |
|---|---|---|
| uinput | uinput group | System-wide |
| ydotool | ydotool installed | System-wide |
| tmux send-keys | Inside tmux | tmux only |
| Clipboard | Display server | GUI apps |
What's Next
Browse Common Workflows for practical usage patterns.