Command line interface for Re:infer
API Documentation | Website
re
is the official command line interface for Re:infer. It simplifies managing resources, such as sources and datasets, as well as importing or exporting communications data. Additionally, re
maintains multiple contexts, making it easy to switch between multiple authentication tokens for different users (and endpoints for multiple clusters if needed).
API Library
The api directory contains a Rust client library for reinfer which can be used for API access independently. Please refer to that directory for more information. The rest of the README is about the command line tool for managing reinfer resources.
Features
- Create, get, update and delete operations for sources, datasets, comments and more.
- Context management for multiple endpoints (reinfer clusters) and user tokens.
- Upload new verbatims to a source.
- Easily download raw verbatims from a set of sources and datasets together with human applied annotations. Useful for backups, migrating data or for applying some transformations to the data.
- Basic shell autocompletion for
zsh
andbash
. - Colorized terminal output and progress bars.
Demo
Installation
Binary
Statically linked binaries with no dependencies are provided for selected platforms:
- Linux (x86_64-unknown-linux-musl)
- macOS (x86_64-apple-darwin)
- Windows (x86_64-pc-windows-gnu)
Debian / Ubuntu
You can download a .deb
package here.
From Source
To build from source, you need a recent version of the Rust toolchain installed.
Using cargo install
To install using cargo install
run the following.
Ensure you have the cargo bin directory in your path (typically ~/.cargo/bin
).
Manual
Build it the usual way using cargo
The binary is located at ../target/release/re
. Move it somewhere suitable, e.g.
Getting Started
Check the installation and see a full listing of the available commands by running re
with no arguments.
Authentication
Per Session
The simplest way to authenticate is to specify the API token for every command. By default re
will prompt you to enter it interactively. E.g. to list the available datasets
The token can also be specified using --token
This is not generally a good idea (e.g. it'll be stored in your shell history). Better to store in a environment variable.
Even better to use contexts, see further below.
Different Clusters
By default, the endpoint for all commands is https://reinfer.io
. This can be overidden using --endpoint
, e.g.
Contexts (stateful authentication)
Contexts help avoid having to manually specify the token and endpoint with every command. A context is composed of
- The authentication token (which user?)
- The Re:infer cluster endpoint to talk to, typically
https://reinfer.io
- (Optional) An HTTP proxy to use for all requests
- A memorable name which serves as an identifier for the "context"
Commands for managing contexts are under re config
and allow one to create, update, set and delete contexts. Run re config -h
to see all the options.
When creating the very first context, this will be set as the active one
The current context will be used for all subsequent commands.
Any of the context settings can be overwritten as a one off using global flags such as --token
, --endpoint
and --proxy
.
Adding a context with a name that already exists will allow you to update any of the saved settings.
Uploading Comments
WIP
License
This project is licensed under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the reinfer-cli
or reinfer-client
crate, as defined in the
Apache-2.0 license, shall be licensed as above, without any additional terms or
conditions.