auto-click-auto is a small Python library (current version 0.1.5) that automatically enables tab shell completion for Bash (version 4.4 and up), Zsh, and Fish in Click CLI applications. It aims to simplify the setup of shell completion compared to Click's native methods by offering a seamless, automatic configuration. The project has a low-to-moderate release cadence, with the latest update on June 26, 2024.
pip install auto-click-autoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates integrating `auto-click-auto` into a basic Click CLI. The `enable_click_shell_completion` function is called at the end of the main CLI function, providing the program's executable name and a set of `ShellType` enums for which to enable completion.
Review Click's official documentation on shell completion to understand the native options before deciding on `auto-click-auto`. If your needs are simple and manual setup is acceptable, native Click completion might be preferred.
Monitor the project's GitHub repository for updates regarding its status and any recommendations for migration to Click's native completion or alternative tools if it becomes archived. Consider this when choosing long-term dependencies.
Verify that your target shell is one of the supported types and meets the minimum version requirements. For unsupported shells, you would need to implement custom completion logic or use another library like `click-completion` (though it's in maintenance mode for Click < 8.0).
Ensure `program_name` exactly matches how your CLI is invoked (e.g., if you run `my-app`, `program_name='my-app'`). After the first run of the CLI with `auto-click-auto` enabled, ensure you reload your shell (e.g., `source ~/.bashrc` or open a new terminal) or follow any specific instructions `auto-click-auto` prints to stdout. Double-check your shell version and type compatibility.
If you require PowerShell completion, `auto-click-auto` is not the right tool. You would need to explore Click's native methods for adding custom shell support (which is a more technical process) or look for other third-party Click extensions specifically designed for PowerShell completion, if available.