build with a coding agent · 8 of 8
Terminal cheatsheet
The dozen commands you'll actually use. Your agent runs most of them for you, but it helps to recognise them when it asks.
Getting around
| Command | What it does |
|---|---|
pwd |
Show which folder I'm in |
ls |
List what's in this folder |
cd my-project |
Go into a folder |
cd .. |
Go up one folder |
mkdir new-folder |
Make a folder |
code . |
Open this folder in VS Code (if installed) |
Running a web project
| Command | What it does |
|---|---|
npm install |
Download the packages the project needs (after cloning, or when it says something's missing) |
npm run dev (or npm start) |
Run it locally. It'll print a link like http://localhost:3000 |
npm run build |
Build the version that goes live |
Ctrl + C |
Stop whatever's running |
Git
| Command | What it does |
|---|---|
git status |
What's changed since the last commit? |
git diff |
Show exactly what changed |
git add . then git commit -m "message" |
Save a commit |
git log --oneline |
List recent commits |
git push |
Send commits to GitHub |
git pull |
Get the latest from GitHub |
git switch -c new-branch |
Start a new branch |
git restore . |
Throw away uncommitted changes (careful) |
Reading errors
- The useful line is usually near the bottom, or starts with
Error:. - "command not found" means it isn't installed, or isn't on your PATH.
- "EADDRINUSE" or "port already in use" means the app is already running in another window.
- "permission denied" means don't reach for
sudostraight away. Ask your agent why first.
Free to use, adapt and share, including for commercial projects. Ticks are remembered on this device only.