Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

Start from zero, part 4 of 6. About 5 minutes.

The terminal, the part people fear

The terminal is a window where you type instructions instead of clicking. You'll use about four of them. Here's what they do and why they can't hurt you.

Almost everyone is nervous about this one. By the end of this page, you won’t be.

What it is

The terminal is a window where you type an instruction and press Enter. The computer does it and shows you what happened.

That’s the whole thing. It’s not hacking. It’s not for experts. It’s just typing instead of clicking.

Why use it? Because some tools don’t have buttons. Astro is one of them. You tell it what to do by typing a short line.

It can’t hurt you

Two facts to calm your nerves:

  • If you type something wrong, the computer says “command not found” and nothing happens.
  • Nothing in this course deletes anything. The commands make folders, download tools, and start your site. That’s all.

Where to find it

VS Code, the editor from part 3, has a terminal built in. Open the Terminal menu at the top and choose New Terminal. A panel opens at the bottom. That’s it.

The only commands you’ll need

You’ll type a handful of lines over and over. Here they are, so none of them surprise you.

You type It means
node -v “What version of Node.js is installed?” It answers with a number.
cd my-site “Go into the folder called my-site.” Like double-clicking a folder.
npm install “Download the tools this project needs.”
npm run dev “Start showing me my site.”
npm run build “Make the finished copy of my site.”

npm is a tool that comes with Node.js. It fetches and runs things for you.

How to stop something

When your site is running, the terminal is busy. To stop it, hold Ctrl and press C. On a Mac it’s also Ctrl, not Cmd. That’s the one shortcut worth remembering.

Reading what it says

The terminal talks back. Usually it’s good news: “ready”, “built”, or an address like http://localhost:4321. Sometimes it’s an error, in red. Errors name the file and line that went wrong. That’s helpful, not scary. Our errors guide shows the common ones.

Try one now, for free

Open a terminal and type:

echo hello

Press Enter. The computer says hello back. You just used the terminal.

Try "blog", "deploy" or "EmDash".