Skip to content

Conversation

@weriomat
Copy link

@weriomat weriomat commented Dec 26, 2025

This adds support for generating autocompletion for different shells for the vector cli.
Superseds #9823

Summary

We are a subcommand to generate autocompletion for the vector cli.

Vector configuration

How did you test this PR?

I have tested the completion for zsh extensivly as well as generated the completion for the other shells available.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

Possibly this should be used in packaging of vector

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Related: #9823

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details here.

This adds support for generating autocompletion for different shells for
the vector cli.
Superseds [vectordotdev#9823](vectordotdev#9823)
@weriomat weriomat requested a review from a team as a code owner December 26, 2025 01:49
@github-actions github-actions bot added the domain: vdev Anything related to the vdev tooling label Dec 26, 2025
@github-actions
Copy link

github-actions bot commented Dec 26, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@weriomat
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@weriomat
Copy link
Author

recheck

Copy link
Contributor

@thomasqueirozb thomasqueirozb left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! This will be a nice addition

GenerateSchema(generate_schema::Opts),

/// Generate shell completion, then exit.
#[command(hide = true)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a particular reason to hide this?

Copy link
Author

Choose a reason for hiding this comment

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

Usually you dont make shell completions at runtime, but rather at comp/ install time. Thus, the user will not need this information. That is why completions are often generated via cargo xtasks.

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

Labels

domain: vdev Anything related to the vdev tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants