Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nicolodiamante/gitio

Make URL shortening effortless with the Zsh Plugin for GitHub.
https://github.com/nicolodiamante/gitio

git-io gitio ohmyzsh ohmyzsh-plugin plugin plugin-extension shorten-urls url url-shortener url-shortener-microservice url-shortner vanity-address vanity-url zsh

Last synced: 6 days ago
JSON representation

Make URL shortening effortless with the Zsh Plugin for GitHub.

Awesome Lists containing this project

README

        




gitio

Git URLs can become cumbersome due to the long file names, leading to lengthy and often messy URLs that can be difficult to read. This can be particularly problematic when sharing URLs via email or social media. To address this issue, this plugin has been developed to use curl to shorten URLs, inspired by a similar service offered by GitHub called [Git.io][gitio]. The use of shortened URLs can not only improve readability but also make sharing URLs more convenient and efficient. This plugin allows users to enjoy the benefits of short and catchy Git URLs.


> Note: This script utilises Git.io for URL shortening. Please be advised that as of January 2022, Git.io has announced that it is no longer accepting new links for shortening. Any links already shortened via Git.io will continue to operate as usual and stay accessible.


## Getting Started

Download the repository via curl:

```shell
zsh -c "$(curl -fsSL https://raw.githubusercontent.com/nicolodiamante/gitio/HEAD/bootstrap.zsh)"
```

Alternatively, you can clone the repository manually:

```shell
git clone https://github.com/nicolodiamante/gitio.git ~/gitio
```

Once you have downloaded the repository, navigate to the root directory of the repository, and then execute the installation script using the following command:

```shell
source utils/install.sh
```

The script is designed to search for the zshrc file and append the complete path to the gitio/script directory to the fpath variable. By doing this, the script ensures that the script directory is added to the list of paths that Zsh searches for when looking for executable scripts.

```shell
fpath=(~/gitio/script $fpath)
autoload -Uz gitio
```


### Install via [Oh My Zsh][ohmyzsh]

```shell
git clone https://github.com/nicolodiamante/gitio.git $ZSH_CUSTOM/plugins/gitio
```

- Add to your zshrc plugins array `plugins=(... gitio)`
- Restart the shell to activate


## How to use gitio

- `gitio` when lanced into a Git repository, the plugin will look for the URL in the config file located in the .git directory.

- `gitio [URL]` shortens the URL but does not provide a vanity name for the shortened URL, resulting in no control over the output.

- `gitio [URL] [vanity-name]` it allows users to provide a vanity name for the shortened URL. In a Git repository instead of having to type out the entire URL, users can simply enter the username/repo and the plugin will handle the rest.

- `gitio --retrieve [URL]` fetch the full URL from the abbreviated URL.

- `gitio --open [URL]` designed to exclusively function with GitHub URLs, will automatically launch the default browser to access the shortened URL.

For full gitio options, see `gitio --help`.


## Notes

### Resources

- [The GitHub Blog][git-blog]

### Contribution

Any suggestions or feedback you may have for improvement are welcome. If you encounter any issues or bugs, please report them to the [issues page][issues].




>



Nicolò Diamante Portfolio




MIT License

[gitio]: https://git.io
[ohmyzsh]: https://github.com/robbyrussell/oh-my-zsh/
[git-blog]: https://github.blog/2011-11-10-git-io-github-url-shortener/
[issues]: https://github.com/nicolodiamante/gitio/issues