~•~• ~• ~• ~•
█▀▀ █░█ █▀▄▀█
█▄▄ █▄█ █░▀░█
~• ~• ~• ~•~•
Cum stands for composer version manager, manage multiple composer versions with ease and written in rust for speed and reliability.
- 🚀 Fast and lightweight
- 📦 Install multiple composer versions
- 🔄 Switch between versions seamlessly
- 💾 Per-project version management with
.cumrc - 🗑️ Easy version removal
- 📋 List installed and available versions
- ✅ Linux
- ✅ Mac
- ⌛ Windows
- Rust 1.70+ (for building)
- Internet connection (for downloading composer versions)
# clone the project
git clone https://github.com/circleitdev/cum.git
# enter the project
cd cum/
# build the project
cargo build --release
# copy to a directory in your PATH for all users
sudo cp target/release/cum /usr/local/bin/
# or current user
cp target/release/cum ~/.local/bin/# check the existing version
cum --version
# enter the project
cd cum/
# pull the project
git pull
# build the project
cargo build --release
# copy to a directory in your PATH for all users
sudo cp target/release/cum /usr/local/bin/
# or current user
cp target/release/cum ~/.local/bin/
# certain the updated version
cum --versionAdd the following to your shell config:
# Add path to ~/.bashrc or ~/.zshrc or other shell
export PATH="$HOME/.cum/current:$PATH"Then reload your shell:
# bash
source ~/.bashrc
# or if you use zsh
source ~/.zshrc# install
cum install v2.9.3
# or use shorthand
cum i v2.9.3# use
cum use v2.9.3
# or use shorthand
cum u v2.9.3# create a `.cumrc` file in your project
echo "v2.9.3" > .cumrc
# run use
cum use# list
cum list
# or use shorthand
cum lsOutput example:
# list installed
Installed versions:
v2.5.8
v2.7.0
* v2.9.3 (active)# list remote
cum list-remote
# or use shorthand
cum ls-remote# current
cum current# remove
cum remove v2.9.3
# or use shorthand
cum rm v2.9.3# help
cum help
# or another version
cum --help
cum -h# version
cum --version
# or use shorthand
cum -v| Command | Alias | Description |
|---|---|---|
use <composer-version> |
u |
detect .cumrc and automatically switch valid composer version |
install <composer-version> |
i |
install a specific composer version |
remove <composer-version> |
rm |
remove an installed composer version |
list |
ls |
list all installed composer version(s) |
list-remote |
ls-remote |
list available composer version(s) from github |
current |
- |
show current active composer version |
help |
-h, --help |
print this help message |
--version |
-v |
print cum version |
CUM manages composer versions in ~/.cum/versions/ and creates a symlink at ~/.cum/current pointing to the active version.
~/.cum/
├── current -> versions/2.9.3
└── versions/
├── 2.7.9/
│ └── composer
│ └── composer.phar
├── 2.8.12/
│ └── composer
│ └── composer.phar
└── 2.9.3/
└── composer
└── composer.phar
When you run composer, it executes from ~/.cum/current/composer.phar.
-
Create
.cumrcin your project root:# generate echo "v2.9.3" > .cumrc
-
When entering the project, run:
# use cum use -
Add
.cumrcto your.gitignoreif it's personal preference, or commit it if your team should use the same version.
# Remove the binary for all users
sudo rm /usr/local/bin/cum
# or current user
rm ~/.local/bin/cum
# Remove data directory (optional)
rm -rf ~/.cum
# Remove PATH export from your shell config
# Edit ~/.bashrc or ~/.zshrc or other shell and remove:
# export PATH="$HOME/.cum/current:$PATH"Make sure ~/.cum/current is in your PATH:
# detect cum
echo $PATH | grep ".cum/current"If not found, add this to your shell config:
# export composer
export PATH="$HOME/.cum/current:$PATH"
# then reload
source ~/.bashrc
# or if you use zsh
source ~/.zshrcOn Unix systems, ensure composer.phar is executable:
# add executable permission
chmod +x ~/.cum/current/composer.pharCheck if the version exists:
# list remote
cum list-remoteVisit https://github.com/composer/composer/releases/ or https://getcomposer.org/download/ to see all available versions.
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
- [-] Automatic installation script
- [-] Unit test
- [-] Windows support
- [-] Publish release build in packages
- [-] Include executable in releases
- [-] NPM release
- [-] Cargo release
- [-] Many more