Mastering AI agents
Set Up Your Computer for AI Coding from Zero: Terminal, Git, GitHub, Node.js
Before an AI coding tool can build a website for you, your computer needs a terminal, Git, a GitHub account and Node.js. Here are the exact install and check commands for macOS and Windows, plus the spots where beginners get stuck.
Kelvin Wang · · 9 min read
The terminal is the text window where you type commands, and it’s already built in. Git records every change so you can roll back. GitHub is where your code lives online, and where hosting platforms pull it from. Node.js is the runtime that tools like Astro and npm need. On a Mac that means Terminal plus Apple’s command line tools or Homebrew; on Windows it means PowerShell plus the Git for Windows and Node.js installers. When git --version, gh --version, node -v and npm -v all print a version number, you’re ready to let an AI write code for you.
- Current Node.js LTS release
- v26.13.0
- Node.js downloads
- Latest Git release
- 2.56.0
- git-scm.com
- Public and private repos on GitHub Free
- Unlimited
- GitHub pricing
What each tool is for
| Tool | What it does | macOS | Windows |
|---|---|---|---|
| Terminal | Where you type commands. AI coding tools run here too | Built-in Terminal app | Built-in PowerShell or Windows Terminal |
| Git | Records every change; lets you go back to an earlier version | Xcode Command Line Tools or Homebrew | Git for Windows installer |
| GitHub | Stores your code online; hosting platforms deploy from it | Sign up on the web, then GitHub CLI | Sign up on the web, then GitHub CLI |
| Node.js | Runs Astro, npm and most website tooling | Installer from nodejs.org | Installer from nodejs.org or winget |
Versions checked 2026-11-07: Node.js [9], Git for Windows [4].
Here’s how they fit together. You (or the AI) type commands in the terminal, Node.js runs the site, Git records what changed, and you push the result to GitHub. The hosting platform sees a new version on GitHub and redeploys the site. My own personal website works exactly like that: the code is on GitHub, and every push to the main branch makes Cloudflare Workers Builds rebuild and deploy it.
Step 1: Open a terminal
A terminal is a window you can only type into. You enter one command, press Enter, and the computer prints the result.
- macOS: press
Cmd + Spaceto open Spotlight, typeTerminal, and press Enter. - Windows: press
Win + Xand choose Windows PowerShell or Terminal.
Windows has two command lines, PowerShell and CMD. Every Windows command here is meant for PowerShell. Look at the start of each line to tell them apart: PowerShell shows PS C:\Users\YourName>, CMD shows the same thing without PS.
Try a few commands. These work in the macOS Terminal and in PowerShell:
pwd # show which folder you're in
ls # list the files in this folder
mkdir sites # create a folder called sites
cd sites # move into it
cd .. # go back up one level
To paste, use Cmd + V on a Mac, and Ctrl + V or a right-click in PowerShell. You can’t click to move the cursor in a terminal; use the arrow keys.
Step 2: Install Git
macOS
In Terminal, run:
git --version
If Git isn’t installed yet, macOS pops up a dialog offering to install the command line developer tools. Click Install and wait for it to finish. You can also trigger the same install directly:
xcode-select --install
If you already use Homebrew 13, brew install git gets you a newer version than Apple’s.
Windows
Download Git for Windows from git-scm.com/install/windows 4. On 2026-11-07 the current release was 2.56.0(4), published October 26. The installer has a lot of screens; click Next through all of them to accept the defaults, and keep the recommended option on the “Adjusting your PATH environment” screen.
Or install it from PowerShell:
winget install --id Git.Git -e --source winget
The Git website notes that the Git.Git winget package isn’t maintained by the Git for Windows project and can lag behind the official release. Either way, close PowerShell and open a new window afterwards so it can find Git.
Git for Windows also installs Git Bash. Claude Code on Windows uses Git Bash for shell commands when it can find it and falls back to PowerShell when it can’t; both work 1.
Tell Git who you are
Every commit (a saved version) records its author. Set this once:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global init.defaultBranch main
The last line names the default branch of new repos main, matching GitHub. Your email appears on every commit you push. If you’d rather not expose a personal address, GitHub gives you a noreply address under Settings → Emails; use that one.
Step 3: Create a GitHub account and your first repo
Sign up
Create an account at github.com 14. The free plan covers a personal website comfortably: unlimited public and private repositories, 2,000 GitHub Actions minutes a month (public repos don’t use up minutes), and 500MB of Packages storage (GitHub pricing 5, checked 2026-11-07). Then turn on two-factor authentication under Settings → Password and authentication. Your code and every hosting platform you connect later depend on this account.
Install GitHub CLI and log in
GitHub CLI (the gh command) lets you log in to GitHub and create repos from the terminal, without managing SSH keys or tokens yourself.
macOS, if you have Homebrew:
brew install gh
Without Homebrew, download the installer whose name ends in macOS_universal.pkg from the GitHub CLI releases page 15 and double-click it.
Windows PowerShell:
winget install --id GitHub.cli --source winget
Then log in:
gh auth login
Pick GitHub.com, then HTTPS, answer Yes when it asks whether to authenticate Git with your GitHub credentials, and choose to log in with a web browser. The terminal shows a one-time code; paste it into the page that opens and you’re done. The token is stored in your system’s credential store 6.
Create your first repo
Go to the folder where you keep projects (for example the sites folder from earlier) and run:
gh repo create my-site --private --add-readme --clone
cd my-site
The first line creates a private repo called my-site on GitHub with a README, then downloads (clones) it into a my-site folder on your computer. Open https://github.com/your-username/my-site; if you can see the README, it worked. If you’d rather skip the CLI, create the repo at github.com/new 16, tick Add a README, and download it with git clone and the URL the page shows.
From then on, saving a version and sending it to GitHub is always these three commands:
git add .
git commit -m "Describe what changed"
git push
git add . stages every changed file in the folder, git commit saves them as one version, and git push uploads it to GitHub. An AI coding tool can run these for you, but you should know what it’s doing when it does.
Step 4: Install Node.js
Node.js runs JavaScript tools. Astro, npm and Cloudflare’s deploy tool wrangler all need it. Pick the LTS (long-term support) release: on 2026-11-07 the Node.js download page offered v26.13.0 LTS by default 9.
- macOS: download the macOS installer (.pkg) from nodejs.org/en/download 9 and run it.
- Windows: download the Windows installer (.msi) from the same page and accept the defaults, or run
winget install -e --id OpenJS.NodeJS.LTSin PowerShell.
Open a new terminal window and check:
node -v
npm -v
Two version numbers mean you’re set.
Why LTS: website tools set a minimum version. Astro’s docs require Node.js v22.23.4 or higher and don’t support odd-numbered releases such as v23 10. My site’s package.json declares "engines": { "node": ">=22.12.0" }, so npm warns when the version is too old. An LTS release usually satisfies most tools at once.
Step 5: Check all four
Open a new terminal window and run:
git --version
gh --version
node -v
npm -v
If all four print a version number, your computer is ready. If any of them says command not found (macOS) or “is not recognized” (Windows), the usual cause is a terminal window opened before the install: your PATH (the list of folders where the system looks for commands) only updates in new windows. If a fresh window still can’t find it, run that tool’s installer again.
Next: install an AI coding tool
With the basics in place, you can install an AI coding tool that reads files, writes code and runs commands inside your project folder. The two most common are OpenAI’s Codex and Anthropic’s Claude Code, and they work the same way: open the terminal in your project folder and type what you want done. Both need a paid plan in the terminal. Codex signs in with a ChatGPT account, and the CLI comes with Plus and above 12; Claude Code needs a Claude Pro, Max, Ultra, Team or Enterprise plan, or a Claude Console account 1. If you already pay for one of them, start there.
Each installs with one line. Pick your tool:
Codex
# macOS, Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh# Windows PowerShell
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"Open a new window, go into your my-site folder and run codex; on the first run, choose “Sign in with ChatGPT” 11.
Claude Code
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash# Windows PowerShell
irm https://claude.ai/install.ps1 | iexOpen a new window, go into your my-site folder and run claude; the first run logs you in through the browser 1.
Neither tool needs Node.js to run, but when they build a website for you they use Node.js, Git and GitHub, which is why you installed them first.
Go deeper Claude Code vs Codex vs Grok Build in 2026: Which AI Coding Agent Fits You Each tool judged on the same points: who it suits, how you use it, price and limits. No winner picked.Where beginners get stuck
- “Command not found” right after installing. Close the terminal and open a new one. PATH changes only reach new windows.
- A PowerShell command pasted into CMD. Check for
PSat the start of the line. Commands likeirmonly work in PowerShell. - Git asks who you are. “Please tell me who you are” on your first commit means you skipped the three
git configlines in Step 2. - A password prompt on push. GitHub no longer accepts account passwords for Git pushes. After
gh auth loginit stops asking. - A key got committed. Once it’s on GitHub, treat it as leaked: revoke it at the service and create a new one, then fix
.gitignore. Deleting the file isn’t enough; the history still has it. - Node.js is too old. If npm prints
EBADENGINEor Astro won’t start, runnode -vand reinstall the LTS release if it’s below what the tool needs.
Sources
- 1. Advanced setup (Claude Code)
- 2. Terminal guide for new users
- 3. Install Git on macOS
- 4. Install Git on Windows
- 5. GitHub Pricing
- 6. gh auth login
- 7. Installing gh on macOS
- 8. Installing gh on Windows
- 9. Download Node.js
- 10. Install Astro
- 11. Codex CLI
- 12. Codex pricing
- 13. Homebrew
- 14. GitHub
- 15. GitHub CLI releases
- 16. Create a new repository
Kelvin Wang
Electrical engineer building tools with AI agents, sharing hands-on notes on engineering and investing.
More about me