What a command line is, the 10 commands you'll actually use, and how to install a CLI tool without breaking anything
Written by
Alin Geevarghese Anil
Published on
October 8, 2026
A CLI (command-line interface) is just a way to tell your computer what to do by typing instead of clicking. Lots of dev tools only come as CLIs, so at some point a setup guide will say "open your terminal". This is for that moment
Cmd + Space, type Terminal, hit EnterYou'll see a line ending in $ or >. That's the prompt. It's waiting for you
Every command is the same pattern: the program, then options (called flags), then what you want it to act on
ls -la Documentsls is the program (list files), -la are flags (show everything, as a list), and Documents is the folder. Most tools tell you their flags if you add --help
pwd: where am I right nowls: what's in this folder (dir on Windows)cd folder: go into a folder. cd .. goes back upmkdir name: make a foldercp a b: copy a filemv a b: move or rename a filecat file: print a fileclear: clean up the screenCtrl + C: stop whatever's runningOne to be careful with: rm deletes files with no trash bin and no undo. Double-check the path before you hit Enter
Most tools install with a package manager, which is an app store for the terminal. Which one depends on the tool's docs:
# Mac
brew install gh
# anything built with Node.js
npm install --global vercel
# check it worked
gh --versionIf the version prints, you're done. If you get "command not found", close the terminal and open a new one, then try again
Tools often need a key. Set it as an environment variable instead of pasting it into commands, where it ends up saved in your history:
export MY_API_KEY="paste-it-here"That lasts until you close the terminal. For a project, keys usually go in a .env file that never gets committed to git
--help to the command