cli-git.io
shorten and unshorten GitHub.com URL.
Installation
npm install -g cli-git.io
or npm install --save cli-git.io
.
Usage
Globally installed (CLI)
gitio [ [-v|--version] | [-h|--help] | [ shorten [--check|-c]|unshorten <url> ]
Examples
Help information
$ gitio -h Usage: gitio [ [-v|--version] | [-h|--help] | [ shorten [--check|-c]|unshorten <url> ] ]
Version
$ gitio --version1.0.0
Shorten a github URL
- Ignore the validity of the URL
$ gitio shorten "https://github.com/Gyumeijie/cli-git.io"https://git.io/fx2Bg $ gitio shorten "https://github.com/Gyumeijie/non-existent-repo"https://git.io/fx2B9
- Check the validity of the URL
$ gitio shorten -c "https://github.com/Gyumeijie/non-existent-repo"Warning: https://github.com/Gyumeijie/non-existent-repo is not reachable!https://git.io/fx2B9 $ gitio shorten "https://github.com/Gyumeijie/non-existent-repo" -cWarning: https://github.com/Gyumeijie/non-existent-repo is not reachable!https://git.io/fx2B9
Unshorten a short URL
$ gitio unshorten https://git.io/fx2B9https://github.com/Gyumeijie/non-existent-repo $ gitio unshorten https://git.io/bad-path Notice: Woops! We can't seem to unshorten that URL, this could be for a few reasons: 1. it may not be a short URL in the first place;2. it may not be a real URL or could no longer be active;3. it may not be a short URL compatible with git.io!
Locally installed (APIs)
const githubURL = ;
Examples
Shorten a github URL
;
- Outputs result to stdout:
githubURL;
- Pass the result to a callback:
githubURL;
- Check the validity of rawURL
githubURL;
Unshorten a short URL
- Outputs result to stdout:
githubURL;
- Pass the result to a callback:
githubURL;
The GitHub.com URLs
The following are part of URLs which can be shorten or unshorten by cli-git.io
:
https://help.github.com
https://guides.github.com
https://gist.github.com
https://raw.githubusercontent.com
https://page.github.com
https://developer.github.com
https://user.github.io