Completion System

Fast, smart, no config needed.

Multi-tier architecture

Hash tries completers in priority order:

TierSourceLatencyExample
1Tool-native (Cobra)10–200mskubectl get po<TAB> → pods
1.5Aliases & Functions<5msmyal<TAB>myalias (ƒ)
2Executables<10msCommands from PATH
3Filesystem<10ms./sr<TAB>./src/
4Agent fallback200–800msComplex context-aware completions

How it works

  1. Parse current word and cursor position
  2. Try Tier 1: Run tool __complete args... if tool supports Cobra
  3. Try Tier 1.5: Match user-defined aliases and functions
  4. Try Tier 2: Match executables from PATH
  5. Try Tier 3: List matching files/directories
  6. Try Tier 4: Ask agent (if configured and no results yet)
  7. Return first non-empty result

Supported tools (Tier 1)

Any tool built with Cobra that supports __complete:

  • kubectl, helm
  • docker, podman
  • aws, gcloud, az
  • terraform
  • And many more...

Aliases and functions

Hash completes your user-defined aliases and shell functions. These show with a ƒ icon to distinguish them from PATH executables.

  • Aliases defined with alias name='...'
  • Functions defined with name() { ... }
  • Functions from sourced scripts (~/.hashrc)
  • Functions imported during shell migration

Alias/function completions work anywhere in the command line, not just at the start. This is useful for commands like xargs or find -exec that take function names as arguments.

File completion details

  • Tilde expansion: ~/ → home directory
  • Hidden files: shown if prefix starts with .
  • Directory indicator: / appended
  • Preserves ./ prefix (e.g., ./src<TAB>./src/)

Fuzzy matching

When enabled, completion items are fuzzy-filtered by subsequence matching:

  • idx matches index.js, index.html
  • mnts matches main_test.go
config.toml
[completions]
fuzzy = true

Icons

File type icons (requires Nerd Font):

  • .go → Go gopher
  • .py → Python
  • .js/.ts → JavaScript/TypeScript
  • Directories → folder icon
config.toml
[completions]
file_icons = true # default