Document

Developer Command Cheat Sheet

Practical daily commands for Git, pnpm, Docker, PostgreSQL, tmux, and system operations.

Developer Command Cheat Sheet (Garuda Linux + Full Stack Tools)

Practical command reference for daily development with: Git, pnpm/Corepack, Docker, PostgreSQL, tmux, pm2, pacman/yay, logs, and system control.


1) Git (Version Control Core)

Initial setup

git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global pull.rebase true
git config --global init.defaultBranch main

Individual command meaning:

Daily status and sync

git status
git fetch --all --prune
git pull --rebase

Individual command meaning:

Branch workflow

git checkout -b feature/name
git switch main
git branch
git branch -d feature/name

Individual command meaning:

Commits and history

git add -p
git commit -m "feat(scope): add behavior"
git log --oneline --decorate --graph -20
git diff
git diff --staged

Individual command meaning:

Rebase, push, and conflict help

git fetch origin
git rebase origin/main
git rebase --continue
git rebase --abort
git push -u origin feature/name

Individual command meaning:

Safety notes (Git):


2) pnpm + Corepack (Node.js Package Management)

Package manager consistency

corepack enable
corepack prepare pnpm@10.33.0 --activate
pnpm --version

Install and run

pnpm install
pnpm dev
pnpm start
pnpm test
pnpm lint
pnpm build

Dependency management

pnpm add package-name
pnpm add -D package-name
pnpm remove package-name
pnpm update
pnpm outdated

Workspace maintenance and clean reinstall

pnpm store prune
rm -rf node_modules
pnpm install --frozen-lockfile

Prisma (if project uses it)

pnpm prisma migrate dev --name init
pnpm prisma generate
pnpm prisma studio

3) Docker + Compose (Infrastructure Layer)

Core container commands

docker ps
docker ps -a
docker images
docker logs -f <container>
docker exec -it <container> sh
docker stop <container>
docker rm <container>

Individual command meaning:

Compose lifecycle

docker compose up -d
docker compose ps
docker compose logs -f
docker compose down

Individual command meaning:

Rebuild and reset patterns

docker compose up -d --build
docker compose down --volumes --remove-orphans
docker system df
docker system prune

Individual command meaning:

Safety notes (Docker):


4) PostgreSQL (Local or Containerized)

Service and connectivity

sudo systemctl status postgresql
sudo systemctl start postgresql
sudo systemctl enable postgresql
psql -U postgres
psql -h localhost -U <user> <db>

Inside psql (meta commands)

\l
\c <db>
\dt
\d <table>
\dn
\q

SQL checks you use often

SELECT now();
SELECT * FROM <table> LIMIT 20;
EXPLAIN ANALYZE SELECT * FROM <table> WHERE id = 1;

PostgreSQL in Docker

docker exec -it <postgres-container> psql -U postgres
docker logs -f <postgres-container>

5) Beekeeper Studio (GUI Database Inspection)

No CLI workflow required.

Use it for:

Do not use it as your migration or production change source-of-truth.


6) tmux (Terminal Control Room)

Sessions

tmux
tmux new -s dev
tmux ls
tmux attach -t dev
tmux kill-session -t dev

Panes and windows (prefix is Ctrl+b)

Ctrl+b %      split vertical
Ctrl+b "      split horizontal
Ctrl+b arrow  move between panes
Ctrl+b c      new window
Ctrl+b n      next window
Ctrl+b p      previous window
Ctrl+b d      detach

7) pm2 (Process Manager for Long-Running Node Apps/Bots)

Start and inspect

pm2 start index.js --name app
pm2 start ecosystem.config.js
pm2 list
pm2 logs app
pm2 monit

Control lifecycle

pm2 restart app
pm2 stop app
pm2 delete app
pm2 restart all

Persist across reboot

pm2 save
pm2 startup

8) pacman + yay (System Package Management)

pacman essentials

sudo pacman -Syu
sudo pacman -S <package>
pacman -Ss <keyword>
pacman -Qi <package>
sudo pacman -Rns <package>

yay essentials (AUR)

yay -Syu
yay -S <package>
yay -Ss <keyword>
yay -Qi <package>
yay -Rns <package>

Mirror and package log checks

ls /etc/pacman.d/mirrorlist*
grep "installed\|upgraded\|removed" /var/log/pacman.log | tail -n 100

9) System Logs and Service Debugging

journalctl and systemctl

journalctl -xe
journalctl -u docker -n 200 --no-pager
journalctl -u postgresql -f
systemctl status docker
systemctl status postgresql

Network and process quick checks

ss -tulpn
ps aux | grep -E "node|pm2|postgres|docker"

10) File, Search, and Archive Utilities

Search and inspection

find . -name "*.sh"
find . -type f | wc -l
du -h --max-depth=1
df -h
lsblk -f

Download and archive tools

curl -I https://example.com
wget https://example.com/file.tar.gz
tar -xvf file.tar
unzip archive.zip

11) Go Toolchain Basics (When Working in Go Projects)

go version
go mod tidy
go test ./...
go run .
go build ./...

12) Daily Control Sequence (Fast Routine)

tmux new -s dev
docker compose up -d
git fetch --all --prune
git pull --rebase
pnpm install
pnpm dev

Then in parallel panes:


Final Rule of Thumb

Everything else supports these five anchors.