Building Command Line Tools with lambdaisland/CLI/Babashka - Arne Brasseur

ClojureTV Video 1 months ago

Descrizione

As developers we spend time in the terminal every day. It's a familiar and powerful environment, with its own idioms and conventions. With babashka we gained a Clojure runtime with fast startup time, making it feasible to build small command line utilities in Clojure, for ourselves, our colleagues, or others. But these kind of CLI scripts often feel a little alien. They break the principle of least surprise, by not or only haphazardly following established conventions for command line argument behavior, help text, handling of subcommands, etc. We do already have libraries like tools.cli, but they still require significant boilerplate. Lambdaisland/cli is a new take on command line argument handling. It sets itself apart by very low boilerplate and intuitive syntax, leveraging var metadata for concise definition of subcommands, and by adopting a more process driven model, rather than a strict parsing/handling separation. We'll walk you through some examples from trivial to complex, and talk about how this can benefit you as a developer, as well as your team.