Skip to main content

Match Disambiguation and Search Labels

Match Disambiguation

When multiple matches share the same trigger, cli-expander shows a selection dialog letting you choose which one to use.

Example

matches:
- trigger: ":quote"
replace: "Every moment is a fresh beginning."
- trigger: ":quote"
replace: "Everything you can imagine is real."
- trigger: ":quote"
replace: "Whatever you do, do it well."

Typing :quote opens a numbered selection list. Pick the quote you want and press Enter.

Use Cases

  • Email signatures — personal vs work
  • Code snippets — different frameworks for same concept
  • Form templates — greeting variations
  • Command variations — build, test, deploy variants

Example: Email Signatures

- trigger: ":sig"
replace: |
Best regards,
John Doe
- trigger: ":sig"
replace: |
Cheers,
John
- trigger: ":sig"
replace: |
--
John Doe
Senior Engineer
Acme Corp

Search Labels

When you have many triggers, the search bar and ce list show the replacement text by default. For matches with variables or forms, use label to provide a human-readable description.

Without Labels

- trigger: ":tomorrow"
replace: "{{mytime}}"
vars:
- name: mytime
type: date
params:
format: "%x"
offset: 86400

Shows {{mytime}} in search results — not helpful.

With Labels

- trigger: ":tomorrow"
replace: "{{mytime}}"
label: "Insert tomorrow's date"
vars:
- name: mytime
type: date
params:
format: "%x"
offset: 86400

Shows Insert tomorrow's date in search results.

Search Terms

Add search_terms to make triggers discoverable by related keywords:

- trigger: ":ok"
replace: "OK"
label: "Confirm approval text"
search_terms:
- approve
- confirm
- yes
- accepted

Now ce search approve or ce search confirm will find this trigger.

What's Next