skate icon indicating copy to clipboard operation
skate copied to clipboard

feat: add autocompletion for keys and databases

Open RoseSecurity opened this issue 10 months ago • 1 comments

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: https://github.com/charmbracelet/skate/issues/145

Checklist before requesting a review

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

If this is a feature

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

References

RoseSecurity avatar Apr 24 '25 17:04 RoseSecurity

If I can assist with pull request review in any way, feel free to ping me

RoseSecurity avatar Sep 12 '25 17:09 RoseSecurity