// Learn

What is a CLI?

A CLI (Command Line Interface) lets you control your computer by typing text commands instead of clicking buttons.

The short version

Before there were windows, icons, and mice, there was the command line. You type a command, press enter, and the computer does something. That's a CLI.

It might sound old-fashioned, but CLIs are everywhere in modern tech. Most developer tools, cloud platforms, and AI tools are CLI-first. If you've ever opened Terminal on a Mac or Command Prompt on Windows, you've seen one.

How it works

A CLI gives you a prompt (usually a blinking cursor) and waits for instructions. Commands follow a pattern:

command [options] [arguments]

For example:

  • ls lists files in the current directory
  • ls -la lists files with details and hidden files
  • cd projects moves into the "projects" folder
  • npm install installs a project's dependencies

The -la part is a flag. It modifies what the command does. Think of it like adding "with extra detail" to your request.

Commands can be chained too. The output of one becomes the input of another:

cat log.txt | grep "error" | wc -l

That reads a file, filters for lines containing "error", and counts them. Three tools, one pipeline.

Why it matters

CLIs are faster than GUIs for repetitive tasks. They're scriptable, so you can save a sequence of commands and run them again. And many tools (Git, Docker, Claude Code, AWS CLI) are designed CLI-first, with graphical interfaces added later.

You don't need to memorise every command. You need to understand the pattern: command, options, arguments. The rest you look up.

=++==+==++=