Learning Area
Command Line Basics
The command line is a text-based way to talk to your computer. Instead of clicking through folders and menus, you type short commands that open files, move between folders, inspect a project, install developer tools, or prepare a workspace for coding agents.
This page starts simple: how to open a terminal, how to read the prompt, how to run safe commands, and how to install the basic packages most modern development workflows expect.
Open a Terminal on Mac
On a Mac, the built-in app is called Terminal. You can open it from Spotlight or from the Applications folder.
- Press Command + Space.
- Type Terminal.
- Press Return.
pwd
ls
date
These commands are safe. They print your current folder, list what is inside it, and show the current date and time.
Open a Terminal on Windows
On Windows, use Windows Terminal or PowerShell. Both let you run basic commands and inspect folders from a text prompt.
- Press the Windows key.
- Type Terminal or PowerShell.
- Press Enter.
pwd
dir
Get-Date
Windows uses some different command names. dir lists files and folders. Get-Date prints the current date and time.
Understand the Prompt
The prompt is the line where the terminal waits for your next command. It usually shows your username, computer name, current folder, or a symbol like % or $.
john@MacBook project-folder %
PS C:\Users\John\project-folder>
You type after the prompt, then press Enter. The computer runs the command and prints the result below it.
Move Between Folders
The command line always has a current folder. To move into another folder, use cd, then the folder name.
cd Documents
cd Projects
cd ..
cd .. moves one level up. If you ever feel lost, run pwd to print where you are.
Read Before You Run
A good terminal habit is simple: inspect first, run second. Start with commands that only show information, then move to commands that create, edit, or delete files once you understand the workspace.
pwd
ls
whoami
Avoid copying random commands from the internet if they include delete, remove, format, sudo, administrator prompts, or long scripts you do not understand yet.
Install the Basic Mac Toolkit
Most Mac developer workflows start with Apple's command line developer tools, then add Homebrew so software can be installed from the terminal.
xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew --version
After Homebrew is installed, you can add common tools one at a time.
brew install git
brew install node
brew install python
Run one command, read the output, and let it finish before running the next. If the terminal asks for your password, it may not show characters while you type. That is normal on macOS.
Install the Basic Windows Toolkit
On Windows, the usual path is Windows Terminal, PowerShell, winget, Git for Windows, Node.js, and Python. Many modern Windows machines already include winget.
winget --version
winget install --id Git.Git -e
winget install --id OpenJS.NodeJS.LTS -e
winget install --id Python.Python.3.12 -e
After installing, close and reopen the terminal, then check the tools.
git --version
node --version
python --version
If a command says it is not recognized, restart the terminal first. If it still fails, the tool may not be on your PATH yet.
Check Your Setup
Before installing AI coding agents or project tools, confirm that your terminal can see the basics.
git --version
node --version
python3 --version
These checks do not change your files. They only ask each tool to identify itself.
Why This Matters for Coding Agents
Tools like Codex, Claude Code, OpenClaude, Hermes, and other coding agents work better when the computer already has a clean terminal, Git, a package manager, and the language runtimes a project expects.
cd project-folder
git status
npm install
npm test
The exact commands depend on the project. The durable habit is the same: enter the project folder, inspect state, install dependencies, run the test or start command, then read the result before changing anything.