Completion System
Fast, smart, no config needed.
Multi-tier architecture
Hash tries completers in priority order:
| Tier | Source | Latency | Example |
|---|---|---|---|
| 1 | Tool-native (Cobra) | 10–200ms | kubectl get po<TAB> → pods |
| 1.5 | Aliases & Functions | <5ms | myal<TAB> → myalias (ƒ) |
| 2 | Executables | <10ms | Commands from PATH |
| 3 | Filesystem | <10ms | ./sr<TAB> → ./src/ |
| 4 | Agent fallback | 200–800ms | Complex context-aware completions |
How it works
- Parse current word and cursor position
- Try Tier 1: Run
tool __complete args...if tool supports Cobra - Try Tier 1.5: Match user-defined aliases and functions
- Try Tier 2: Match executables from PATH
- Try Tier 3: List matching files/directories
- Try Tier 4: Ask agent (if configured and no results yet)
- 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:
idxmatchesindex.js,index.htmlmntsmatchesmain_test.go
config.toml
[completions]
fuzzy = true
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
file_icons = true # default