/davrosCLI

Shell script to interface with sandstorm's davros applications through webDAV and sandstorm webKeys.

Primary LanguageShellMIT LicenseMIT

DavrosCLI

This project is a Command Line Interface to the excellent davros App available on sandstorm.

It permits to download and upload files from a sandstorm davros app from the command line.

To use it, from sandstorm, either create a new davros grain or use an existing one. Generate a new web key with the icon looking like a key (Get webkey). Give it the permissions you want; if you want to upload files, it may be better to give write access :). Copy paste the whole key into a new shell script (An example is following).

Webkeys look like this :

https://api-3c31169062d772c4b37a5ac639c6c6d5c5632c.sandstorm.io#3805f158f3c5ec84e60471aa10ecaf7cda8d3fe7

your shell script could be like so :

#! /bin/sh

webkey=https://api-3c31169062d772c4b37a5ac639c6c6d5c5632c.sandstorm.io#3805f158f3c5ec84e60471aa10ecaf7cda8d3fe7

sh ~/src/davrosCLI/davros.sh $webkey "$@"

at that point, you can use that shell script to interface with your davros grain. The commands available are similar to what is available in sftp and such. To get a list of available commands, just run the script without any arguments.

Usage example

say we saved the above script to the file 'myDavros.sh', here’s how to upload a file

We first create a new directory :

sh myDavros.sh mkdir /stuff

Say we wanted to upload the files : foo1.txt, foo2.txt, video.mp4, ebook.epub

We can do it like so :

sh myDavros.sh put foo1.txt foo2.txt video.mp4 ebook.epub /stuff/

The last entry is always the destination directory and it is mandatory to end it with a slash (/).