Quick Start¶
This guide will help you get started with CMDR in just a few minutes.
Installing Your First Command¶
Let's install a command version. CMDR can download from URLs or use local files:
# Install from URL
cmdr command install -n <command-name> -v <version> -l <url-or-path>
# Example: Install a specific script
cmdr command install -n hello -v 1.0.0 -l /usr/local/bin/hello
Flags Explained¶
| Flag | Long Form | Description |
|---|---|---|
-n |
--name |
Name of the command |
-v |
--version |
Version string (semantic versioning recommended) |
-l |
--location |
URL or file path to command binary |
Listing Installed Commands¶
View all versions of a specific command:
View all managed commands:
Switching Versions¶
Activate a specific version of a command:
After running this, the command will point to the specified version.
Removing Commands¶
Remove a specific version:
Practical Example¶
Let's walk through managing multiple versions of a tool:
# 1. Install version 1.0.0
cmdr command install -n mytool -v 1.0.0 -l https://example.com/mytool-1.0.0
# 2. Install version 2.0.0
cmdr command install -n mytool -v 2.0.0 -l https://example.com/mytool-2.0.0
# 3. List all installed versions
cmdr command list -n mytool
# 4. Use version 1.0.0
cmdr command use -n mytool -v 1.0.0
# 5. Verify
mytool --version # Should show 1.0.0
# 6. Switch to version 2.0.0
cmdr command use -n mytool -v 2.0.0
# 7. Verify again
mytool --version # Should show 2.0.0
How Version Switching Works¶
When you run cmdr command use, CMDR:
- Looks up the command in its database1
- Creates or updates a shim script in
~/.cmdr/shims/2 - The shim redirects to the actual binary location
Since ~/.cmdr/shims is in your PATH, running the command name executes the shim, which runs the correct version.
Next Steps¶
- Configure CMDR - Customize behavior with configuration
- Architecture Overview - Understand how CMDR works internally
-
Command query in
core/command.goL25-L34 ↩ -
Shim management in
core/strategy/↩