rmapi

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

README

rMAPI

Build Status

rMAPI is a Go app that allows you to access the ReMarkable Cloud API programmatically.

You can interact with the different API end-points through a shell. However, you can also run commands non-interactively. This may come in handy to script certian workflows such as taking automatic backups or uploading documents programmatically.

Console Capture

Some examples of use

Tutorial on how to directly print to your reMarkable on Mac with rMAPI

Install

From sources

Install and build the project:

go get -u github.com/juruen/rmapi

Binary

You can download an already built version for either Linux or OSX from releases.

API support

  • list files and directories
  • move around directories
  • download a specific file
  • download a directory and all its files and subdiretores recursively
  • create a directory
  • delete a file or a directory
  • move/rename a file or a directory
  • upload a specific file
  • live syncs

Annotations

  • Initial support to generate a PDF with annotations from Quick Sheet and notebooks.

Shell ergonomics

  • autocomplete
  • globbing
  • upload a directory and all its files and subdirectories recursively

Commands

Start the shell by running rmapi

List current directory

Use ls to list the contents of the current directory. Entries are listed with [d] if they are directories, and [f] if they are files.

Change current directory

Use cd to change the current directory to any other directory in the hierarchy.

Find a file

The command find takes one or two arguments.

If only the first argument is passed, all entries from that point are printed recursively.

When the second argument is also passed, a regexp is expected, and only those entries that match the regexp are printed.

Golang standard regexps are used. For instance, to make the regexp case insensitve you can do:

find . (?i)foo

Upload a file

Use put path_to_local_file to upload a file to the current directory.

You can also specify the destination directory:

put book.pdf /books

Recursively upload directories and files

Use mput path_to_dir to recursively upload all the local files to that directory.

E.g: upload all the files

mput /Papers

Console Capture

Download a file

Use get path_to_file to download a file from the cloud to your local computer.

Recursively download directories and files

Use mget path_to_dir to recursively download all the files in that directory.

E.g: download all the files

mget .

Download a file and generate a PDF with its annoations

Use geta to download either a Quick Sheets or notebook file and generate a PDF document with its annotations.

Please note that its support is very basic for now and only supports one type of pen for now, but there's work in progress to improve it.

Create a directoy

Use mkdir path_to_new_dir to create a new directory

Remove a directory or a file

Use rm directory_or_file to remove. If it's directory, it needs to be empty in order to be deleted.

You can remove multiple entries at the same time.

Move/rename a directory or a file

Use mv source destination to move or rename a file or directory.

Stat a directory or file

Use stat entry to dump its metadata as reported by the Cloud API.

Run command non-interactively

Add the commands you want to execute to the arguments of the binary.

E.g: simple script to download all files from the cloud to your local machine

$ rmapi mget .

rMAPI will set the exit code to 0 if the command succeedes, or 1 if it fails.

Environment variables

  • RMAPI_CONFIG: filepath used to store authentication tokens. When not set, rmapi uses the file .rmapi in the home directory of the current user.
  • RMAPI_TRACE=1: enable trace logging.
  • RMAPI_USE_HIDDEN_FILES=1: use and traverse hidden files/directories (they are ignored by default).

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package archive is used to parse a .zip file retrieved by the API.
Package archive is used to parse a .zip file retrieved by the API.
encoding
rm
Package rm provides primitives for encoding and decoding the .rm format which is a proprietary format created by Remarkable to store the data of a drawing made with the device.
Package rm provides primitives for encoding and decoding the .rm format which is a proprietary format created by Remarkable to store the data of a drawing made with the device.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL