Real-World Examples for in
February 1, 2026 ยท View on GitHub
This document contains 50+ real-world examples of using in to manage microservices, multi-repo setups, and directory groups.
Git Operations
-
Check status across all repos
in * git status -sQuickly see which microservices have uncommitted changes.
-
Pull latest changes everywhere
in -P 4 * git pull origin mainUpdate all repos in parallel (4 at a time).
-
Checkout a specific branch if it exists
in * "git checkout feature/login || git checkout main"Try to switch to feature branch, fallback to main.
-
Create a new release branch
in services/* git checkout -b release/v2.0 -
Prune deleted remote branches
in * git fetch -p -
See last commit in every repo
in * "git log -1 --format='%h %s'" -
Stash changes across all services
in services/* git stash -
Discard all local changes (Danger!)
in * git reset --hard HEAD -
Tag a release across multiple packages
in packages/* git tag v1.0.0 -
Push tags
in packages/* git push origin v1.0.0
Node.js / JavaScript
-
Install dependencies (clean install)
in -P 4 packages/* npm ci -
Update a specific package everywhere
in * "pnpm update lodash" -
Run tests for a specific scope
in packages/* npm test -
Check for outdated dependencies
in services/* npm outdated -
Audit for vulnerabilities
in * npm audit --production -
Build all frontend apps
in apps/web-* npm run build -
Remove node_modules (Fresh start)
in * "rm -rf node_modules package-lock.json" -
Initialize new projects
in * npm init -y -
Run a custom script if it exists
in * "npm run lint || echo 'No lint script found'" -
Upgrade interactive (using shell features)
in * "ncu -u && npm install"
Docker & Microservices
-
Build all Docker images
in -P 2 services/* docker build -t my-app/service .Note: This builds them all with the SAME tag name, usually you want dynamic tags.
-
Docker build with dynamic directory name
in services/* "docker build -t app/\$(basename \$PWD) ."Uses shell expansion to tag image with directory name.
-
Stop specific containers
in services/auth,services/user docker-compose down -
Restart services
in * "docker-compose restart app" -
View logs tail
in services/* "tail -n 10 logs/service.log" -
Clean up Docker artifacts
in * docker system prune -f
File Management & Cleanup
-
Delete temporary files
in * "rm -rf dist/ .cache/ tmp/" -
Find large files
in * "find . -type f -size +100M" -
Count lines of code
in src/* "wc -l *.ts" -
Replace string in files (Sed)
in * "sed -i 's/foo/bar/g' config.yaml" -
Rename a config file
in * "mv config.local.json config.json" -
Create missing directories
in * mkdir -p .github/workflows -
Copy a standard file to all repos
in * cp ~/templates/LICENSE .
System & Diagnostics
-
Check disk usage of directories
in * du -sh . -
Check active ports (Mac/Linux)
in * "lsof -i -P | grep LISTEN" -
Verify standard file existence
in * "[ -f README.md ] && echo 'OK' || echo 'Missing README'" -
Print current version from package.json
in * "jq .version package.json" -
Check python version
in services/* python --version
Advanced Scripting
-
Chain multiple failures
in * "lint || echo 'Lint failed' >> errors.log" -
Conditional execution based on file presence
in * "if [ -f requirements.txt ]; then pip install -r requirements.txt; fi" -
Run a local script in remote directories
in services/* ~/scripts/health-check.sh -
Grep across multiple repos
in * "grep -r 'TODO' src/ | head -n 5" -
Generate a report
in * "echo \"\$(basename \$PWD): \$(git rev-parse HEAD)\" >> ~/report.txt" -
Export ENV vars per command
in * "NODE_ENV=production npm run build"
Python
-
Install requirements
in services/* pip install -r requirements.txt -
Format code
in * black . -
Run Pytest
in -P 4 * pytest
Terraform / Infrastructure
-
Format TF files
in infra/* terraform fmt -
Validate configurations
in infra/* terraform validate -
Plan changes
in infra/stacks/* "terraform plan -out=tfplan"