The 20 commands that unlock every AI coding tool
Turn what you learned into a concrete stack decision.
01AI Agent ToolboxBuild autonomous AI agents that can read, write, and actWant the shortlist in your inbox?
Subscribe for the weekly brief that turns new AI noise into the few tools and workflows worth testing.
Curated bundles that help you move from this guide into a working stack.
Guide
Which AI Should You Code With?
Claude vs GPT vs Gemini — a no-BS comparison for builders who want to ship
Guide
Obsidian Just Became the Best Knowledge Base for AI Agents
Obsidian 1.12 ships a full CLI with 100+ commands — your vault is now programmable from the terminal
Guide
OpenClaw + Claude Code: Commands Cheat Sheet
Every command, shortcut, and workflow tip for both tools in one place
Every powerful AI coding tool — Claude Code, MCP servers, agent frameworks, package managers — runs in the terminal. If you want to use AI to build real software, you need to be comfortable here.
Good news: you don't need to master the terminal. You need about 20 commands to be productive. This guide covers all of them.
Cmd + Space, type "Terminal", hit EnterWin + X, select "Windows Terminal"Ctrl + Alt + T on most distributionsThink of your filesystem as nested folders. The terminal just lets you move between them with text commands instead of clicking.
pwd
Print Working Directory. Shows your current location. You'll see something like /Users/yourname or /home/yourname.
ls
Lists everything in the current directory. Add flags for more detail:
ls -la # Show hidden files + file sizes + permissions
ls -lt # Sort by most recently modified
cd Documents # Go into the Documents folder
cd .. # Go up one level
cd ~ # Go to your home directory
cd / # Go to the root of the filesystem
cd ~/projects/my-app # Go directly to a specific path
Pro tip: Press Tab to autocomplete folder names. Type cd Doc then press Tab — the terminal will complete it to cd Documents/.
mkdir my-project # Create a folder
mkdir -p projects/my-app/src # Create nested folders in one go
touch index.ts # Create an empty file
rm file.txt # Delete a file
rm -r my-folder # Delete a folder and everything in it
Warning: There's no recycle bin in the terminal. rm is permanent. Double-check before you delete.
find . -name "*.ts" # Find all TypeScript files
find . -name "package.json" # Find a specific file
The . means "start searching from the current directory."
grep -r "API_KEY" . # Search for text inside files
grep -r "function login" src/ # Search in a specific folder
-r means recursive (search inside subfolders too).
cat README.md # Print entire file contents
head -20 README.md # Show first 20 lines
tail -20 server.log # Show last 20 lines
For quick edits, use nano (comes pre-installed):
nano .env # Open file in a simple editor
In nano: Ctrl + O to save, Ctrl + X to exit.
For real coding, use a proper editor like VS Code or Cursor:
code . # Open current folder in VS Code
cursor . # Open current folder in Cursor
Git tracks changes to your code. Every AI coding project uses it. You need these 5 commands:
git clone https://github.com/user/repo.git
Downloads a project from GitHub to your computer.
git status
Shows which files you've modified, added, or deleted.
git add . # Stage all changes
git add src/index.ts # Stage a specific file
Staging means "mark these changes to be saved."
git commit -m "Add login page"
Creates a snapshot of your staged changes with a descriptive message.
git push
Uploads your commits to the remote repository (GitHub).
The full workflow:
git status # See what changed
git add . # Stage everything
git commit -m "Your message" # Save snapshot
git push # Upload to GitHub
That's it. You can learn branching, merging, and rebasing later when you need them.
Package managers install libraries (other people's code) that your project uses.
The default for JavaScript/TypeScript projects.
npm install # Install all dependencies from package.json
npm install express # Add a new package
npm run dev # Run a script defined in package.json
A faster alternative to npm. Same commands, faster execution.
bun install # Install dependencies
bun add express # Add a new package
bun run dev # Run a script
For Python projects.
pip install requests # Install a package
pip install -r requirements.txt # Install all dependencies
How to know which one to use: Look at the project files.
package.json + bun.lock? → Use bunpackage.json + package-lock.json? → Use npmrequirements.txt or pyproject.toml? → Use pipEnvironment variables store configuration values that change between environments (your machine vs production). They're also where API keys live.
Most projects use a .env file in the project root:
# .env
DATABASE_URL=postgresql://localhost:5432/mydb
API_KEY=sk-abc123def456
PORT=3000
Your code reads these values at runtime. In Node.js:
const apiKey = process.env.API_KEY;
.env to git — it contains secrets.env.example — shows what variables are needed (without real values).env automatically — no extra setup neededdotenv — or use the --env-file flagcp .env.example .env # Copy the template
nano .env # Edit and add your real values
The program isn't installed, or your terminal doesn't know where to find it.
# Check if it's installed
which node # Shows path if installed, nothing if not
# Common fixes:
# 1. Install it (e.g., brew install node on macOS)
# 2. Restart your terminal (close and reopen)
# 3. Source your profile: source ~/.zshrc (macOS) or source ~/.bashrc (Linux)
You're trying to do something that requires admin access.
sudo npm install -g typescript # Run with admin privileges
Use sudo sparingly. If everything needs sudo, something is misconfigured.
npm is trying to write to a directory you don't own. Fix:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
# Add to your shell profile: export PATH=~/.npm-global/bin:$PATH
Or just use Bun — it doesn't have this problem.
Another process is using the same port.
# Find what's using port 3000
lsof -i :3000
# Kill it
kill -9 <PID> # Replace <PID> with the process ID from above
| Action | Command |
|--------|---------|
| Where am I? | pwd |
| What's here? | ls -la |
| Go to folder | cd folder-name |
| Go up | cd .. |
| Go home | cd ~ |
| Create folder | mkdir folder-name |
| Create file | touch filename |
| Delete file | rm filename |
| Delete folder | rm -r folder-name |
| Read file | cat filename |
| Find file | find . -name "filename" |
| Search in files | grep -r "text" . |
| Install packages | npm install or bun install |
| Run project | npm run dev or bun run dev |
| Git status | git status |
| Git save | git add . && git commit -m "message" |
| Git upload | git push |
You now know enough terminal to use any AI coding tool. The rest you'll pick up as you build.
Next up: learn what to keep secret and what's safe to share in our Security Guide.