Skip to content

feat: add autocompletion for keys and databases #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RoseSecurity
Copy link

@RoseSecurity RoseSecurity commented Apr 24, 2025

Describe your changes

Note

Feel free to accept, disregard, or close (my feeling won't be hurt)

  • This pull request introduces autocompletion. The get and delete commands now support key autocompletion across all databases, suggesting key names in the format key@db with prefix matching
  • The list and delete-db commands support database name autocompletion, returning entries like @default or @prod as the user types
  • The key completion logic uses a prefix scan with Badger’s iterator API, returning up to 200 suggestions to keep performance fast and predictable. Database names are fetched using the existing getDbs() function with optional prefix filtering

Usage

  • These completions are enabled automatically when users add eval "$(skate completion zsh)" (or the Bash/Fish equivalent) to their shell config

Related issue/discussion: #145

Checklist before requesting a review

  • I have read CONTRIBUTING.md
  • I have performed a self-review of my code

If this is a feature

  • I have created a discussion
  • A project maintainer has approved this feature request. Link to comment:

References

@RoseSecurity RoseSecurity requested a review from a team as a code owner April 24, 2025 17:56
@RoseSecurity RoseSecurity requested review from andreynering and removed request for a team April 24, 2025 17:56
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.

1 participant