Introducing Tab
@bomb.sh/tab is an open source library that brings shell autocompletions to JavaScript CLIs
JavaScript CLIs often ship without completions. That means every new option is a tiny doc hunt: you stop, check -h, or open docs just to remember a flag. It breaks flow, slows daily work, and makes tools feel less polished for teams.
That’s why we built Tab.
Tab brings shell autocompletions to JavaScript CLIs. It’s a simple drop-in enhancement that works with zsh, bash, fish, and PowerShell.
Who Is Using Tab
Tab has already been adopted by some major tools and CLI frameworks, including:
Why Tab Exists
Autocompletions are one of those tiny features that make a CLI feel like a first-class tool. We wanted JavaScript CLIs to feel as good as tools in other ecosystems, without making authors learn shell-specific scripting.
Tab focuses on the human developer experience:
- fewer context switches to docs
- faster onboarding for teammates
- less guessing and memorizing flags
- a CLI that feels native in every shell
How Tab Helps
You define your CLI structure once, and Tab handles the shell-specific completion scripts. It fits into your existing CLI code and keeps the API small.
Tab also ships with completion scripts for package managers (pnpm, npm, yarn, bun), so you can improve your own daily workflow right away.
How It Works
Define commands and options, then let Tab generate completions when the user runs complete:
import t from "@bomb.sh/tab";
const devCmd = t.command("dev", "Start dev server");devCmd.option("port", "Port", (complete) => { complete("3000", "Default"); complete("8080", "Prod");});
if (process.argv[2] === "complete") { const shell = process.argv[3]; if (shell === "--") t.parse(process.argv.slice(4)); else t.setup("my-cli", "node my-cli.js", shell);}If you already use CAC, Citty, or Commander.js, Tab can read your existing CLI definitions through adapters and generate completions automatically.
For Users
Users enable completions once, then hit TAB everywhere:
my-cli complete zsh > ~/.my-cli-completion.zshecho 'source ~/.my-cli-completion.zsh' >> ~/.zshrcGet Started
To add autocompletions to your CLI tool, install Tab:
npm install @bomb.sh/tab# orpnpm add @bomb.sh/tab# oryarn add @bomb.sh/tabLearn More:
Need Help?
If you maintain a CLI tool and want help adding autocompletions, open a discussion. The maintainers can help and may open a PR to get you started.
Tab is open source and available under the MIT license. Contributions and feedback are welcome.
Cloudflare
Nuxt
Vitest
Gunshi
Clerc