Skip to content

feat: add shell completions (bash, zsh, fish)#4943

Open
gitmpr wants to merge 1 commit into
anthropics:mainfrom
gitmpr:feat/shell-completion-scripts
Open

feat: add shell completions (bash, zsh, fish)#4943
gitmpr wants to merge 1 commit into
anthropics:mainfrom
gitmpr:feat/shell-completion-scripts

Conversation

@gitmpr
Copy link
Copy Markdown

@gitmpr gitmpr commented Aug 1, 2025

Adds static completion scripts for tab autocompletion under shell-completions/:

  • claude-completions.bash
  • claude-completions.zsh
  • claude-completions.fish

Note: If the claude binary supported integrated completions, users would simply be able to run:

source <(claude completion $SHELL)

as is common in many modern CLI tools.

Unfortunately, upstream integration isn’t possible. The client is not open source.

Adds static completion scripts under shell-completions/:
- claude-completions.bash
- claude-completions.zsh
- claude-completions.fish

Note: If the claude binary supported integrated completions,
users would simply be able to run:

    source <(claude completion $SHELL)

as is common in many modern CLI tools.

Unfortunately, upstream integration isn’t possible
the client is not open source.
@gitmpr gitmpr force-pushed the feat/shell-completion-scripts branch from d8cb78c to 8a0febd Compare August 1, 2025 19:33
@dexxiez
Copy link
Copy Markdown

dexxiez commented Aug 1, 2025

Would be good if the team took 3 minutes to run claude code on their project to make these into upstream. xoxox

@1160054
Copy link
Copy Markdown

1160054 commented Dec 17, 2025

Hi @gitmpr, thanks for working on shell completions for Claude Code!

I've also been working on a Zsh completion script and wanted to share it in case it's helpful:
https://github.com/1160054/claude-code-zsh-completion

Some features that might be worth considering:

  • Multi-language support: Completion descriptions in 120+ languages
  • Dynamic completions: Shows user's configured MCP servers when typing claude mcp remove <TAB>, installed plugins for claude plugin uninstall <TAB>, etc.
  • Plugin manager support: Ready-to-use with zinit, antigen, sheldon, and Oh My Zsh

Feel free to use any parts of it if you find them useful. I'm happy to collaborate or contribute if needed.

demo

@mishraprafful
Copy link
Copy Markdown

Cross-linking #62455 for visibility — it's a fresh feature request for tab completion inside bash mode (the ! prefix in the TUI), filed after #18637 was auto-closed for inactivity.

That's a different layer than this PR (which adds completion for the external claude command in the user's shell), but they're often conflated by people searching for the same problem, so worth keeping the threads connected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants