Skip to content
A small CLI tool to infer the clone URL by the current path and arguments.
Branch: python
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A small CLI tool to infer the clone URL by the current path and arguments.


There are now two versions. One is in Python, one is in D. If you're a static-typed guy, follow the instructions below. But if you have Python, just run pip install cbp and continue to the next section, Usage.

Linux, place the cbp file in /usr/bin/ and make it executable with sudo chmod +x /usr/bin/cbp.

Windows, save cbp.exe somewhere and expose its location to your system PATH environment variable.


The best way to understand how this works is to read the source code. It can be a little confusing otherwise.

cbp <repo> [args...]

CBP assumes that each repository URL is three parts. The domain, the author, and the repository name. It is also assumed that these are delimited by a forward-slash (/). All arguments after the <repo> position are passed as arguments to the subsequent git clone command.

There are several examples to help you understand how the command works. Pay attention to the current working directory, the generated clone command, and the directory to clone into.

spikespaz@jacob-linux:~$ cbp
> git clone
Cloning into ''...
spikespaz@jacob-windows:~/$ cbp spikespaz/clone-by-path
> git clone spikespaz/clone-by-path
Cloning into 'spikespaz/clone-by-path'...
spikespaz@jacob-windows:~/$ cbp clone-by-path
> git clone clone-by-path
Cloning into 'clone-by-path'...
spikespaz@jacob-windows:~/$ cbp .
> git clone .
Cloning into '.'...

If you find this software useful and would like to show your appreciation, please consider making a small donation!


You can’t perform that action at this time.