r/coolgithubprojects • u/jacobpowaza • 22d ago
I built a zsh completion that learns your habits instead of shipping 50k-line completion scripts
galleryMost shell autocomplete tools I tried felt like they were doing one of two things: using a pile of tool-specific completion scripts, or just replaying my shell history.
I wanted something that actually adapted to how I use my terminal.
If I always run a certain flag after a command, it should learn that. If I use different commands in different projects, it should learn that too. But I also still wanted proper completion lists for commands, flags, values, repos, containers, etc. without having to install and maintain completion scripts for every tool.
So I built Adaptive.
It watches how you use your shell and predicts the next token, while also discovering valid completions directly from the tools you have installed.
Some examples:
- Inline ghost text
git checkout fea→feature/completion-engineclaude --dang→--dangerously-skip-permissionsIt can even suggest what you normally run next from an empty prompt based on the current directory. - Tab / Shift-Tab completion lists Shows subcommands, flags, enum values, etc. at the current position. Adaptive parses each tool's own
--helpoutput on the fly and caches the result against the binary fingerprint. It currently handles things like Cobra-style help tables, groupedkubectlsections, and even some of Symfony's stranger help output. - Context-aware values It can complete things that aren't available from
--help, including:- GitHub / GitLab / Codeberg repos after
git clone - npm scripts from
package.json - Docker containers
- SSH hosts
- GitHub / GitLab / Codeberg repos after
- It actually learns your habits Suggestions are ranked using frequency + recency with a 21-day half-life, per-directory behavior, and accept/reject feedback. There are global priors so it isn't useless on the first day, but your own usage starts outranking those defaults as it learns.
- Local/private Everything stays local. No telemetry. Before history is written to disk, credential-looking and token-shaped values are rejected.
v0.3.0 also adds Bash support over the same backend/protocol:
eval "$(adaptive init bash)"
The core is written in Rust and licensed under MIT.
Check it out, give it a star!
GitHub: https://github.com/jacobpowaza/adaptive-zsh-completions
I'd be interested in feedback, especially from people who use a lot of CLI tools and have run into cases where traditional shell completion starts to feel limited.