Use in-cli to stay organized
Source: Dev.to
The Problem with Managing Many Repositories
We all “love” microservices—at least in theory. In practice, when you need to bump a dependency, run a build, or git pull across 15 different repositories, the process quickly becomes painful.
The “Tab Hoarder” Strategy
Manually open 15 terminal tabs, cd into each one, run the command, and hope you didn’t miss any.
The “Unix Wizard” Strategy
Try to construct a one‑liner that iterates over directories:
find . -maxdepth 1 -type d -exec sh -c 'cd "{}" && git pull' \;
It works, but it runs serially and is slow. Switching to xargs for parallelism:
ls -d */ | xargs -P 4 -I {} bash -c "cd {} && pnpm update"
Now you hit another snag: xargs breaks on directory names with spaces. Fixing it requires -print0 on find and -0 on xargs, turning a quick one‑liner into an unreadable 80‑character mess.
Introducing in‑cli 🚀
in-cli is a zero‑dependency Bash CLI that runs a command in every directory, fast. It eliminates the need for complex pipes and flags—just tell it what to do.
Basic Usage
in [OPTIONS] [DIRECTORIES...] [--] COMMAND...
Real‑World Scenarios
Scenario 1: The Morning Routine
Update all 20 repositories in your ~/work folder:
# Updates every repo in ~/work/ directory
in ~/work/* git pull
Scenario 2: The “Critical Fix” Deployment
Trigger a build script across all services in parallel:
# Run 'make build' in parallel across all subdirectories
in -P 8 ~/work/* make build
Scenario 3: Dependency Hell
Update lodash in every service because of a CVE, commit, and push:
in ~/work/* 'pnpm update lodash && git commit -am "updating lodash" && git push'
You’ll find +50 other examples in the EXAMPLES.md file bundled with the project.
Why Use in‑cli?
- Speed: Runs commands in parallel without extra flags.
- Simplicity: No need to remember complex
find | xargspipelines. - Portability: Pure Bash, zero external dependencies.
- Safety: Handles directory names with spaces and special characters out of the box.
If you’re managing a monorepo or a folder full of microservices, stop writing throwaway scripts. Give in‑cli a try, and let the author know if it saves you a few keystrokes (and your sanity).
Enjoy!