Skip to main content

Config Reference

Match File Schema​

matches:
- trigger: ":hello" # Single trigger keyword
triggers: [":hi", ":hey"] # Multiple triggers (alternative)
replace: "Hello World!" # Static replacement text
form: "Hello [[name]]!" # Form layout with [[field]] placeholders
form_fields: # Field configuration (for forms)
field_name:
type: choice # Field type: text, choice, list, checkbox, password
multiline: true # Enable multi-line (text only)
default: "Default value" # Pre-filled value
placeholder: "Hint text" # Placeholder when empty
values: # Options for choice/list
- Option A
- Option B
depends_on: other_field # Cascade dependency
vars: # Variable definitions
- name: var_name
type: date # Variable type: date, clipboard, shell, form, match
params: # Type-specific parameters
format: "%Y-%m-%d"
offset: 86400 # Seconds offset for date
global_vars: # Shared across all matches in file
- name: shared_var
type: shell
params:
cmd: "whoami"
force_mode: clipboard # Injection mode override: auto, clipboard, keys
propagate_case: true # Match case of typed trigger
uppercase_style: capitalize_words # Multi-word capitalization
word: true # Word boundary required
label: "Human-readable name" # Display label for search
search_terms: # Alternative search keywords
- keyword1
- keyword2

Variable Type Reference​

TypeParametersDescription
dateformat (strftime), offset (seconds), locale, tzCurrent date/time
clipboard—System clipboard content
shellcmd (command), trim (bool), debug (bool), shell (string)Command stdout
formlayout, fieldsInteractive form input
matchtriggerNested match expansion

Match Options Reference​

OptionTypeDefaultDescription
triggerstring—Single trigger keyword
triggersarray—Multiple triggers for same match
replacestring—Text to replace trigger with
formstring—Form layout with [[field]] placeholders
form_fieldsobject—Field configuration for forms
varsarray—Variable definitions
global_varsarray—Shared variables for all matches in file
force_modestring—Injection mode: auto, clipboard, keys
propagate_caseboolfalseMatch case of typed trigger
uppercase_stylestring—capitalize_words for multi-word case
wordboolfalseWord boundary required
labelstring—Display label for search and lists
search_termsarray—Alternative keywords for search

Form Field Types​

TypeMultilineDefaultPlaceholderValuesDepends OnDescription
text✓✓✓——Single-line text input
choice—✓—✓✓Single-select dropdown
list—✓—✓✓Scrollable list selection
checkbox—✓———Boolean toggle
password—✓✓——Masked text input

Global Config Options​

File: ~/.config/cli-expander/config.yml

OptionTypeDefaultDescription
search_triggerstring:Search trigger character
backendstringautoInjection backend: auto, clipboard, keys
max_form_widthint80Maximum form width in characters
max_form_heightint40Maximum form height in characters

Exit Codes​

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