2 min read

in-cli: A Simple Bash Tool to Run Commands in Multiple Directories at Once

Need to git pull, build or bump a dependency across 15 repos? in-cli is a zero-dependency bash tool that runs a command in every directory, in parallel.

We all "love" microservices, allegedly. But you know what isn't fun? Realizing you need to run a command across many repositories: bump a dependency, run a build, git pull and create PRs across 15 different repositories at the same time.

Running a command across many repositories: the usual options

You usually have two options (if you don't want to use an AI agent):

  1. The "Tab Hoarder" strategy. Manually open 15 terminal tabs, cd into each one, run the command, and pray you didn't miss one.
  2. The "Unix Wizard" strategy. You try to construct a one-liner that iterates over directories. You start typing:
for d in */; do (cd "$d" && git pull); done

It works, but it's painfully slow because it runs serially (one at a time). So you switch to xargs to run it in parallel:

ls -d */ | xargs -P 4 -I {} sh -c 'cd {} && git pull'

Now you have a problem: xargs (by default) breaks on directory names with spaces. To fix it, you need to add -print0 to find and -0 to xargs, and suddenly your "quick one-liner" is 80 characters long and unreadable.

Enter in-cli

I got tired of typing those boilerplate loops. I wanted a tool that does one thing well: runs a command in every directory, fast. So I built in-cli, a zero‑dependency CLI (pure bash) that acts as a force multiplier for your shell.

Get it on GitHub: github.com/inevolin/in-cli

Usage:

in [OPTIONS] [DIRECTORIES...] [--] COMMAND...

How it actually works

Instead of wrestling with pipes and flags, you just tell it what to do.

Scenario 1: The morning routine. You get to work and need to update all 20 repos in your ~/work folder.

cd ~/work && in -P 4 * git pull

Scenario 2: The "critical fix" deployment. You need to trigger a build script across all your services right now.

in -P 4 services/* npm run build

Scenario 3: Dependency hell. Need to update lodash in every service because of a CVE?

in services/* "pnpm update lodash"

You'll find 50+ other real-world scenarios in the EXAMPLES.md file.

Why use in-cli?

Stop wasting time on tooling boilerplate. If you're managing a monorepo or a folder full of microservices, stop writing throwaway scripts to manage them. Check it out on GitHub, and let me know if it saves you a few keystrokes (and your sanity). Enjoy!