Skip to content

MrLYC/cmdr

Repository files navigation

CMDR

unittest integration-test codecov Go version release

CMDR is a simple command version management tool that helps you quickly switch from multiple command versions.

Installation

Script

Run one for the following command to install the latest version of CMDR:

curl -o- https://raw.githubusercontent.com/MrLYC/cmdr/master/install.sh | ${SHELL:-bash}

For Chinese users, you can install the CMDR via a proxy:

curl -o- https://raw.githubusercontent.com/MrLYC/cmdr/master/install.sh | bash -s -p

Manual

  1. Download the latest release from GitHub;
  2. Make sure the download asset is executable;
  3. Run the following command to install the binary:
    /path/to/cmdr init
  4. Restart your shell and run the following command to verify the installation:
    cmdr version

Get Started

To install a new command, run the following command:

cmdr command install -n <command-name> -v <version> -l <path-or-url>

Then you can list the installed commands by running the following command:

cmdr command list -n <command-name>

Use a specified command version:

cmdr command use -n <command-name> -v <version>

Features

Upgrade

To upgrade the CMDR, just run:

cmdr upgrade

Url replacement

Speed up the download process by replacing the url to github proxy:

cmdr config set -k download.replace -v '{"match": "^https://raw.githubusercontent.com/.*$", "template": "https://ghproxy.com/{{ .input | urlquery }}"}'
cmdr command install -n install.sh -v 0.0.0 -l https://raw.githubusercontent.com/MrLYC/cmdr/master/install.sh