A command-line tool is a program operated through commands and arguments in a terminal. It accepts structured input, performs a focused task, and writes results to standard output or another file. section 3.0 section 6.0
Small command-line tools turn practical workflows into executable programs:
- Read a JSON file of book collections, find books shared by readers, and recommend additional books. section 3.0
- Accept currencies and an amount, call an external HTTP service, and print a safely rounded conversion. section 6.0
- Read a maze image, explore branches concurrently, and write an image highlighting the path to the treasure. section 9.0
Currency conversion command
A usable interface can take flags and a positional amount: change -from EUR -to USD 413.9. A Go implementation can start with a module and a main package, then separate input parsing, conversion logic, external requests, and output. section 6.0 section 6.1
