cpman is a command-line tool for managing Docker Compose or Podman Compose projects. It helps users easily stop, start, or update multiple compose projects.
- Automatically finds and manages multiple compose files
- Supports Docker Compose and Podman Compose
- Can stop, start, or update all found compose projects
- Provides both interactive menu and command-line argument usage
- Supports specifying search paths and operation modes
- Can exclude specific files or directories
- Linux operating system
- GCC compiler
- Make tool
- Docker or Podman (and corresponding compose tools)
- Clone this repository:
git clone https://github.com/yourusername/cpman.git
cd cpman
-
Compile the program:
make
-
Install the program (optional, requires root privileges):
sudo make install
Installs to
/usr/local/bin
by default. To install to a different directory, use:sudo make install INSTALL_DIR=/your/preferred/path
cpman [OPTIONS]
Options:
-p PATH Specifies the path to search for compose files
-m MODE Specifies the operation mode: 1 (stop), 2 (start), 3 (update, default)
-e PATTERN Excludes files or directories matching PATTERN
--help Displays help information
- Search the current directory and update all compose projects:
cpman
-
Search a specific directory and stop all compose projects:
cpman -p /path/to/projects -m 1
-
Search a specific directory and start all compose projects:
cpman -p /path/to/projects -m 2
-
Search and update all compose projects, but exclude files or directories containing "test":
cpman -e "test"
-
Search a specific directory and start all compose projects, but exclude files or directories containing "dev":
cpman -p /path/to/projects -m 2 -e "dev"
If no operation mode is specified, cpman will display an interactive menu allowing the user to choose the desired action.
- The program ignores directories containing "ignore"
- Ensure you have sufficient permissions to manage Docker or Podman
- The update operation will first attempt to pull new images and only restart services if there are updates
- The exclusion pattern (-e) uses simple string matching and will exclude all files and directories that contain the specified string in their path
If you installed the program using make install
, you can uninstall it using the following command:
sudo make uninstall
cpman does not use a configuration file. All settings are specified via command-line arguments.
If you encounter problems:
- Ensure you have the correct permissions to access compose files and execute Docker/Podman commands
- Check your PATH environment variable to ensure that docker-compose or podman-compose can be found
- Use the
--help
option to see all available command-line arguments
Bug reports and pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- 1.1.0 - Added the ability to exclude files/directories
- 1.0.0 - Initial release
[Your Name] - [Your Email]
This project is licensed under the MIT License - see the LICENSE file for details