Command line tool for kutt.it
cargo install kutt
kutt --login your-api-key
# or
export KUTT_API_KEY='your-api-key'
kutt --target-url https://github.com/ --custom-url your-domain
# or
echo 'https://github.com/' | kutt -c your-domain
USAGE:
kutt [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --custom-url <DOMAIN> Set a domain name
-d, --delete <URL> Set a url
-l, --login <API_KEY> Set a apikey
-p, --password <PASSWORD> Set a password
-t, --target-url <URL> Set a url
cargo add kutt
extern crate dotenv;
extern crate kutt;
use dotenv::dotenv;
use kutt::Kutt;
fn main() {
dotenv().ok(); // read KUTT_API_KEY in .env file
let slink = Kutt::target_url("https://addr-example...")
.custom_url("custom-url")
.create_short_link()
.unwrap();
println!("{}", slink);
}