diff --git a/tutorial/day0/Day0.md b/tutorial/day0/Day0.md new file mode 100644 index 0000000..e0e51bb --- /dev/null +++ b/tutorial/day0/Day0.md @@ -0,0 +1,48 @@ +# Day 0 — Claude Code Setup + +This guide walks you through installing Claude Code on your machine and authenticating so you can start using it. + +## Step 1: Install Claude Code + +Choose your operating system: + +| OS | Guide | +|----|-------| +| Windows | [windows.md](windows.md) | +| Linux | [linux.md](linux.md) | +| macOS | [mac.md](mac.md) | + +Follow the guide for your OS, then come back here for authentication. + +--- + +## Step 2: Verify Installation + +After following your OS-specific guide, confirm everything is working: + +```bash +node --version # Should show v18.x or higher +claude --version # Should show the installed Claude Code version +``` + +--- + +## Step 3: Login + +Claude Code login screen + +Run `claude` in your terminal. On first launch, it will ask you to choose a login method. + +### Method 1: Subscription (Claude Pro / Max) + +- Select **Claude.ai account** +- Browser opens — sign in and authorize +- Return to terminal, you're logged in + +### Method 2: API Key (Pay-as-you-go) + +- Go to [console.anthropic.com](https://console.anthropic.com) → **API Keys** → **Create Key** +- Select **Anthropic API Key** in the prompt +- Paste your key (starts with `sk-ant-`) + +--- \ No newline at end of file diff --git a/tutorial/day0/assets/login.png b/tutorial/day0/assets/login.png new file mode 100644 index 0000000..85d3924 Binary files /dev/null and b/tutorial/day0/assets/login.png differ diff --git a/tutorial/day0/linux.md b/tutorial/day0/linux.md new file mode 100644 index 0000000..9151b79 --- /dev/null +++ b/tutorial/day0/linux.md @@ -0,0 +1,118 @@ +# Linux Setup + +[Back to Day 0](Day0.md) + +## Prerequisites + +You need **Node.js v18 or higher** and **npm**. + +## Step 1: Install Node.js + +### Option A: Via nodejs.org Download Page with fnm (Recommended) + +**fnm** (Fast Node Manager) is officially recommended by Node.js. It's fast, lightweight, and lets you switch Node versions easily if needed later. + +1. Open your browser and go to [nodejs.org/en/download](https://nodejs.org/en/download). + +2. You'll see a row of dropdowns that says: **"Get Node.js® vXX.XX.X (LTS) for __ using __ with __"**. Set the dropdowns as follows: + + | Dropdown | Select | + |----------|--------| + | Version | **vXX.XX.X (LTS)** — keep the default LTS version, don't change it | + | OS | **Linux** | + | Package Manager | **fnm** (under "Recommended (Official)") | + | Package Format | **npm** — keep the default | + +3. The page will show you the exact commands to run. Open your terminal and copy-paste them. They will look something like this: + + ```bash + # Step 1 — Install fnm + curl -fsSL https://fnm.vercel.app/install | bash + + # Step 2 — Restart your terminal or reload your shell profile + source ~/.bashrc # or: source ~/.zshrc (if you use zsh) + + # Step 3 — Install Node.js + fnm install 24 # The page will show the exact version number + ``` + + > The version number may differ from above — always use whatever the website shows. + +4. **Close and reopen your terminal** (or run the `source` command above) so that `fnm`, `node`, and `npm` are available. + +> **Why fnm?** It's in the "Recommended (Official)" category on the Node.js download page. Like nvm, it installs Node into your home directory so you never need `sudo` for npm global installs — but fnm is significantly faster (written in Rust) and works the same across Windows, macOS, and Linux. + +### Option B: Using your distro's package manager + +This is quicker but may install an older version of Node.js. **Check the version after installing** — if it's below v18, use Option A instead. + +**Ubuntu / Debian:** + +```bash +sudo apt update +sudo apt install -y nodejs npm + +# Check the version +node --version # Must be v18 or higher +``` + +**Fedora:** + +```bash +sudo dnf install -y nodejs npm +``` + +**Arch Linux:** + +```bash +sudo pacman -S nodejs npm +``` + +### Option C: NodeSource (Latest LTS via apt, no nvm) + +For Ubuntu/Debian users who want the latest LTS without using nvm: + +```bash +curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - +sudo apt install -y nodejs +``` + +## Step 2: Verify Node.js + +```bash +node --version +npm --version +``` + +Both should print version numbers. `node --version` must show v18.x or higher. + +## Step 3: Install Claude Code + +```bash +npm install -g @anthropic-ai/claude-code +``` + +> **Permission error?** +> - If you used **fnm** or **nvm**: this shouldn't happen. Check that it's active (`which node` should point to a path inside your home directory, not `/usr/...`). +> - If you used a system install: either use `sudo npm install -g @anthropic-ai/claude-code` or fix npm's global directory permissions: +> ```bash +> mkdir -p ~/.npm-global +> npm config set prefix '~/.npm-global' +> echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc +> source ~/.bashrc +> ``` + +## Step 4: Verify Claude Code + +```bash +claude --version +``` + +You should see the Claude Code version printed. Now head back to [Day0.md](Day0.md) for authentication setup. + +--- + +## Notes + +- **WSL (Windows Subsystem for Linux):** This guide works inside WSL too. Just follow these steps from your WSL terminal. +- **PATH issues:** If `claude` is not found after install, ensure npm's global bin is in your PATH. Run `npm config get prefix` — the `bin/` subdirectory of that path needs to be in your PATH. diff --git a/tutorial/day0/mac.md b/tutorial/day0/mac.md new file mode 100644 index 0000000..e46c813 --- /dev/null +++ b/tutorial/day0/mac.md @@ -0,0 +1,32 @@ +# macOS Setup + +[Back to Day 0](Day0.md) + +--- + +**Terminal** +- Open Terminal (press `Cmd + Space`, type "Terminal", hit Enter) + +**Homebrew** +- Check if Homebrew is already installed: + ```bash + brew --version + ``` +- If you get "command not found", install Homebrew first: + ```bash + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + ``` + +**Claude Code** +- ```bash + brew install --cask claude-code + ``` + +**Verify** +- ```bash + claude --version + ``` + +--- + +Now head back to [Day0.md](Day0.md) for authentication setup. diff --git a/tutorial/day0/windows.md b/tutorial/day0/windows.md new file mode 100644 index 0000000..a086842 --- /dev/null +++ b/tutorial/day0/windows.md @@ -0,0 +1,104 @@ +# Windows Setup + +[Back to Day 0](Day0.md) + +## Prerequisites + +You need **Node.js v18 or higher** and **npm** (bundled with Node.js). + +## Step 1: Install Node.js + +### Option A: Via nodejs.org Download Page with fnm (Recommended) + +**fnm** (Fast Node Manager) is officially recommended by Node.js. It's fast, lightweight, and lets you switch Node versions easily if needed later. + +1. Open your browser and go to [nodejs.org/en/download](https://nodejs.org/en/download). + +2. You'll see a row of dropdowns that says: **"Get Node.js® vXX.XX.X (LTS) for __ using __ with __"**. Set the dropdowns as follows: + + | Dropdown | Select | + |----------|--------| + | Version | **vXX.XX.X (LTS)** — keep the default LTS version, don't change it | + | OS | **Windows** | + | Package Manager | **fnm** (under "Recommended (Official)") | + | Package Format | **npm** — keep the default | + +3. The page will show you the exact commands to run. Open **PowerShell as Administrator** (right-click the Start menu > "Terminal (Admin)" or search for PowerShell > right-click > "Run as administrator"). + +4. Copy and paste the commands from the page. They will look something like this: + + ```powershell + # Step 1 — Install fnm + winget install Schniz.fnm + + # Step 2 — Configure fnm environment (add to your PowerShell profile) + fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression + + # Step 3 — Install Node.js + fnm install 24 # The page will show the exact version number + ``` + + > The version number may differ from above — always use whatever the website shows. + +5. **Close and reopen your terminal** after installation. This is important so that `node` and `npm` are available in your PATH. + +> **Why fnm?** It's in the "Recommended (Official)" category on the Node.js download page, installs in seconds (written in Rust), and works natively on Windows — unlike nvm which requires a separate community port for Windows. + +### Option B: Official .msi Installer (Alternative) + +If you prefer a traditional installer: + +1. Go to [nodejs.org](https://nodejs.org). The homepage shows a big **"Download Node.js (LTS)"** button. +2. Click it to download the `.msi` file. +3. Run the installer: + - Click **Next** through the wizard. + - Accept the license agreement. + - Keep the default install location (`C:\Program Files\nodejs\`). + - On the "Tools for Native Modules" screen, **check the box** for "Automatically install the necessary tools" — this installs build tools you may need later. + - Click **Install** and wait for it to finish. +4. **Restart your terminal** after installation. + +### Option C: Using winget (One-liner) + +If you have `winget` (built into Windows 10/11): + +```powershell +winget install OpenJS.NodeJS.LTS +``` + +Close and reopen your terminal after installation. + +## Step 2: Verify Node.js + +Open a **new** terminal (Command Prompt, PowerShell, or Windows Terminal) and run: + +```powershell +node --version +npm --version +``` + +Both commands should print version numbers. If you get "not recognized", restart your terminal or check that Node.js is in your PATH. + +## Step 3: Install Claude Code + +```powershell +npm install -g @anthropic-ai/claude-code +``` + +> If you get a permission error, open your terminal as **Administrator** (right-click > Run as administrator) and run the command again. + +## Step 4: Verify Claude Code + +```powershell +claude --version +``` + +You should see the Claude Code version printed. Now head back to [Day0.md](Day0.md) for authentication setup. + +--- + +## Notes + +- **Recommended terminal:** Windows Terminal or PowerShell. The classic Command Prompt works but has limited features. +- **WSL users:** If you prefer running Claude Code inside WSL (Windows Subsystem for Linux), follow the [Linux guide](linux.md) instead — WSL is a full Linux environment. +- **PATH issues:** If `claude` is not recognized after install, npm's global bin directory may not be in your PATH. Run `npm config get prefix` to find it, then add the resulting path to your system's PATH environment variable.