Creating a bash completion script (2018)

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Git

    Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.

    Writing shell completions is a surprisingly tricky - especially for larger CLI tools or when you want to provide more advanced suggestions. Everything has to be done imperatively, usually as a shell script! It can get hairy quickly.

    As a point of comparison, see the difference between the git completions written in bash [1] vs the declarative equivalent [2].

    [1] https://github.com/git/git/blob/master/contrib/completion/gi...

    [2] https://github.com/withfig/autocomplete/blob/master/src/git....

  • autocomplete

    IDE-style autocomplete for your existing terminal & shell

    Writing shell completions is a surprisingly tricky - especially for larger CLI tools or when you want to provide more advanced suggestions. Everything has to be done imperatively, usually as a shell script! It can get hairy quickly.

    As a point of comparison, see the difference between the git completions written in bash [1] vs the declarative equivalent [2].

    [1] https://github.com/git/git/blob/master/contrib/completion/gi...

    [2] https://github.com/withfig/autocomplete/blob/master/src/git....

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • zio-cli

    Rapidly build powerful command-line applications powered by ZIO

    >It would almost be easier to modify the bash source itself to read and use a regular grammar

    It's an interesting idea that we're using for zio-cli [1].

    [1] https://github.com/zio/zio-cli/pull/119

  • zsh-completions

    Additional completion definitions for Zsh.

  • fzf

    :cherry_blossom: A command-line fuzzy finder

  • cleo

    Cleo allows you to create beautiful and testable command-line interfaces.

    I use Cleo for python, same thing, has the ability to generate completion scripts. I also find the API far saner than argparse or click. I don't really use the docstring-parser, I prefer using the Command api for finer control, but it's really cool to just write the help docs and automagically get options.

    https://github.com/sdispater/cleo

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts