Skip to content
✂️ A terminal program that shortens URLs using Bitly.
Branch: master
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.

Build Status

This is a small command line program that shortens a URL, using the service.

As one of my first projects written in the Rust programming languages the code in this repository might not be the best in terms of style. Please, feel free to open an issue or a PR to help me improve my code!

Getting started

To use this program, follow these steps:

  1. Clone the repository with
$ git clone
  1. Build the project.
$ cd bitly-rs
$ cargo build --release

Of course you can spare the release flag if you want to help me develop this program.

  1. Run it!
$ target/release/bitly
Please enter your token:
[enter your token here]

Note that you will be asked for a access token the first time you run the script. It will be saved to ~/.bitly-rs.


Use $ bitly [long URL] to shorten any URL that comes to your mind.


  • Basic functionality
  • manage OAuth2 Access Token more elegant
  • take URL as command line argument
  • Error Handling (e.g. no network)
  • Better URL parsing
  • change/remove the saved token
  • Refactoring
  • Documentation


I am in no way associated with Bitly™, the only reason that this project uses Bitly as shortening service is that it has a nice API that is easy to handle. $other_shortening_service might also do a good job, sure!


bitly is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.