Command line for beginners: the 5 commands that get AI tools running
Most tutorials treat the command line like a career choice. It is not. You need five commands to install and run Claude Code or any AI coding tool. Here is what they are, why they are safe, and what happens once the AI takes over the typing.
The command line is a text window where you type short instructions. To install and run Claude Code or most AI tools, you need exactly five commands: navigate to a folder, install the software, start it, check what is in a folder, and stop it. The AI handles every command after that.
The five commands: a reference table
Every AI tool setup follows the same pattern. Bookmark this table and come back to it during setup.
| Command | What it does | When you use it |
|---|---|---|
cd folder-name | Go into a folder | Before starting any session |
npm install -g @anthropic-ai/claude-code | Add Claude Code to your computer | Once, during setup |
claude | Start the Claude Code agent | Every time you open a session |
ls (Mac) / dir (Windows) | List what is in the current folder | When you need to check where you are |
Ctrl+C | Stop the current program | To end a session or interrupt a stuck command |
That is the complete list. If you can type these five things in the right order, you can get Claude Code running. The rest of this guide explains each one in enough detail to use it confidently and diagnose the three errors that come up most often.
What the command line actually is
Your computer has two layers. The visible one is the graphical interface: windows, folders, click targets, menus. The layer underneath accepts direct text instructions without the graphics in between.
Every time you double-click a folder, move a file, or click an install button, something is sending a text instruction to that layer underneath. The command line skips the graphical middleman and sends the instruction yourself. The computer does not care which method you use. Both do the same job.
The command line is not a programming language. Typing cd Documents is not writing code. It is typing an instruction. The distinction matters because most beginner anxiety about terminals comes from conflating them with programming. Learning to write code takes months. Learning to type five instructions takes about ten minutes.
On Mac, the command line is an app called Terminal (search for it in Spotlight). On Windows it is called Command Prompt or PowerShell (search in the Start menu). On Linux, you already know where it is. All three work the same way for this guide.
Command 1: cd (navigate into a folder)
cd stands for "change directory." In command-line language, "directory" means folder. When you open the terminal, you land in your home folder, usually named after your username. To run Claude Code, you first need to navigate to the folder where you want to work.
cd Documents
cd my-project-folder Each cd command moves you one level deeper into the folder structure. If you are not sure where you are, type pwd on Mac (print working directory) or cd on Windows with no folder name, and the terminal prints your current location as a path.
There is a faster method. Open your folder in Finder (Mac) or Explorer (Windows), then drag it directly into the terminal window. The full path appears automatically. Type cd first, leave a space, then drag the folder in.
To go back up one level, type cd .. (two dots). Think of it as clicking the back button in a file browser. You do not need any other cd variants for AI tool setup.
Command 2: npm install (add software)
npm is a package manager. A package manager is a tool that downloads and installs software for you. When you run an npm install command, npm fetches the software from the internet and puts it where your computer can find it.
You need Node.js installed first because npm comes with it. Node.js is a software runtime that Claude Code runs on top of. Download the LTS version from nodejs.org and run the installer. It takes about two minutes and has no technical decisions to make. After the installer finishes, close the terminal and open it again.
To install Claude Code, run this command once:
npm install -g @anthropic-ai/claude-code The -g flag means "global." It installs Claude Code so you can run it from any folder on your computer, not just the current one. This installation happens exactly once. After that, claude is available everywhere.
npm prints a few lines while it downloads and installs. If the last line says "added X packages," the installation worked. If it says "permission denied," type sudo npm install -g @anthropic-ai/claude-code on Mac or Linux and enter your computer password when prompted. The cursor will not move while you type the password. That is normal.
Command 3: claude (start the agent)
After installation, starting Claude Code is one word:
claude The first time you run this, Claude Code asks for your Anthropic API key. Get one at console.anthropic.com. Sign up, add a small amount of credit (the first month of typical small-business usage costs $5 to $20), and copy the key. When Claude Code prompts for it, paste and press Enter. You do this once.
After the key is set, typing claude opens an interactive session. You type instructions in plain English and the agent carries them out. From here you are no longer using the command line in the traditional sense. You are talking to an AI agent that reads your instructions, completes each step, and hands you the results. The terminal window is just where that conversation happens.
For recurring tasks, Claude Code also runs in headless mode: claude --headless /skill-name. The agent runs a pre-written instruction file from start to finish without interaction and exits when done. SoloStack's weekly blog automation runs this way. Nobody presses a button. The agent picks a keyword, writes the post, registers it across the site, and pushes it live on a schedule.
Command 4: ls or dir (see what is in a folder)
When you are not sure what files exist in your current folder, type ls on Mac and Linux, or dir on Windows. The terminal prints a list of everything in the current folder.
ls # Mac/Linux: list files
dir # Windows: list files This is a sanity-check command. You use it when you want to confirm a file was created after running a skill, check for a folder before cd-ing into it, or see what is in a directory when you are not sure. Once Claude Code is running, you can also ask it "what files are in this folder?" and it will tell you without you typing ls. The agent reads the file system as part of its job.
Command 5: Ctrl+C (stop)
To stop whatever is running, hold Ctrl and press C. This works on Mac, Windows, and Linux. It interrupts the current process and returns you to the command prompt.
Use it to end a Claude Code session when you are done, stop a command that is taking too long, or interrupt something that looks stuck. Ctrl+C does not delete anything. It is a clean interrupt, not a force-quit. If the program does not stop immediately, press Ctrl+C twice.
On Mac, Cmd+C copies text to the clipboard. It does not stop programs. The stop command is Ctrl+C specifically, even on a Mac where most shortcuts use Cmd.
What you do not need to learn
Most command-line guides cover grep, sed, awk, find, chmod, curl, pipes, and dozens of other commands. None of those come up in the SoloStack workflow, and you do not need them to use Claude Code. Here is where the boundary is:
- cd, npm install, claude, ls/dir, Ctrl+C are yours to type. These five get the agent installed and running.
- Everything else is the agent's job. When Claude Code needs to fetch data, move files, call an API, read a log, or run a build script, it types those commands itself. You see what it did and review the output.
The command line has a reputation for depth because there is a lot of depth in it, for people who need it. You are not one of those people, at least not for getting AI tools running. You need the entry ramp. After five commands, the AI is driving.
This is also true inside Claude Code sessions. If a skill requires installing a dependency, running a build, or making an API call, Claude Code generates and runs those commands. You see a summary of what happened. The five commands above are the five times you are the one doing the typing. After that, the handoff is complete.
The first ten minutes: a walkthrough
Here is what first-time setup looks like, in order, from a cold start.
Open the terminal and install Node.js
Search for Terminal on Mac or Command Prompt on Windows and open it. In a browser, go to nodejs.org, download the LTS installer, and run it. The installer takes about two minutes and has no technical options to configure. Close the terminal and reopen it after the installer finishes.
Navigate to your project folder
Use cd to move to the folder where you want to work. If you do not have one, create a folder on your desktop called "my-ai-project." Then type cd in the terminal (with a space at the end), drag the folder into the terminal window, and press Enter. The path fills in automatically.
Install Claude Code and set your API key
Run npm install -g @anthropic-ai/claude-code. After it finishes, type claude. When it asks for your API key, paste the key from console.anthropic.com and press Enter. Claude Code is now running and waiting for your first instruction.
Give it a first task
Type a plain-English instruction: "Write me five subject line options for a follow-up email to a small business owner who attended a free webinar." Claude Code produces them and prints the result. You have now used the command line for the last time this session. The rest is a conversation.
When something looks wrong
Three errors come up for nearly every first-time setup. Here is what each one means and what to type.
- npm: command not found or 'npm' is not recognized. Node.js is not installed, or the terminal was not restarted after installation. Close the terminal completely, reopen it, and try again. If it still fails, re-run the Node.js installer from nodejs.org and restart the terminal before trying again.
- EACCES: permission denied. On Mac, some systems block global software installs by default. Type
sudo npm install -g @anthropic-ai/claude-codeinstead. Enter your computer login password when prompted. It will not display as you type. That is normal behaviour. - Error: invalid API key. The key was pasted with a space or copy error, or the account has no credit. Log in to console.anthropic.com, copy the key again, and run
claude config set apiKey YOUR-KEY-HEREwith the corrected value. Add $5 in credit if the account shows a zero balance.
If you hit something not on this list, copy the full error text and paste it into Claude.ai with a note about what you were trying to do. The AI identifies the cause and tells you the exact command to fix it. This is the fastest path through any setup problem, including ones that do not appear in any guide.
Once Claude Code is running, it types for you
The shift after setup is that you stop typing commands and start reviewing results. When Claude Code runs the SoloStack blog automation, it reads a keyword queue file, writes a 1,500-word article, registers it in the site index, commits the files, and pushes to the live site. All through commands it runs itself. You read the finished post, not the commands that produced it.
This is why "learn the command line" is the wrong frame for someone who wants to use AI tools. The right frame is "get past the command line." Five commands get you there. After that, your job shifts from typing to judging: is this output right? does it match what I asked for? what should I adjust?
That judgment is the skill that compounds. The five commands are a one-time hurdle. Knowing what good output looks like, and how to adjust an instruction when it is off, is what gets better over time and cannot be automated away.
For a deeper look at how Claude Code sessions work and what kinds of tasks it handles, the Claude Code tutorial covers the full setup through your first running automation. The What Is Claude Code? guide explains the agent model if you want the conceptual picture first.
SoloStack can walk you through the command line setup and get Claude Code running for your specific business. We do the first install live, together, in the workshop. Most people complete their first automated task before the session ends.
Common questions
Explore More
Related tools and resources from across SoloStack
Free Website Builder
Build with Astro + AI. Static, fast, SEO-optimized, fully customizable.
Free ToolFree Project Management
Manage tasks in your repo. No Notion, no Asana, no per-seat pricing.
ReplaceReplace ConvertKit
Creator email marketing without the monthly fee. Sequences and landing pages.
ReplaceReplace Webflow
Astro-powered sites. Faster, cheaper, and you own every line of code.
SkillProgrammatic SEO
Generate hundreds of keyword-targeted pages from templates with Claude Code.
SkillWebsite Cloning
Clone any website design system and rebuild with AI builders.
Want to skip the setup and get Claude Code running today?
The SoloStack workshop covers the full setup, the five commands, and your first running automation live. You leave with a working agent handling real tasks from your business.
See the workshop →