CLI Commands
All commands use the ce binary (or cli-expander).
ce <trigger>
Expand a trigger and print the result. This is a shorthand for ce expand.
ce <trigger>
ce ":hello"
ce expand
Expand a trigger string from text input.
ce expand <input> [options]
| Argument/Option | Description |
|---|---|
input | Text to search for triggers |
--config-dir <path> | Match files directory (default: ~/.config/cli-expander/matches) |
--output <mode> | Output mode: stdout, tmux, clipboard, auto (default: stdout) |
--target-pane <id> | Target tmux pane ID (requires --output tmux) |
--enter | Send Enter after injection (tmux mode) |
Exit codes:
0: Success, expansion printed to stdout1: No match found or error
Examples:
ce expand ":hello"
ce expand "say :hello to the team"
ce expand ":greet" --config-dir ./my-matches
ce expand ":date" --output clipboard
ce expand ":command" --output tmux --enter
ce expand ":build" --output tmux --target-pane %1
ce list
List all available triggers from match files.
ce list [options]
| Option | Description |
|---|---|
--config-dir <path> | Match files directory |
--csv | Output in CSV format |
--json | Output in JSON format |
Example output:
Trigger Replace/Form Type
-------------------- ---------------------------------------- ----------
:hello Hello World! text
:today {{today}} text
:greet form
:choose form
CSV output:
ce list --csv
# trigger,replace,type
# :hello,Hello World!,text
JSON output:
ce list --json
# [{"trigger":":hello","replace":"Hello World!","type":"text"}]
ce search
Search triggers by name, description, or content.
ce search <query> [options]
| Argument/Option | Description |
|---|---|
query | Search term to match against triggers |
--csv | Output in CSV format |
--config-dir <path> | Match files directory |
Example:
ce search "git"
# Trigger Replace/Form Type
# git!com git commit -m "$|$" text
# git!rel git tag -a $|$ -m "" text
ce details
Show full details for a specific trigger.
ce details <trigger> [--config-dir <path>]
Example:
ce details ":greet"
# Trigger: :greet
# File: /home/user/.config/cli-expander/matches/base.yml:12
# Replace: Hello [[name]]!
# Type: form
# Fields: name (text, placeholder: "Your name")
ce generate-csv
Generate or update the CSV trigger database for fzf and other tools.
ce generate-csv [options]
| Option | Description |
|---|---|
--force | Overwrite existing CSV without prompt |
--output <path> | Custom output path (default: ~/.config/cli-expander/triggers.csv) |
The CSV database is used by shell plugins for fast trigger search. Regenerate after adding new matches.
ce generate-csv --force
ce form
Open an interactive form directly without a trigger match.
ce form <layout> [--title <title>]
| Argument | Description |
|---|---|
layout | Form layout text with [[field]] placeholders |
--title | Form window title (default: cli-expander) |
Example:
ce form "Name: [[name]], Age: [[age]]" --title "User Info"
ce config
Show configuration paths and available shell plugins.
ce config
Outputs:
- Config directory path
- Config file path
- Available shell plugins (Bash, Zsh, Fish)
ce --help
Print help information for any command.
ce --help
ce expand --help
ce list --help
ce search --help
ce form --help
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (no match, invalid config, etc.) |