CLI Services: Advanced Dev Environment Setup
Keep this page open while you work. It shows the daily loop and deeper commands when you need them.
Daily Workflow Snapshot
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
git pull
— sync before you touch codegit status
— check what changedgit add .
+git commit -m "..."
— save grouped workgit push
— share with GitHub / trigger Vercel
Common fixes
Situation | Command |
---|---|
Merge conflict | git pull , resolve files, git add . , git commit |
Undo uncommitted file | git restore path/to/file |
Fix last commit message | git commit --amend -m "new message" |
Need first-time repo setup?
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
Supabase CLI
supabase login
(one-time) →supabase link --project-ref <ref>
supabase migration new <name>
— scaffold SQL filesupabase db push
— apply migrations to remotesupabase db pull
— sync remote schema back to filessupabase db diff
— compare local vs. remote (requires Docker for full local diff)supabase db shell
— run ad-hoc SQL queries
Quick workflow
supabase migration new add_tasks_table
# edit the generated SQL
supabase db push
git add supabase/migrations
git commit -m "Add tasks table"
Local development commands
supabase start # spins up local stack (needs Docker)
supabase db reset # apply migrations locally
supabase stop # shut down local services
Vercel CLI
npm install -g vercel
(once) →vercel login
vercel
— link project + deploy previewvercel --prod
— push to production manuallyvercel dev
— run Next.js locally with Vercel settingsvercel logs <deployment-url>
— view production/runtime errors
Environment variables & settings
- Pull config locally:
vercel pull
- Manage env vars:
vercel env pull .env.production
- List projects:
vercel ls
Cursor IDE Tips
- Open terminal: `Cmd/Ctrl + “
- Launch project from shell:
cursor .
- Quick commands:
Cmd/Ctrl + K
(inline chat),Cmd/Ctrl + L
(side panel chat),Cmd/Ctrl + Shift + P
(command palette) - When Cursor writes code:
- Read the diff
- Reject if off-track
- Re-prompt with clarifications or paste existing context
Practice Loop
git pull
supabase migration new add_example
- Add a column in the SQL file
supabase db push
git add supabase/migrations
git commit -m "Add example column"
git push
vercel --prod
If any step fails, capture the error and jump to Troubleshooting & Logs.