Skip to main content

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/OptionDescription
inputText 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)
--enterSend Enter after injection (tmux mode)

Exit codes:

  • 0: Success, expansion printed to stdout
  • 1: 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]
OptionDescription
--config-dir <path>Match files directory
--csvOutput in CSV format
--jsonOutput 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"}]

Search triggers by name, description, or content.

ce search <query> [options]
Argument/OptionDescription
querySearch term to match against triggers
--csvOutput 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]
OptionDescription
--forceOverwrite 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>]
ArgumentDescription
layoutForm layout text with [[field]] placeholders
--titleForm 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

CodeMeaning
0Success
1General error (no match, invalid config, etc.)