dev-tools

Command-Line Interface (CLI)

A Command-Line Interface (CLI) is a text-based way of interacting with a program by typing commands into a terminal, rather than clicking through a graphical interface. Developers favor CLIs because they're fast (no mouse movement, no waiting for a UI to render), scriptable (any sequence of commands can be saved as a shell script and re-run identically), and composable (Unix-style tools are designed to pipe output from one command into the input of the next). Familiar examples: `git`, `npm`, `docker`, `kubectl`, `aws`, and Claude Code itself, which is a CLI-based AI coding agent. Why it matters for AI/SaaS builders: nearly every piece of developer infrastructure — cloud providers, CI/CD systems, database tools, deployment platforms — ships a CLI as its most powerful and automatable interface, often with capabilities the web dashboard doesn't expose. CLIs are also what makes automation possible: a deploy script, a CI pipeline, or an AI coding agent all fundamentally work by running CLI commands and parsing their output. How it works: a CLI tool parses arguments and flags from the command line (`docker run -p 8080:80 -d nginx`), performs an action, and typically communicates results via stdout (normal output), stderr (errors), and an exit code (0 for success, non-zero for failure) — a convention that lets CLIs be chained together and scripted reliably, since a script can check `$?` after any command to know if it succeeded. Many modern CLIs also support a `--json` output flag specifically so their output can be parsed programmatically by other tools (including AI agents). Worked example: a developer wants to find and kill a process hogging port 3000. They run `lsof -i :3000` to list what's using the port, see a Node process with PID 41213, then run `kill -9 41213` to terminate it — three keystrokes' worth of commands replacing several minutes of clicking through Activity Monitor. In a CI pipeline, the equivalent automation looks like: `npm ci && npm run build && npm test -- --ci --json > results.json`, a single scripted line that installs dependencies, builds, and runs tests with machine-readable output, all without a human touching a keyboard once the pipeline is triggered. The same principle scales from a single developer's terminal all the way up to fleets of AI coding agents, which fundamentally operate by running CLI commands, reading their exit codes and output, and deciding what to do next — the CLI is, in a very real sense, the "hands" an agent uses to interact with a real system.

Related terms

More Dev Tools terms