in is a lightweight Bash-based CLI tool that allows you to execute commands in directories simultaneously or sequentially. It supports glob patterns, brace expansion, comma-separated lists, and parallel execution.
- Flexible Targets: Specify directories using standard wildcards (
project*), brace expansion (by shell), comma-separated lists (front,back), or exact paths. - Parallel Execution: Run commands concurrently across directories using
-P. - Zero Dependencies: Pure Bash script (requires Bash 3.2+).
- Subshell Isolation: Commands run in subshells, keeping your current working directory intact.
in [OPTIONS] [DIRECTORIES...] [--] COMMAND...Recommendation: It is optional but highly recommended to quote your command string (e.g., in * "git status").
Quoting is mandatory if your command contains:
- Shell operators:
&&,||,;,|,> - Wildcards belonging to the command:
*,?(e.g.,rm *.log)
| Flag | Description |
|---|---|
-d, --dry |
Dry run (print commands without executing). |
-h, --help |
Show help message. |
-P, --parallel N |
Run in parallel with N jobs (default: 1). |
-v, --verbose |
Enable verbose output (debug logs). |
See EXAMPLES.md for 50+ real-world examples.
# Git operations
in project* git status
in repos/* git pull
# Package management
in packages/* npm install
in frontend,backend yarn build
# Parallel execution (faster builds)
in -P 4 packages/* pnpm build
# Command Chaining (runs in shell automatically when quoted)
in packages/* "pnpm update && git commit -am 'update' && git push"
in services/* "docker build . || echo 'Build failed'"
# Dry Run (Preview what will happen)
in -d packages/* "rm -rf node_modules"
# Shell features (pipes, redirects, wildcards inside dir)
in src/* "ls -l | grep .ts"
in logs/* "rm *.old"
in ./* "wc -l *.json > stats.txt"When using wildcards (glob patterns) like *.txt in your command, your shell (bash/zsh) will try to expand them before running in
-
❌ Incorrect:
in projects/* ls *.txtIssue: The shell expands*.txtin your current directory, not insideprojects/*. If no txt files exist locally, it might fail or pass the literal string. -
✅ Correct:
in projects/* ls my-file.txtWorks because no wildcards are used. -
✅ Correct:
in projects/* "ls *.txt"Why: By quoting"ls *.txt",inautomatically enables shell mode, protecting the wildcard from your current shell so it expands inside each target directory.
Run the installer script:
curl -sL https://raw.githubusercontent.com/inevolin/in-cli/main/install.sh | bashTo install with a custom name (e.g., indo or in-cli) to avoid conflicts with the shell keyword in, pass the name as an argument:
curl -sL https://raw.githubusercontent.com/inevolin/in-cli/main/install.sh | bash -s -- indoNon-root Installation: If you do not have sudo privileges or prefer to install to a specific directory (e.g., ~/.local/bin), you can override the destination using the DEST_DIR environment variable:
curl -sL https://raw.githubusercontent.com/inevolin/in-cli/main/install.sh | DEST_DIR=~/.local/bin bash -s -- indo- Clone the repo or download
in.sh. - Make it executable:
chmod +x in.sh - Move to your path:
sudo mv in.sh /usr/local/bin/in
While tools like find and xargs are powerful, constructing correct commands for simple tasks is often cumbersome and error-prone.
Compare:
Running git status in all subdirectories:
With find:
find . -maxdepth 1 -type d -not -name '.' -execdir git status \;With xargs:
ls -d */ | xargs -I {} sh -c 'cd {} && git status'With in:
in * git statusWhy in is simpler:
- No boilerplate: Forget about
-maxdepth,-execdir,-print0, or complexxargsflags. - Intuitive: It works just like running a command, but applied to multiple places.
- Safety defaults: Handles directory paths with spaces correctly without arcane flags.
- Easy Parallelism: Just add
-P 4to run 4 jobs at once. Doing this withxargsoften leads to complex quoting or syntax.
To remove in, delete the executable from your path:
sudo rm "$(which in)"This project includes a comprehensive test suite covering all features and regressions.
# Run all tests
./tests.sh- Shell: Bash 3.2 or higher
- Operating Systems:
- Linux (all distributions)
- macOS 10.5+
- BSD systems (FreeBSD, OpenBSD, NetBSD)
- Windows (via WSL, Git Bash, or Cygwin)
- Dependencies: None (pure Bash)
Contributions are welcome! Feel free to open a pull request with improvements, bug fixes, or new features.
MIT License. See LICENSE for details.
