A TypeScript-based CLI tool to manage and run commands across project groups.
CLI-Projects helps you organize projects into groups and execute commands across all projects in a group simultaneously. Perfect for managing multiple related repositories, running batch operations, or keeping project groups in sync.
npm install -g cli-projectsOrganize your projects into logical groups with a base directory:
projects init # Create default config file
projects add <group-name> <base-path> # Add a new group
projects add-project <group> <project> # Add project to group
projects list <?group> # Show all groups or list specific group and their projectsExecute any command across all projects in a group:
projects run <group> -- '<command>' # Run command in each project directory
projects run <group> -n -- '<command>' # Run from base directory (not in each project)
projects run <group> -d -- '<command>' # Dry run (show what would execute)Config file location: ~/.config/cli-projects/config.yml
groups:
FRONTEND_PROJECTS:
base: ~/Development/vue
projects:
- accounts-app
- dashboard-app
- admin-panel
BACKEND_PROJECTS:
base: ~/Development/api
projects:
- accounts-api
- dashboard-apiCommands can use these environment variables:
${PROJECT}- Current project name${PROJECT_PATH}- Full path to project directory${PROJECT_BASE}- Base directory path
# Git pull all frontend projects
projects run FRONTEND_PROJECTS -- 'git pull'
# Check status with project name
projects run BACKEND_PROJECTS -- 'echo "Checking ${PROJECT}" && git status'
# Install dependencies across all projects
projects run FRONTEND_PROJECTS -- 'npm install'
# Run tests in all backend projects
projects run BACKEND_PROJECTS -- 'npm test'
# Dry run to preview commands
projects run FRONTEND_PROJECTS -d -- 'npm run build'This tool replaces and extends the functionality of a zsh projects function, bringing it to a cross-platform TypeScript implementation with better maintainability and extensibility.
git clone https://github.com/RensHoogendam/Cli-Projects.git
cd Cli-Projects
npm installnpm run buildnpm run devnpm link- Config file management (YAML)
- Project group CRUD operations
- Basic command execution across projects
- Environment variable substitution
- Dry run mode
- Colorized output with progress indicators
- Interactive mode with project selection
- Parallel execution option
- Output filtering and logging
- Git-specific commands (status, pull, push)
- Project templates
- Workspace support
- TypeScript - Type-safe development
- Commander.js - CLI framework
- Chalk - Terminal colors
- js-yaml - Config file parsing
- ora - Progress spinners
MIT
Contributions welcome! Please feel free to submit a Pull Request.