<#95 feat: CLI autocomplete> Issue created by <Mel...
# meltano-repo-activity
g
#95 feat: CLI autocomplete Issue created by MeltyBot Migrated from GitLab: https://gitlab.com/meltano/sdk/-/issues/95 Originally created by @Edgar Ramírez (Arch.dev) on 2021-04-12 063444 --- As I was trying to add shell autocompletion for a tap built with the SDK, I was able to do so following the click documentation. However, it felt like an unnecessarily complicated process and something the SDK should offer to plugin developers for free. Then I came across Typer, a library for building CLIs, built on top of
click
and extending it with a friendlier API and other perks. I was able to subclass
singer_sdk.tap_base.Tap
to use the library without any changes to the already working tap code (except for the super class). I found some immediate benefits by using Typer. End user • Easy to install completion for common shells (Bash, Zsh, Fish, Powershell) • More descriptive
--help
command with typed options, including enums. For example
--format [plain|json] [default: plain]
Plugin developer: • Automatic markdown documentation for your plugin SDK developer: • Use type annotations to declare option types • Less code repetition (e.g. CLI Option decorator for
--catalog
and a function argument
catalog
) At the moment, the particular tap is not public but I plan to do the same to tap-confluence, and I can also start a MR if this is something you think the SDK should have. meltano/sdk