Skip to content

feat: add shell completions and improve switch UX#111

Open
behnambagheri wants to merge 2 commits into
Loongphy:mainfrom
behnambagheri:feat/fish-completion-cx-switch-ux
Open

feat: add shell completions and improve switch UX#111
behnambagheri wants to merge 2 commits into
Loongphy:mainfrom
behnambagheri:feat/fish-completion-cx-switch-ux

Conversation

@behnambagheri
Copy link
Copy Markdown

@behnambagheri behnambagheri commented May 20, 2026

Summary

  • add shell completions for Bash, Zsh, and Fish via codex-auth completion <shell>
  • improve switch completion suggestions across shells and keep the switch TUI input handling fixes
  • remove the cx alias from the package and docs

Details

  • add completion bash, completion zsh, and completion fish
  • keep Fish switch suggestions dynamic and sourced from stored accounts
  • add Bash switch suggestions for both display numbers and emails
  • add Zsh switch suggestions and tune the presentation for command completion and switch completion
  • remove the cx npm binary alias and related docs/examples
  • keep the earlier switch UX fixes for Esc exit handling and arrow-key navigation
  • add screenshots requested for review directly in this PR

Validation

  • HOME=/tmp/codex-auth-pr-update ZIG_GLOBAL_CACHE_DIR=/tmp/codex-auth-pr-update/zig-global-cache ZIG_LOCAL_CACHE_DIR=/tmp/codex-auth-pr-update/zig-local-cache zig build run -- list
  • manual completion verification in Fish, Bash, and Zsh

Screenshots

Fish command completion

Fish command completion

Fish switch suggestions

Fish switch suggestions

Bash switch suggestions

Bash switch suggestions

Zsh command completion

Zsh command completion

Zsh switch suggestions

Zsh switch suggestions

@Loongphy
Copy link
Copy Markdown
Owner

Thanks, this looks great overall!

A few requests before we move forward:

  1. Could we also support Bash and Zsh completions in addition to Fish? It would be nice to keep completion support consistent across the common shells.
  2. Please remove the cx alias from this PR. It feels a bit too opinionated for the project itself. If you prefer using cx, you can still define that alias locally in Fish.
  3. Could you add a few screenshots to the PR description to demonstrate the implementation? For example, screenshots showing command completion and the switch account suggestions would be very helpful for review.

@behnambagheri behnambagheri changed the title feat: add Fish completions and improve switch UX feat: add shell completions and improve switch UX May 20, 2026
@behnambagheri
Copy link
Copy Markdown
Author

Thanks for the review.

I addressed the requested follow-up changes in this PR:

  • added Bash and Zsh completion support alongside Fish via codex-auth completion <shell>
  • removed the cx alias from the package and docs
  • added screenshots to the PR description for Fish, Bash, and Zsh completion behavior, including switch suggestions

I also rechecked the completion flows after the shell-specific updates and pushed the follow-up changes to this same PR.

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.

2 participants