Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 1.75 KB

readme.org

File metadata and controls

46 lines (32 loc) · 1.75 KB

Digitalocean lisp api

Introduction

Emacs library for working with digitialocean, if you don’t have a digitalocean account consider creating one using this referal link for a perk for bot of us.

[https://m.do.co/c/f05b87f9fec9]

As usual I accept no responsibility for anything that goes wrong, as always backup in case something goes disastorusly wrong.

This was written to help me learn some lisp, the code is hopefully quite easy to follow as I am not an expert in lisp.

This plugin lets you control your droplets and create new ones, it also allows you to open an eshell to your droplet directly.

API Access Setup

First create a token on digitalocean, once created copy the token and set the digitalocean-token variable examples below.

(setq digitalocean-token (concat "Bearer " "you digitalocean token here."))

It is recommended you use a secure way of storing this, something like the below which uses the unix password store https://www.passwordstore.org/ plugin for emacs, but there are other options.

(setq digitalocean-token (concat "Bearer " (password-store-get "token/digitalocean")))

Getting started

All commands are prefixed “do/” and are not bound to any keys this is left to the user.

You will likely want to bind these methods to what ever keys you see fit.

(digitalocean-droplet-open-shell)
(digitalocean-droplet-snapshot)
(digitalocean-droplet-restart)
(digitalocean-droplet-shutdown)
(digitalocean-droplet-startup)
(digitalocean-droplet-destroy)
(digitalocean-droplet-simple-create)
(digitalocean-droplet-create-form)

You can customize digitalocean-default-directory to change the default shell path, usefull when utilized with .dir-locals.