Full Reference

🌱 Beginner's Guide

Brand new to Git, GitHub, Firebase & AI coding? Start here β€” plain English, real commands, one step at a time.

🧭 START HERE β€” Where Your Code Lives

Your code lives in three places. Almost everything you'll do is just moving it between them.

YOUR COMPUTER
Where you actually edit files. Also called β€œlocal”. Nobody else can see it yet.
push 
 pull
GITHUB
Cloud backup + full history of every save. Lets other computers (and the cloud) get your code.
deploy 
(one way)
LIVE WEBSITE
Firebase Hosting β€” the public URL anyone on the internet can open.
In one line each: push / pull move code to and from GitHub  Β·  deploy makes it live on the internet via Firebase. Editing on your computer changes nothing online until you push and/or deploy.

🏷️ The Tags You'll See on Each Command

πŸ”§One-time setupDo it once per project or per computer, then never again.
πŸ”Every timePart of your routine β€” you'll run it in most work sessions.
⚑Claude Code can do thisYou can just ask the AI to do it for you.
⚠️Be careful / destructiveCan delete work or overwrite things. Read before running.

πŸ€” Which Workflow Is Mine?

Two of the sections below are β€œdeploy loops.” You only need one of them β€” pick by what's in your project folder.

πŸ“„ Just HTML files, no build step?
Your folder has .html files you can open directly. β†’ Use the Static HTML Flow (Section 3).
βš›οΈ Has a package.json with a build step (React / Vite)?
You run npm run build to make the site. β†’ Use the React Workflow (Section 4).
Not sure? Look in your project folder. No package.json = Static. Has a package.json with a "build" script = React.
1. GitHub Setup Put a brand-new project folder onto GitHub for the first time

What is this? Git = a time machine for your code (it saves snapshots you can rewind to). GitHub = a website that stores those saves online so they're backed up and shareable. This section links your local folder to a GitHub repo once.

πŸ”§ One-time setup⚑ Claude Code can do this

Do these four steps once to get your folder onto GitHub.

1
Start tracking your folder
Run this inside your project folder. It creates a hidden .git folder that begins recording changes.
git init
β†’
2
Make an empty repo online
Go to github.com/new and create a new repo. Leave it completely blank β€” no README, no .gitignore, no license.
β†’ github.com/new β†’ Create empty repo
β†’
3
Link your folder to that repo
Copy the HTTPS URL from your new GitHub repo and paste it in. This tells Git β€œGitHub is my home base” (called the origin).
git remote add origin
β†’
4
Save & upload everything
Commit (save a snapshot) and push (upload it). Your code is now safely on GitHub.
SAVE A SNAPSHOT
git add . && git commit -m " "
UPLOAD (BRANCH = main)
git branch -M main && git push -u origin main
IF YOUR BRANCH IS master
git push -u origin master
Not sure which? Run git branch β€” the branch with a * is yours.
βœ… What you should see: after the push, refresh your GitHub repo page in the browser β€” all your files now appear there. That means the backup worked.
🩹 When it breaks β€” β€œhas no upstream branch”: that means the very first push didn't set up the link. Use the -u flag: git push -u origin main (or master). The -u sets it up once; after that a plain git push works forever.
2. New PC Download an existing GitHub project onto a fresh computer

What is this? Your project already lives on GitHub (from Section 1). Now you're on a different computer and want a copy to work on. Cloning downloads the whole project β€” files and history β€” in one command.

πŸ”§ One-time setup (per computer)

Got a new machine? Run these top to bottom.

1
Tell Git who you are
One-time per computer. The --global flag means it applies to every project on this machine. Skip if Git is already set up here.
YOUR NAME
git config --global user.name " "
YOUR EMAIL
git config --global user.email " "
β†’
2
Download the project
On your GitHub repo, click the green Code button, copy the HTTPS URL, and paste it below.
git clone
Then cd into the new folder before running anything else.
β†’
3
Install & log in
Restore the project's packages, then log into Firebase and Google Cloud so this machine can build and deploy.
INSTALL PACKAGES
npm install
FIREBASE LOGIN
firebase login
GCLOUD LOGIN
gcloud auth login
βœ… What you should see: after git clone, a new folder appears with all your files. After npm install, a node_modules folder shows up (that's normal and can be huge β€” it's ignored by Git).
🩹 When it breaks β€” the .env trap (does NOT come with the clone): Your .env file holds secret keys, so it's deliberately kept out of Git. After cloning, the app loads but Firebase / API calls silently fail because the keys are missing β€” no error tells you why.
MAKE ONE FROM THE TEMPLATE (WINDOWS CMD)
copy .env.example .env
Then paste the real values into .env from your password manager.
CHECK IT EXISTS & ISN'T EMPTY
type .env
β€· Heads up: if you're running a dev server, it won't pick up .env changes until you restart it (Ctrl+C β†’ rerun).
πŸ’‘ Got a functions/ subfolder? It has its own package.json, so install there separately: cd functions && npm install && cd .. β€” Firebase won't deploy functions without it.
3. Static HTML Flow Everyday loop for plain HTML sites β€” no build step

What is this? The everyday loop for a plain HTML/JS site (like this cheat sheet). There's no β€œbuild” step β€” your files are the website β€” so you deploy them straight to Firebase. Every session: pull β†’ deploy β†’ push.

πŸ” Every time⚑ Claude Code can do this

Working from more than one computer? Never skip a step. Every session starts and ends here.

1
Pull first β€” get the latest
Always download the newest code before you touch anything. Another computer may have pushed changes you don't have yet.
git pull origin
β†’
2
Deploy β€” make it live
Push your files to the internet. For a plain HTML site, hosting-only is all you need.
HOSTING ONLY (the usual)
firebase deploy --only hosting
EVERYTHING (rare)
firebase deploy
β†’
3
Commit & push β€” save the backup
Don't walk away without pushing. If you forget, your next computer will be behind and you'll hit merge conflicts.
3A β€” SAVE A SNAPSHOT
git add . && git commit -m " "
3B β€” UPLOAD TO GITHUB
git push origin
βœ… What you should see: after firebase deploy you'll get a β€œDeploy complete!” line with your Hosting URL β€” open it to confirm your change is live. After git push your commit shows up on GitHub.
🩹 When it breaks β€” merge conflict on pull: if git pull says β€œconflict,” it means the same lines were edited in two places. Git marks them with <<<<<<< / ======= / >>>>>>> in the file. Edit the file to keep the version you want (delete those marker lines), then git add . and commit. Best prevention: always pull first, push last.
4. React Workflow β€” The Golden Loop Everyday loop for projects with a build step (React / Vite)

What is this? React / Vite projects have a build step β€” your source code gets compiled into a dist/ folder, and that is what goes live. So the loop is longer: pull β†’ check β†’ build β†’ deploy β†’ verify β†’ push. Follow it in order every time.

πŸ” Every time⚑ Claude Code can do this
⚑ The order matters. β‘  pull latest β†’ β‘‘ check it runs β†’ β‘’ build β†’ β‘£ confirm project β†’ β‘€ deploy (rules β†’ functions β†’ hosting) β†’ β‘₯ verify live β†’ ⑦ commit & push.
1
Pull latest FIRST
Working from a different machine? Sync before touching anything, or you'll get merge conflicts. Then npm install if packages changed.
git pull origin
2
Run it locally to check
Opens localhost (usually :5173). Click through what changed before you build.
npm run dev
3
Build β€” does it compile?
Compiles to dist/ (what Hosting serves). If it fails, fix it before deploying β€” nothing reached live yet.
npm run build
4
Confirm the project
Must print your intended project ID before deploying β€” so you don't push to the wrong one. Reflex check, every time.
firebase use
5
Deploy in order
Order matters: the UI calls rules + functions, so deploy those FIRST. Skip any line you didn't change β€” UI-only = just hosting.
firebase deploy --only firestore:rules
firebase deploy --only functions
firebase deploy --only hosting
6
Verify live
Open your live site and confirm it works β€” sometimes it passes locally but not in production.
firebase open hosting:site
7
Commit & push LAST
So every computer stays in sync. Your next machine pulls this in step 1 β€” forgetting here is what causes the conflicts step 1 prevents.
SAVE A SNAPSHOT
git add . && git commit -m " "
UPLOAD TO GITHUB
git push origin
βœ… What you should see: npm run build ends with a list of files written to dist/ and no red errors. Each firebase deploy ends with β€œDeploy complete!” and a URL.
🩹 When it breaks: npm run dev won't see .env changes until you restart it (Ctrl+C β†’ rerun). If npm run build fails, read the first red error β€” that's the real one; fix it and rebuild. Broke the live site? Roll back instantly in Firebase Console β†’ Hosting β†’ release history.
5. Firebase Log in, pick the right project, and deploy

What is this? Firebase is Google's hosting service β€” it's what actually puts your site on the internet at a public URL. The Firebase CLI (the firebase command) is how you log in, choose which project you're deploying to, and push your site live.

πŸ”§ Login is one-timeπŸ” Deploy is every time⚠️ Always check the project first

Log In & Pick a Project

πŸ”§ Log in to Firebase
firebase login
Opens your browser to sign in with your Google account. Do this once per computer.
See all your projects
firebase projects:list
Lists every Firebase project on your account, with its project ID.
⚠️ Check which project is active
firebase use
Shows which project your deploys will go to. Always run this before deploying so you don't publish to the wrong site.
Switch to a different project
firebase use
Changes which project your commands target. Paste a project ID from the list above.

Deploy (Go Live)

πŸ” Deploy your website (the usual)
firebase deploy --only hosting
Pushes just your site files. This is the one you'll use most for a plain HTML site.
Deploy everything at once
firebase deploy
Deploys all configured services (Hosting, Functions, Rules) together. Slower β€” only when you changed more than the site.
Open your live site
firebase open hosting:site
Opens your published site in the browser so you can confirm the deploy worked.
Preview locally before deploying
firebase serve --only hosting
Runs your site on your own computer first, so you can check it before it goes public.
βœ… What you should see: a successful deploy ends with β€œDeploy complete!” and a Hosting URL like https://your-site.web.app. Open it to see your changes live.
🩹 When it breaks: if the deploy fails saying you're not logged in, run firebase login again. If it deploys but you see the wrong site, you were on the wrong project β€” run firebase use to check, switch, and redeploy.
6. Claude Code Let the AI do the work β€” launch, prompts, and honest limits

What is this? Claude Code is an AI coding assistant that runs in your terminal. You type claude to start it, then talk to it in plain English β€” it can read your files, make changes, run commands, and even commit, push, and deploy for you.

⚑ This IS Claude Code⚠️ Skip-permissions runs with no prompts
⚠️ --dangerously-skip-permissions = β€œYOLO mode.” It auto-approves every file write, command, and network call with no prompts. Only run it in a trusted project where git is your undo button β€” commit before you start so you can roll back.

Launch (from your terminal)

Plain, careful start (recommended for beginners)
claude
Normal mode β€” Claude asks before each write or command. Safest while you're learning.
⚑ Skip-permissions (works uninterrupted)
claude --dangerously-skip-permissions
All prompts off β€” Claude works without stopping to ask. Powerful, but only in a trusted repo.
Continue your last chat
claude --continue
Picks up the most recent conversation in this folder. Short form: claude -c.
⚑ Launch with an opening instruction
claude " "
Starts the session already working on your instruction.

Install & Manage

πŸ”§ Install / reinstall (npm)
npm install -g @anthropic-ai/claude-code
The global install. Use this if claude isn't recognized in your terminal at all.
Update to the latest version
claude update
Pulls the newest build. Run it when flags or features look out of date.
Check who you're logged in as
claude auth status
Confirms your account. claude auth login to sign in, claude auth logout to switch.
Something misbehaving? Check the install
claude doctor
Diagnoses common setup problems.
❓ Can one prompt also commit and deploy?
Yes. In your prompt, tell Claude Code to make the change and then commit, push, and run firebase deploy --only hosting. In --dangerously-skip-permissions mode it does all of it without stopping to ask. For example:
Update the homepage headline, then commit, push to GitHub, and run firebase deploy --only hosting
❓ If I turn off my computer, does it finish?
No β€” the normal claude command runs on YOUR machine. If you turn the computer off, close the terminal, or it goes to sleep, Claude Code stops and does not finish the job.

There's a separate cloud version (claude --cloud, or Claude Code on the web at claude.ai/code) that runs on Anthropic's servers and keeps going with your computer off. But it's a more advanced setup: it clones your project from GitHub (so you must push first) and needs your secret keys stored in its cloud settings, not your local .env.
πŸ’‘ Tip: when you're new, start with plain claude so it asks before each step β€” you'll learn what it's doing. Switch to --dangerously-skip-permissions once you trust it and have committed your work as a safety net.
7. The Workflow Two little files that keep Claude Code on track β€” CLAUDE.md + RUNBOOK.md

What is this? Two small Markdown files do the heavy lifting so Claude Code always knows your project and what to do next β€” set them up once and stop re-explaining yourself every session.

πŸ“‚ Two files, two jobs
CLAUDE.md The project's permanent brain β€” your stack, the exact install / run / build / deploy commands, folder + code conventions, and hard rules. Claude reads it automatically every session, so you never re-explain the basics.
RUNBOOK.md The living to-do list for what you're building right now β€” checkboxes, priorities, and a spot to park ideas. This is where the day-to-day work lives.

They point at each other: RUNBOOK.md points to CLAUDE.md for the stack, commands, and rules β€” and CLAUDE.md points to RUNBOOK.md for the current tasks.

πŸ… Golden rule: any new feature or idea ALWAYS goes into RUNBOOK.md (under IDEAS / LATER if you're not building it yet) β€” never straight into the code.
πŸ”§ Starting a brand-new project
One paste β€” it asks what you want, recommends a stack, and creates both files for you.
Prompt β€” paste into Claude Code
You're setting me up on a brand-new project and I want you to explain things simply. Do these
steps IN ORDER and DON'T build any features until I approve.
1) Look at anything already in this folder. Then ask me up to 4 short questions to learn: what
   I'm building, who it's for, the main features I want to start with, and any tools I already
   use. Wait for my answers.
2) Recommend the SIMPLEST tech stack that does the job (no over-engineering). Explain it in
   plain English, name the exact tools and where it will be deployed, and give one main pick
   plus one simpler alternative. If the tools I already use fit, say so. Then wait for me to
   say "go".
3) After I approve, create two Markdown files that reference each other:
   - CLAUDE.md: the permanent project brain. Most important rules at the top. Include the
     stack, the exact install/run/build/deploy commands, folder + code conventions, and a
     "Hard Rules" section. End with: "Current tasks and progress live in RUNBOOK.md."
   - RUNBOOK.md: the living task list. Start with a "RESUME HERE ->" line. Turn the features I
     named into small, independently testable slices in build order; each slice gets a
     checkbox, a one-line goal, the files it touches, and how I'll verify it. Tag slices
     P1/P2/P3. Add an "IDEAS / LATER" section. Near the top put: "Stack, commands, and rules
     live in CLAUDE.md - read it first."
4) Tell me in one sentence: from now on any new feature or idea goes into RUNBOOK.md (under
   IDEAS / LATER if we're not building it yet) - never straight into the code.
5) Show me both files and the single next thing to do. Don't build yet - wait for my go.
πŸ”§ Already have a project? Give it a brain
Reads your existing code and writes a CLAUDE.md from what's really there.
Prompt β€” paste into Claude Code
This is a project I've already built. Create a CLAUDE.md so you have context every session
without me re-explaining. First actually read the project - main files, config, package.json /
firebase.json if present, and the folder structure. Don't guess; base it on what's really here.
Then create CLAUDE.md in the root, most important rules at the top, including: what this project
is (1-2 plain sentences), the real stack you found, the exact run/build/deploy commands from the
config, the folder layout and conventions I follow, and a "Hard Rules" section with a couple of
blank bullets for me to fill in. End with: "Current tasks live in RUNBOOK.md." Show me the file
and flag anything you weren't sure about so I can correct it.
πŸ” Start of every session
The daily driver β€” pull up both files and pick up exactly where you left off.
Prompt β€” paste into Claude Code
Read CLAUDE.md and RUNBOOK.md, then follow the "RESUME HERE" line. Plan the next unchecked P1
slice only (tell me the files and approach first), then build just that slice and show me it
working. Once I confirm, check it off in RUNBOOK.md with a one-line note, then commit with a
clear message, push, and deploy. Then stop and tell me the next slice.
⚑ Add a feature or idea later
Where new work always goes β€” logs the idea in RUNBOOK.md instead of derailing what you're building.
Prompt β€” paste into Claude Code
Add this to the "IDEAS / LATER" section of RUNBOOK.md so we don't forget it, but don't build it
now: [describe the feature]. If it's something we should do next, turn it into a proper slice
with a checkbox, goal, files, and how I'll verify it - otherwise just log it.
πŸ’‘ Keep them in sync: CLAUDE.md and RUNBOOK.md always point to each other β€” keep the stack / rules in CLAUDE.md and the tasks / ideas in RUNBOOK.md, and neither goes stale.
πŸ“– Plain-English Glossary Every term above, in one sentence each
repo β€” Short for β€œrepository” β€” the folder that holds your project plus its full save history.
clone β€” Download a full copy of a repo (files + history) from GitHub onto your computer.
commit β€” A saved snapshot of your changes with a short message describing what you did.
push β€” Upload your commits from your computer to GitHub.
pull β€” Download the latest commits from GitHub onto your computer.
branch β€” A separate line of work, so you can try changes without touching the main version.
main / master β€” The default main branch β€” the β€œreal” version of your project. (Newer repos use main, older ones master.)
remote / origin β€” The online copy of your repo. β€œorigin” is the nickname for your main remote (usually GitHub).
deploy β€” Publish your site to the internet so anyone can open it at a public URL.
hosting β€” The service that serves your live website (here, Firebase Hosting).
dependencies β€” Outside code packages your project needs to run.
npm install β€” Downloads all the dependencies listed in package.json into a node_modules folder.
build β€” Compiling your source code into the final files that actually get served (a dist/ folder for React/Vite).
localhost β€” Your own computer acting as a web server β€” a preview only you can see, not the internet.
.env β€” A hidden file holding secret keys. Kept out of Git on purpose, so it never comes with a clone.
CLI / terminal β€” The text window where you type commands (Command Prompt / PowerShell on Windows).
πŸ’‘ Ready for more? Once these six feel comfortable, open the Full Reference β†’ for the complete command set: Git internals, NPM, Docker, Google Cloud, and terminal power tools.