Giter Site home page Giter Site logo

dropletconn's Introduction

dropletconn

List and connect to your Digital Ocean droplets instantly (without a .ssh/config)

Quick Start

go get github.com/theonejb/dropletconn
go install github.com/theonejb/dropletconn
dropletconn config
dropletconn list
dropletconn connect <NAME OF DROPLET>

Installing and Configuring dropletconn

Install and Configure dropletconn

Listing your droplets

List droplets using dropletconn

Connecting to a droplet

Connect to a droplet using dropletconn

Usage

To use, go get github.com/theonejb/dropletconn and go install github.com/theonejb/dropletconn. dropletconn is the name of the genrated binary. I personally have it aliased to dc using export dc=dropletconn in my .zshrc file since I use it atleast 20 times a day to connect to various servers at work.

You will also need to generate a token from Digital Ocean API Tokens that dropletconn will use to get a list of droplets available in your account. For safety, use a Read only scoped token.

Available commands and their usage is described here. Some commands have a short version as well, which is what you see after the OR pipe (|) in their help text below.

  • config: Generate config file that stores the API token and other settings. This needs to be generated before the rest of the commands can be used
  • list | l [<FILTER EXPRESSION>]..: Lists all droplets from your account. You can optionally pass a number of filter expressions. If you do, only droplets whose names or IPs contain at least one of the given fitler expressions will be listed
  • connect | c NAME: Connect to the droplet with the given name
  • run | r <FILTER EXPRESSION> <COMMAND>: Runs the given command on all droplets matching the filter expression. The filter expression is required, and only one filter expression can be given

You can pass an optional --force-update flag. By default, the list of droplets is cached for a configurable duration (as set in the config file). Passing this flag forces an update of this list before running the command.

The list command also accepts an options --list-public-ip flag. If this flag is used only the public IP of the nodes is printed, nothing else. This is incase you want a list of all IPs in your DO account. I needed this to create a Fabric script.

Note: The way flags are parsed, you have to list your flags before your commands. For example, you can not do dropletconn list --list-public-ip. Instead, you need to do dropletconn --list-public-ip list. Same for the --force-update flag.

To enable completion of droplet names, source the included Zsh completion file. Credit for that script goes to James Coglan. I copied it from his blog (https://blog.jcoglan.com/2013/02/12/tab-completion-for-your-command-line-apps/).

dropletconn's People

Contributors

theonejb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

albertono2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.