Argbash – Bash Argument Parsing Code Generator

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
  • docopts

    Shell interpreter for docopt, the command-line interface description language.

    Huh, it uses M4 to build its DSL, how quaint.

    I wish there were more projects on the other side of the spectrum: take the script's self-reported usage string, à la docopt [0], and derive argument-parsing code from that. After all, we have GPT-4 now.

    [0] https://github.com/docopt/docopts

  • bash-boilerplate

    A collection of Bash scripts for creating safe and useful command line programs.

    I'm a fan of BashBoilerPlate (Bash3BoilerPlate) - https://github.com/xwmx/bash-boilerplate

    It uses a similar style of deriving the arguments from the usage declaration, but it also includes some useful logging functions and is all in one script. There's some more info available on their style choices here: https://bash3boilerplate.sh/

  • 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.

  • bun

    Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

    TypeScript is now tenable for bash scripts with the fast-starting Bun runtime https://bun.sh/.

    Before Bun, Node+V8 was just too slow to start.

    IMHO all scripts should be written in TypeScript...you get typechecking and all the rest of the editing experience. Plus things like Wallaby.js for live coding/testing.

  • sh

    Python process launching

    100% agree. There are some libraries like https://amoffat.github.io/sh/ that aim to make that easier, but they always have some quirks that, funnily enough, are often the corner cases you were hitting in your complicated Bash script in the first place.

  • bashly

    Bash command line framework and CLI generator

  • oil

    Oils is our upgrade path from bash to a better language and runtime. It's also for Python and JavaScript users who avoid shell!

    Evolving bash, removing footguns, and providing a path forward is exactly what https://www.oilshell.org is about :) (a project that's nearly 7 years old)

    The new language is here: https://www.oilshell.org/release/latest/doc/oil-language-tou...

    I've gotten some great feedback on it, but it's not stable yet. You can still influence the direction of the language!

    Latest release gives the status of the project: https://www.oilshell.org/blog/2023/03/release-0.14.2.html

    As an anecdote, one thing that was extremely difficult was fixing all the footguns around set -e / errexit in bash.

    However I believe we have done it: https://www.oilshell.org/release/0.14.2/doc/error-handling.h...

    I got good feedback about this, and you can try it right now if you want to verify that the footguns are indeed fixed!

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