Skip to content

Conversation

@awnion
Copy link

@awnion awnion commented Nov 29, 2025

Description

feat: Add support for shell completion in CLI using clap_complete

Test plan

Tested by hands yet on ZSH

Need help with testing all the targets

sui completion --generate bash
sui completion --generate elvish
sui completion --generate fish
sui completion --generate powershell
sui completion --generate zsh

Release notes

feat: Add support for shell completion in CLI using clap_complete

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

@vercel
Copy link

vercel bot commented Nov 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sui-docs Ready Ready Preview Comment Nov 29, 2025 0:48am
2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
multisig-toolkit Ignored Ignored Preview Nov 29, 2025 0:48am
sui-kiosk Ignored Ignored Preview Nov 29, 2025 0:48am

@awnion awnion changed the title feat: Add support for shell completion in CLI using clap_complete [sui][cli] Add support for shell completion in CLI using clap_complete Nov 29, 2025
@awnion awnion marked this pull request as ready for review November 29, 2025 12:52
@awnion
Copy link
Author

awnion commented Nov 29, 2025

related #24297

@kkomelin
Copy link
Contributor

Nice @awnion. Thank you. Look forward for it to be pushed!

@kkomelin
Copy link
Contributor

@awnion How can I test it with Bash on Linux?

Copy link

@Cvijan4PointO Cvijan4PointO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that you did it in a clean and efficient way and I think that this is a good addition to SUI CLI tooling.

@awnion
Copy link
Author

awnion commented Nov 29, 2025

@awnion How can I test it with Bash on Linux?

If you have Rust and Cargo set up, you can generate the completion file from my branch. E.g like this:

  1. Generate the file:

    cargo run --bin sui -- completion --generate bash > /etc/bash_completion.d/sui

    (You might need to run this with sudo since /etc/bash_completion.d/ is a system directory. If you don't have permissions, you can try directing the output to ~/.local/share/bash-completion/completions/sui instead.)

  2. Make it active:
    Once that file is in place, either open a new terminal session or run source ~/.bashrc (or equivalent).

  3. Test it out:
    Type sui (with a space) and hit Tab twice. You should immediately see the list of sui subcommands appear.

Let me know if you run into any issues with the file path!

@kkomelin
Copy link
Contributor

Tested with docker run --rm -ti ghcr.io/awnion/sui_cli_completions/sui_cli_bash_completions:latest
The autocompletion works fine.

@StefPler StefPler requested review from StefPler and stefan-mysten and removed request for StefPler December 1, 2025 08:14
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.

3 participants