Skip to main content

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 (requires input group)
  • uinput — Creates a virtual keyboard to inject typed text (requires uinput group)

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:

MethodRequirementScope
uinputuinput groupSystem-wide
ydotoolydotool installedSystem-wide
tmux send-keysInside tmuxtmux only
ClipboardDisplay serverGUI apps

What's Next

Browse Common Workflows for practical usage patterns.