CLI Services

Git fundamentals, Supabase CLI, Vercel CLI, and development workflows for building full-stack applications.

CLI Services

Keep this page open while you work. It shows the daily loop and deeper commands when you need them.


Daily Workflow

git pull
supabase db diff   # if schema changed
npm run dev        # or vercel dev
# build feature with Cursor
git add .
git commit -m "feat: ..."
git push
vercel --prod      # when ready for prod

Git Essentials

Core Commands

CommandPurpose
git pullSync before you touch code
git statusCheck what changed
git add .Stage all changes
git commit -m "..."Save grouped work
git pushShare with GitHub / trigger Vercel

Common Fixes

SituationCommand
Merge conflictgit pull, resolve files, git add ., git commit
Undo uncommitted filegit restore path/to/file
Fix last commit messagegit commit --amend -m "new message"
<details> <summary>First-time repo setup</summary> ```bash git init git add . git commit -m "Initial commit" git remote add origin https://github.com/yourusername/your-repo.git git push -u origin main ``` </details>

Supabase CLI

Setup

supabase login
supabase link --project-ref <ref>

Common Commands

CommandPurpose
supabase migration new <name>Scaffold SQL file
supabase db pushApply migrations to remote
supabase db pullSync remote schema back to files
supabase db diffCompare local vs. remote (requires Docker)
supabase db shellRun ad-hoc SQL queries

Quick Migration Workflow

supabase migration new add_tasks_table
# edit the generated SQL
supabase db push
git add supabase/migrations
git commit -m "Add tasks table"
<details> <summary>Local development commands</summary> ```bash supabase start # spins up local stack (needs Docker) supabase db reset # apply migrations locally supabase stop # shut down local services ``` </details>

Vercel CLI

Setup

npm install -g vercel
vercel login

Common Commands

CommandPurpose
vercelLink project + deploy preview
vercel --prodPush to production manually
vercel devRun Next.js locally with Vercel settings
vercel logs <url>View production/runtime errors
<details> <summary>Environment variables and settings</summary> ```bash vercel pull # Download project settings vercel env pull .env # Get env vars locally vercel ls # List projects ``` </details>

Cursor IDE Tips

Keyboard Shortcuts

ShortcutAction
Cmd/Ctrl + `` Open terminal
Cmd/Ctrl + KInline chat
Cmd/Ctrl + LSide panel chat
Cmd/Ctrl + Shift + PCommand palette

Working with AI Code

  1. Read the diff before accepting
  2. Reject if off-track
  3. Re-prompt with clarifications or paste existing context

Open Project from Terminal

cursor .

Practice Loop

Test your setup with this sequence:

  1. git pull
  2. supabase migration new add_example
  3. Add a column in the SQL file
  4. supabase db push
  5. git add supabase/migrations
  6. git commit -m "Add example column"
  7. git push
  8. vercel --prod

If any step fails, capture the error and check Troubleshooting.


Want to deploy to your own server? See Self-Hosting 101.

Back to the main workflow? Return to Build with AI Flow.