Company
Date Published
Author
Matthew Gilliard
Word count
1546
Language
English
Hacker News points
None

Summary

This article explains how to build a CLI app in Java using jbang and picocli. Jbang is a tool that allows developers to create self-executing source files, while picocli is a library for creating CLI apps in Java. The example app sends an SMS using Twilio's Messaging API, with the user able to specify the recipient's phone number, their own phone number, and the message body as command-line arguments. The app uses picocli's features for handling command-line options and parameters, and includes error checking to ensure that a message is provided if it is not given at the end of the command. With jbang and picocli, developers can create short-lived CLI apps in Java that are easy to use and deploy.