It is a text box that runs one thing at a time
The terminal has a reputation it does not deserve. It shows you a prompt, you type a command, it runs, it prints something, and it gives you the prompt back. That is the whole interaction.
The two states matter more than the commands. When you can see the prompt, nothing is running and it is waiting for you. When you cannot, something is running and typing will not help. People spend a surprising amount of time typing into a terminal that is busy.
To stop whatever is running: Ctrl+C. On every platform, including a Mac. Not Cmd+C, which copies.
Six commands and two keys
pwd # which folder am I in
ls # what is in it (dir on Windows CMD)
cd projects/salon # go into a folder
cd .. # go up one
cat package.json # print a file to the screen
clear # clean up the messThe two keys do more than the commands. Tab completes what you are typing: type cd pro and press Tab. Up arrow brings back your previous commands, so you rarely type anything twice.
When you get command not found, it means exactly what it says: the shell looked through its list of places ($PATH) and there was nothing by that name. Either it is not installed, or your terminal was open before you installed it. Open a new terminal first: that fixes it more often than anything else.
The four you will actually run all day
npm install # download what this project needs
npm run dev # start the development server
npm run build # make the production version
npm test # run the tests, if any existnpm run on its own lists everything a project defines. That list lives in the scripts section of package.json, and reading it is the fastest way to learn how an unfamiliar project is meant to be operated.
Reading output, which is the actual skill
A failing command usually prints between 20 and 400 lines. Almost none of it matters.
- The last ten lines contain the failure. Scroll to the bottom first, always.
- Warnings are not errors.
npm installroutinely prints a dozen deprecation warnings and works perfectly. - The first line mentioning your own file path is where to look. Everything mentioning
node_modulesis a library’s internals. - A number after a colon, like
route.ts:23:31, is line 23, character 31.
When you copy an error to paste somewhere, copy the command you ran as well as the error. Half the answer is usually in the command.
Two mistakes everybody makes once
Running npm in the wrong folder. You get an error about no package.json, or npm cheerfully creates one where it does not belong. pwd before you install, every time, until it becomes automatic.
Assuming a stopped server is a broken server. You closed the terminal, so localhost:3000 is dead. Nothing is wrong. The dev server only runs while its terminal is open.
Commands to look at twice
An agent will sometimes propose a command with real consequences. You do not need to memorise shell syntax to spot the dangerous shapes:
rm -rfdeletes a folder and everything under it, with no bin to recover from. Read the path that follows it, character by character, before agreeing.git push --forcecan overwrite work on the server, including somebody else’s.git reset --hardthrows away uncommitted changes permanently.- Anything piping a downloaded script straight into a shell (
curl … | bash) runs code you have not read as you. sudoruns as administrator. Legitimate for installing system packages, and rarely needed for anything inside a project.
If a tool proposes one of these and you do not understand it, the correct move is to ask what exactly will this delete or overwrite and wait for an answer.
Free ways to make it pleasant
The default shell is fine, and you can improve it for nothing. zsh with oh-my-zsh gives you better completion and a prompt that shows your git branch, which quietly prevents a whole category of mistake. fzf searches your command history. tmux keeps a session alive when your terminal closes.
None of it is required. Tab and the up arrow will carry you a long way.
Every lesson here is open. Your progress is recorded once you pass the Building with AI exam.
Check your understanding
A build fails and prints 300 lines. Where should you read first?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Beatriz, your AI tutor
