{"repo":"bitwalker/artificery","free":true,"listed":false,"github":"https://github.com/bitwalker/artificery","clone":"git clone https://github.com/bitwalker/artificery.git","description":"A toolkit for creating terminal user interfaces in Elixir","language":"Elixir","stars":132,"topics":["elixir-lang","command-line"],"license":"Apache-2.0","category":"cli-tools","readme_excerpt":"Artificery Artificery is a toolkit for generating command line applications. It handles argument parsing, validation/transformation, generating help, and provides an easy way to define commands, their arguments, and options. Installation Just add Artificery to your deps: Then run mix deps.get and you are ready to get started! Defining a CLI Let's assume you have an application named :myapp , let's define a module, MyCliModule which will be the entry point for the command line interface: The above will setup the Artificery internals for your CLI, namely it defines an entry point for the command line, argument parsing, and imports the macros for defining commands, options, and arguments. Commands Let's add a simple \"hello\" command, which will greet the caller: We've introduced two of the macros Aritificery imports: command , for defining top-level and nested commands; and argument for defining positional arguments for the current command. Note : argument can only be used inside of command , as it applies to the current command being defined, and has no meaning globally. This command could be invoked (via escript) like so: ./myapp hello bitwalker . Right now this will print an error stating that the command is defined, but no matching implementation was exported. We define that like so: Note : Command handlers are expected to have an arity of 2, where the first argument is a list of unhandled arguments/options passed on the command line, and the second is a map containing all of","default_branch":null,"files":null,"tree":[],"storefront":"/r/bitwalker","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/bitwalker/artificery/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}