Skip to content

Latest commit

 

History

History
499 lines (385 loc) · 12.4 KB

File metadata and controls

499 lines (385 loc) · 12.4 KB

Developer Tools Zero-to-Hero Handbook

A crash course for AI / Agent beginners. No theory -- just the commands and concepts you actually need. Updated 2026-07-22


Table of Contents

  1. Shell / Terminal -- Your Command Center
  2. Git -- Version Control
  3. Node.js / npm -- JS Runtime & Package Manager
  4. Python / pip -- AI's Primary Language
  5. Docker -- Environment Isolation & Deploy
  6. Full Command Cheat Sheet

1. Shell / Terminal -- Your Command Center

1.1 What is it?

The shell translates your typed commands into actions the OS understands.

OS Default Shell Terminal App
Windows PowerShell / CMD Windows Terminal
macOS zsh (new) / bash (old) Terminal.app
Linux bash Various

This handbook uses bash/zsh syntax. Windows PowerShell equivalents are in the cheat sheet.

1.2 Essential commands

# Where am I?
pwd                           # Print working directory

# What's here?
ls                            # List files
ls -la                        # List all (including hidden), detailed

# Navigate
cd /path/to/folder            # Enter a directory
cd ..                         # Go up one level
cd ~                          # Go to home
cd -                          # Go to previous directory

# File operations
mkdir my-project              # Create directory
touch README.md               # Create empty file
cp source.txt dest.txt        # Copy
mv old.txt new.txt            # Move / rename
rm file.txt                   # Delete (WARNING: cannot undo)
rm -rf folder/                # Delete directory (WARNING: extremely dangerous)

# View files
cat file.txt                  # Print entire file
head -20 file.txt             # First 20 lines
tail -f app.log               # Live log tail (Ctrl+C to quit)
less file.txt                 # Page through (q to quit)

# Search
grep "error" app.log          # Search keyword in file
grep -r "TODO" src/           # Recursive directory search

1.3 Keyboard shortcuts

Shortcut Action
Ctrl+C Kill current program
Ctrl+D Exit shell (EOF)
Ctrl+L Clear screen
Ctrl+R Search command history
Ctrl+A / Ctrl+E Jump to start / end of line
Tab Auto-complete filename or command
Up / Down Navigate command history

2. Git -- Version Control

2.1 What is it?

Git takes snapshots of your code every time you commit. With GitHub, you can collaborate, roll back mistakes, and track every change.

2.2 Three key areas

Working directory (where you edit)
   | git add
   v
Staging area (snapshot ready to commit)
   | git commit
   v
Local repo (.git directory)
   | git push
   v
Remote repo (GitHub / GitLab)

2.3 Daily workflow

# === One-time setup ===
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

# === Start a project ===
git init                      # Make current folder a git repo
git add .                     # Stage everything
git commit -m "Initial commit"
git remote add origin <URL>   # Link to GitHub
git push -u origin main       # Push to GitHub

# === Daily changes ===
git status                    # What files changed?
git diff                      # What exactly changed?
git add file.py               # Stage specific file
git add .                     # Stage everything
git commit -m "Fix login bug"
git push                      # Push to remote

# === Pull others' changes ===
git pull                      # Fetch + merge
git fetch                     # Just check what's new (no merge)

# === Branches ===
git branch                    # Which branch am I on?
git checkout -b feature-x     # Create + switch to new branch
git checkout main             # Switch to main
git merge feature-x           # Merge branch into current

# === Emergency ===
git log --oneline             # View commit history
git stash                     # Stash current changes, go clean
git stash pop                 # Restore stashed changes

2.4 .gitignore

Tell Git what NOT to track:

node_modules/
__pycache__/
*.pyc
.env
.vscode/
dist/
build/
.DS_Store

3. Node.js / npm -- JS Runtime & Package Manager

3.1 What is it?

Tool Purpose
Node.js Runs JavaScript on your computer (no browser needed)
npm Node's package manager; downloads JS libraries
npx Run an npm package temporarily without installing

3.2 Verify installation

node --version    # Should be >= 18
npm --version

3.3 Project init

mkdir my-agent && cd my-agent
npm init -y                  # Creates package.json (project identity)

3.4 Install / uninstall packages

npm install axios            # Install axios (HTTP client)
npm install -D typescript    # -D = dev-only dependency
npm install -g wrangler      # -g = global (CLI tools)

npm uninstall axios          # Remove package

npm list                     # What's installed?
npm outdated                 # What needs updating?
npm update                   # Update everything

3.5 Run scripts

In package.json:

{
  "scripts": {
    "dev": "node index.js",
    "build": "webpack",
    "test": "jest"
  }
}
npm run dev      # Run dev script
npm test         # test and start can omit "run"

3.6 The node_modules truth

  • npm install downloads everything to node_modules/
  • Never commit this folder to Git (add to .gitignore)
  • Others just run npm install to rebuild from package.json

4. Python / pip -- AI's Primary Language

4.1 What is it?

Tool Purpose
Python AI ecosystem's dominant language
pip Python's package manager
venv Virtual environment (isolates dependencies per project)

4.2 Verify installation

python --version    # or python3 --version
pip --version       # or pip3 --version

4.3 Virtual environments (must-learn)

Why? Different projects may need different versions of the same package. Mixing them breaks things.

# Create
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (macOS/Linux)
source venv/bin/activate

# Deactivate
deactivate

When activated, your prompt shows (venv).

4.4 Package management

pip install requests         # Install requests
pip install langchain openai # Install multiple
pip install -r requirements.txt  # Batch install from file

pip list                     # What's installed?
pip freeze > requirements.txt   # Export dependency list

4.5 requirements.txt

Project root file listing all dependencies:

langchain>=0.3.0
openai>=1.50.0
chromadb>=0.5.0
python-dotenv>=1.0.0

Others install everything with one command:

pip install -r requirements.txt

5. Docker -- Environment Isolation & Deploy

5.1 What is it?

Docker is like a shipping container with instructions. You pack your code + environment into an Image, and it runs identically anywhere. Solves "it works on my machine" forever.

5.2 Core concepts

Concept Explanation
Image A packaged environment template (code + deps + system libs)
Container A running instance of an image, isolated from others
Dockerfile Instructions for building an image
docker-compose.yml Orchestrate multiple containers
Docker Hub Image registry (like npm for Node.js)

5.3 Common commands

# Status
docker --version              # Is Docker installed?
docker ps                     # Running containers
docker ps -a                  # All containers (including stopped)
docker images                 # Local images

# Pull and run
docker pull python:3.12       # Pull Python 3.12 image
docker run -it python:3.12 bash  # Run temporary container

# Build with Dockerfile
docker build -t my-agent:v1 .  # Build image (don't forget the dot)
docker run -p 8080:8080 my-agent:v1  # Run, map ports

# Cleanup
docker stop <ContainerID>     # Stop container
docker rm <ContainerID>       # Remove container
docker rmi <ImageID>          # Remove image
docker system prune -a        # Clean ALL unused (WARNING)

5.4 Minimal Dockerfile

FROM python:3.12-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
CMD ["python", "main.py"]

5.5 docker-compose.yml example

version: '3.8'
services:
  app:
    build: .
    ports:
      - "8080:8080"
    env_file:
      - .env
  redis:
    image: redis:7
    ports:
      - "6379:6379"
docker-compose up -d    # Start all services in background
docker-compose down     # Stop and clean up
docker-compose logs -f  # View logs

6. Full Command Cheat Sheet

Shell

I want to... Command
Current location pwd
List files ls -la
Enter directory cd path
Create directory mkdir name
Create file touch name
Delete file rm name
Delete directory rm -rf dir
Copy cp source dest
Move/Rename mv old new
View file cat file
Search content grep "keyword" file
Admin privileges Prefix with sudo
Kill program Ctrl + C
Clear screen Ctrl + L or clear

Git

I want to... Command
Init repo git init
Check status git status
Stage changes git add .
Commit git commit -m "message"
Push git push
Pull git pull
View history git log --oneline
Create branch git checkout -b name
Switch branch git checkout name
Merge branch git merge name
Clone repo git clone URL
Stash changes git stash / git stash pop
Discard changes git checkout -- file
Link remote git remote add origin URL

npm

I want to... Command
Init project npm init -y
Install package npm install pkg
Dev dependency npm install -D pkg
Global install npm install -g pkg
Uninstall npm uninstall pkg
Run script npm run script
Check versions npm outdated
Update npm update

pip / Python

I want to... Command
Create venv python -m venv venv
Activate (Mac/Linux) source venv/bin/activate
Activate (Windows) venv\Scripts\activate
Deactivate deactivate
Install package pip install pkg
Batch install pip install -r requirements.txt
List packages pip list
Export deps pip freeze > requirements.txt
Run script python file.py

Docker

I want to... Command
Running containers docker ps
All containers docker ps -a
Local images docker images
Pull image docker pull image
Run container docker run -p port:port image
Enter container docker exec -it ID bash
Build image docker build -t name:tag .
Stop container docker stop ID
Remove container docker rm ID
Remove image docker rmi ID
Clean garbage docker system prune -a
Compose up docker-compose up -d
Compose down docker-compose down

Windows PowerShell Equivalents

bash PowerShell
ls ls or Get-ChildItem
cd cd or Set-Location
pwd pwd or Get-Location
mkdir mkdir or New-Item -ItemType Directory
touch New-Item filename
cat cat or Get-Content
rm rm or Remove-Item
cp cp or Copy-Item
mv mv or Move-Item
grep Select-String
echo $VAR echo $env:VAR
export VAR=val $env:VAR = "val"

Appendix: Environment Variables & .env Files

Almost every AI project needs API keys. Store them in .env:

# .env (NEVER commit to Git)
OPENAI_API_KEY=sk-xxxxxxxx
ANTHROPIC_API_KEY=sk-ant-xxxxxxxx
DEEPSEEK_API_KEY=sk-xxxxxxxx

Python:

from dotenv import load_dotenv
import os

load_dotenv()
api_key = os.getenv("OPENAI_API_KEY")

Node.js:

require('dotenv').config();
const apiKey = process.env.OPENAI_API_KEY;

Use with Agent Tech Stack README. Bookmark and Ctrl+F anytime.