npmci

workflow tools npm

Run npm ci in all directories that contain a package.json file. This is useful in monorepo setups or projects with multiple npm packages, allowing you to install all dependencies in a single command with clean installs.

Usage: git npmci

CLI Command

git config --global alias.npmci "!f() { git ls-files "*/package.json" | sed "s|/[^/]*$||" | sort -u | xargs -I {} sh -c "echo 'Running npm ci in {}' && cd {} && npm ci"; }; f"

.gitconfig Snippet

[alias]
  npmci = !f() { git ls-files "*/package.json" | sed "s|/[^/]*$||" | sort -u | xargs -I {} sh -c "echo 'Running npm ci in {}' && cd {} && npm ci"; }; f