CLI tools are back


CLI tools are back and it is glorious

Terminal and text based input and output is front and center now with LLMs and it is allowing a new generation of users to discover battle-tested command line tools.

What makes CLIs so good?

The output from one can be used as the input for the next. So they can often be chained together to create complex workflows.

One reason this never fully took off outside of certain niches is it requires vast experience in each tool and a fair amount of creativity as to how to chain them together. Then GUIs took over and made computing more accessible.

The future is text-based

The text-based interface that powers CLIs is the same interface LLMs excel at. This alignment means:

  • Existing mature tools (50 years of battle-tested CLIs) become immediately accessible
  • New tools can be built faster since text I/O is simpler than GUIs
  • Automation becomes trivial when LLMs can orchestrate any CLI combination

How CLIs aid automation

CLIs should be used to perform 3 things:

  • Take standard in (stdin) which is a terminal input on the machine
  • Take a file as an input - which can be converted to stdin
  • Output to standard out (stdout), standard error (stderr)

The output from one CLI can be used as the input to another This is the core principle that drives the automation capability of CLI tools.

CLI Architecture

Separation of concerns and inherent ability to chain CLI inputs and outputs allows us to build small, specialist CLI tools that do one thing well and then compose them together with other CLI tools.

Maturity

CLI tools invented in the 1970s are still used today. That’s 50 years of development, bug fixes, testing and reliability. All the things your organization needs.

Chaining CLIs

Chaining CLIs is a skill. What might take 50 lines of Python code to ingest, clean and output data can often be achieved in few - albeit I think less readable -often lines of Bash using a combination of CLI tools each of which specialises in one component:

  • One CLI specializes in finding files
  • One for reading data in
  • One for selecting or filtering data
  • One for text search and replace to cleanse
  • >> command writes the output to a new file

This isn’t anything new it’s just aiding the rediscovery of CLI tiles for the next generation

Is it cheating? Yes and No. You still have to learn the tools but chaining them creatively is incredibly powerful. Your organisation can benefit as many of the use-cases currently involve someone writing a python script.

Try out CLIs yourself

Next time you reach for a GUI tool, check if there’s a CLI equivalent. Start with something simple:

  • Use ffmpeg to compress a video instead of Handbrake
  • Try the Stripe CLI for testing webhooks locally
  • Explore ImageMagick for batch image processing
  • Render documents and slides with Quarto instead of PowerPoint
  • Process JSON with jq instead of writing a Python script
  • Search codebases with ripgrep and find files with fd
  • Manage GitHub from the terminal with gh
  • Run data pipelines with dbt-core