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
clipboardSystem clipboard content
shellcmd (command), trim (bool), debug (bool), shell (string)Command stdout
formlayout, fieldsInteractive form input
matchtriggerNested match expansion

Match Options Reference

OptionTypeDefaultDescription
triggerstringSingle trigger keyword
triggersarrayMultiple triggers for same match
replacestringText to replace trigger with
formstringForm layout with [[field]] placeholders
form_fieldsobjectField configuration for forms
varsarrayVariable definitions
global_varsarrayShared variables for all matches in file
force_modestringInjection mode: auto, clipboard, keys
propagate_caseboolfalseMatch case of typed trigger
uppercase_stylestringcapitalize_words for multi-word case
wordboolfalseWord boundary required
labelstringDisplay label for search and lists
search_termsarrayAlternative keywords for search

Form Field Types

TypeMultilineDefaultPlaceholderValuesDepends OnDescription
textSingle-line text input
choiceSingle-select dropdown
listScrollable list selection
checkboxBoolean toggle
passwordMasked 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.)