Command-line utility for managing DigitalOcean infrastructure

Overview

docli-rs (pronounced "dockly")

Build Status GitHub release GitHub license Join the chat at https://gitter.im/kbknapp/docli-rs

A command-line utility for managing DigitalOcean infrastructure via the DigitalOcean API v2

Disclaimer

This utility is in beta - it may do anything up to, and including, eating your laundry. You can check the request being sent to DigitalOcean without actually sending by using the docli --nosend --verbose <command> (which can be shortened to docli -nv <command>)

Installation

Linux / OSX

If you are on Arch linux, you can install from the AUR via the docli-bin or docli-git (-git requires a nightly Rust compiler and git).

Linux or OS X (x86_64) Binaries

Download the tar.gz, untar, and copy to somewhere in your $PATH (if on OS X, replace linux with osx)

$ wget http://wod.twentyfives.net/bin/docli/docli-0.1.0-beta2-x86_64-linux.tar.gz
$ tar xvf docli-0.1.0-beta2-x86_64-linux.tar.gz
$ cp docli-0.1.0-beta2-x86_64-linux/bin/docli ~/.bin

In the example ~/.bin is in $PATH

Windows (None yet...)

I have not tried compiling on Windows [yet]. Feel free to clone the repository and attempt to compile with a nightly Rust compiler.

Compile from source

If you'd rather compile from source (takes about 2 minutes on a decent machine) use the following:

Note: Currently, you must use Rust nightly in order to compile.

$ git clone https://github.com/kbknapp/docli-rs
$ cd docli-rs
$ cargo build --release
$ cp target/release/docli ~/.bin

Usage

You can run docli from the command line and along with various subcommands to perform actions on your DigitalOcean infrastructure. In order to see what commands are available, run docli --help or docli <command> --help

docli v0.1.0
Kevin K. <[email protected]>
A utility for managing DigitalOcean infrastructure

USAGE:
    docli [FLAGS] [OPTIONS] [SUBCOMMANDS]

FLAGS:
    -h, --help       Prints help information
    -n, --nosend     Does NOT send request over the network (useful with --verbose)
        --version    Prints version information
    -v, --verbose    Displays the request being sent to server and JSON reply

OPTIONS:
    -t, --token <token>        Digital Ocean Auth Token (Defaults to contents of DO_AUTH_TOKEN env var if omitted)

SUBCOMMANDS:
    account     Show account information and actions
    dns         Manage DNS records on a specific domain
    domains     Manage domains
    droplet     Manage a specific droplet
    droplets    Manage droplets
    help        Prints this message
    image       Manage images
    list        Get information from DigitalOcean about various sections
    ssh-keys    Manage SSH keys

DigitalOcean Personal OAuth Token

In order to use the DigitalOcean v2 API (which is what docli uses under the covers, you must generate a Personal Authentication Token. This token can then either be passed to docli directly with --token <token> or you can set a DO_AUTH_TOKEN environmental variable before using docli. To do so using Linux or OSX, open a terminal and run the following (test with docli account which lists your account information):

$ export DO_AUTH_TOKEN=<PASTE YOUR TOKEN HERE>
$ docli account

Personal Auth Token's can be Read/Write, or Read Only/Write Only. In order to process destructive API calls (i.e. ones that modify existing information) you must have a token with Write priviledges.

To generate a new Personal Auth Token see the following DigitalOcean details

Contributing

Contributions are always welcome! And there is a multitude of ways in which you can help depending on what you like to do, or are good at. Anything from documentation, code cleanup, issue completion, new features, you name it, even filing issues is contributing and greatly appreciated!

NOTE: One of the best ways to help right now is to simply use the utility and report issues!

  1. Fork docli
  2. Clone your fork (git clone https://github.com/$YOUR_USERNAME/docli-rs && cd docli-rs)
  3. Create new branch (git checkout -b new-branch)
  4. Make your changes, and commit (git commit -am "your message")
  • I use a conventional changelog format so I can update my changelog using clog
  • Format your commit subject line using the following format: TYPE(COMPONENT): MESSAGE where TYPE is one of the following:
    • feat - A new feature
    • imp - An improvement to an existing feature
    • perf - A performance improvement
    • docs - Changes to documentation only
    • tests - Changes to the testing framework or tests only
    • fix - A bug fix
    • refactor - Code functionality doesn't change, but underlying structure may
    • style - Stylistic changes only, no functionality changes
    • wip - A work in progress commit (Should typically be git rebase'ed away)
    • chore - Catch all or things that have to do with the build system, etc
  • The COMPONENT is optional, and may be a single file, directory, or logical component. Can be omitted if commit applies globally
  1. git rebase into concise commits and remove --fixups (git rebase -i HEAD~NUM where NUM is number of commits back)
  2. Push your changes back to your fork (git push origin $your-branch)
  3. Create a pull request! (You can also create the pull request first, and we'll merge when ready. This a good way to discuss proposed changes.)
Comments
  • Add a Gitter chat badge to README.md

    Add a Gitter chat badge to README.md

    kbknapp/docli-rs now has a Chat Room on Gitter

    @kbknapp has just created a chat room. You can visit it here: https://gitter.im/kbknapp/docli-rs.

    This pull-request adds this badge to your README.md:

    Gitter

    If my aim is a little off, please let me know.

    Happy chatting.

    PS: Click here if you would prefer not to receive automatic pull-requests from Gitter in future.

    opened by gitter-badger 0
  • Confirm dns command

    Confirm dns command

    • [x] docli dns <domain> records
    • [x] docli dns <domain> create-record <type> [rec_name] [data] [priority] [port] [weight]
    • [x] docli dns <domain> record <id>
    • [x] docli dns <domain> update-record <id> <type> [rec_name] [data] [priority] [port] [weight]
    • [x] docli dns <domain> delete-record <id>
    cli 
    opened by kbknapp 0
  • Confirm ssh-keys command

    Confirm ssh-keys command

    • [x] docli ssh-keys create <name> <public_key>
    • [x] docli ssh-keys show-key <id>
    • [x] docli ssh-keys rename <id> <name>
    • [x] docli ssh-keys destroy <id>
    • [x] docli ssh-keys
    cli 
    opened by kbknapp 0
  • Confirm droplets command

    Confirm droplets command

    • [x] docli droplets neighbors
    • [x] docli droplets upgrades
    • [x] docli droplets
    • [x] docli droplets create <name> <region> <size> <image> [ssh_keys] [--backups] [--ipv6] [--private-networking] [user_data]
    cli 
    opened by kbknapp 0
  • Confirm droplet command

    Confirm droplet command

    • [x] docli droplet <id>
    • [x] docli droplet <id> kernels
    • [x] docli droplet <id> snapshots
    • [x] docli droplet <id> backups
    • [x] docli droplet <id> actions
    • [x] docli droplet <id> delete
    • [x] docli droplet <id> neighbors
    • [x] docli droplet <id> disable-backups
    • [x] docli droplet <id> reboot
    • [x] docli droplet <id> power-cycle
    • [x] docli droplet <id> shutdown
    • [x] docli droplet <id> power-off
    • [x] docli droplet <id> power-on
    • [x] docli droplet <id> restore <image>
    • [x] docli droplet <id> reset-password
    • [x] docli droplet <id> resize [--disk] <size>
    • [x] docli droplet <id> rebuild <image>
    • [x] docli droplet <id> rename <name>
    • [x] docli droplet <id> change-kernel <kernel>
    • [x] docli droplet <id> enable-ipv6
    • [x] docli droplet <id> enable-private-networking
    • [x] docli droplet <id> snapshot <name>
    • [x] docli droplet <id> action <action_id>
    • [x] docli droplet <id> upgrade
    cli 
    opened by kbknapp 0
  • Confirm image command

    Confirm image command

    • [x] docli image <id> actions
    • [x] docli image <id>
    • [x] docli image <id> rename
    • [x] docli image <id> delete
    • [x] docli image <id> transfer <region>
    • [x] docli image <id> convert
    • [x] docli image <id> action <action_id>
    cli 
    opened by kbknapp 0
  • Confirm list command

    Confirm list command

    • [x] docli list regions
    • [x] docli list sizes
    • [x] docli list images
    • [x] docli list ssh-keys
    • [x] docli list droplets
    • [x] docli list domains
    • [x] docli list account-actions
    opened by kbknapp 0
  • The new

    The new "Floating IPs" are not handled

    ❯ ./target/debug/docli account
    :: Displaying account information...Failed
    
        unknown field "floating_ip_limit" at line 0 column 0
    

    (I do have $DO_AUTH_TOKEN set.)

    This makes it impossible to retrieve account information, though droplet / SSH key information retrieval seems to work.

    bug 
    opened by yberreby 0
Releases(v0.1.0-beta2)
Owner
Kevin K.
I love to code, skydive, and do the things.
Kevin K.
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
A utility for managing cargo dependencies from the command line.

cargo edit This tool extends Cargo to allow you to add, remove, and upgrade dependencies by modifying your Cargo.toml file from the command line. Curr

Pascal Hertleif 2.7k Jan 6, 2023
Wrapper library for utilizing DigitalOcean API v2 in Rust

doapi-rs Wrapper library for utilizing DigitalOcean API v2 in Rust Disclaimer This library is in alpha - it may do anything up to, and including, eati

Kevin K. 30 Nov 5, 2022
A command line tool for managing financial investment portfolios written in Rust.

A command line tool for managing financial investment portfolios written in Rust. This project is the modern successor of finance. Installation You ca

Markus Zoppelt 15 Dec 21, 2022
Lockbox is a command-line tool for generating and managing passwords

Lockbox is a command-line tool for generating and managing passwords. It uses strong encryption algorithms to securely store your passwords, so you can be sure that your data is safe.

Sonu Bardai 15 Oct 9, 2023
An utility application to help managing your C++ OI workspaces.

oi_helper oi_helper is an utility application to help managing your C++ OI workspaces. Why oi_helper We all know that we often need a project manager

27Onion Nebell 11 Aug 24, 2022
The Zero Knowledge Whitelist Tool is a powerful utility for managing an address whitelist using Zero-Knowledge (ZK) proofs.

zk_whitelist: A Zero Knowledge Whitelist Tool The Zero Knowledge Whitelist Tool is a powerful utility for managing an address whitelist using Zero-Kno

Nikos Koumbakis 4 Nov 21, 2023
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
🧑🏻‍⚕️ Command-line utility which poll on remote addresses in order to perform status checks periodically

ナース (Nāsu) ????‍⚕️ Command-line utility which poll on remote addresses in order to perform status checks periodically Motivation Nāsu (from Japanese ナ

Esteban Borai 13 Nov 14, 2021
fixred is a command line utility to fix outdated links in files with redirect URLs.

fixred fixred is a command line utility to fix outdated links in files with redirect URLs. Installation fixred is installed via cargo package manager.

Linda_pp 35 Aug 6, 2022
A simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art version constructed with emoji

EmojiPix This is a simple command-line utility (and Rust crate!) for converting from a conventional image file (e.g. a PNG file) into a pixel-art vers

Michael Milton 22 Dec 6, 2022
Rust command line utility to quickly display useful secrets in a Kubernetes namespace

kube-secrets This is a command line utility for quickly looking at secrets in a Kubernetes namespace that are typically looked at by humans. It specif

Frank Wiles 8 Feb 10, 2022
A command-line utility that creates project structure.

petridish A command-line utility that creates project structure. If you have heard of the cookiecutter project, petridish is a rust implementation of

null 11 Dec 29, 2022
Command line utility for controlling LIFX smart lights

lifxc is a command line utility for controlling LIFX smart lights. Currently, communication over the LIFX LAN protocol is supported.

Harrison Rigg 1 Nov 17, 2021
Gecko's trusty package manager and command-line utility.

Geckos have super-powers, ya'know? Grip is Gecko's trusty package manager and command-line utility. USAGE: grip [FLAGS] [file] [SUBCOMMAND] FLAGS

Gecko 2 Jan 3, 2022
ruby-build is a command-line utility that makes it easy to install virtually any version of Ruby, from source.

ruby-build ruby-build is a command-line utility that makes it easy to install virtually any version of Ruby, from source. It is available as a plugin

null 3.7k Jan 5, 2023
A simplified recreation of the command-line utility grep written in Rust.

smolgrep A simplified recreation of the command-line utility grep written in Rust. Download and run Download Rust On Mac/Linux Open a terminal and ent

Thi Dinh 0 Dec 27, 2021
A command line utility to easily make dank memes

meme-cli A command line utility to easily make dank memes. Yes, really. Installation cargo install meme-cli Alternatively, install from source using g

null 196 Dec 26, 2022
Rs.aws-login - A command line utility to simplify logging into AWS services.

aws-login A command line utility to simplify logging into AWS accounts and services. $ aws-login use ? Please select a profile to use: › ❯ dev-read

Kevin Herrera 11 Oct 30, 2022