Crates.io | reinfer-cli |
lib.rs | reinfer-cli |
version | 0.35.0 |
source | src |
created_at | 2020-06-30 14:43:04.26549 |
updated_at | 2024-11-04 15:22:18.440312 |
description | Command line interface for Re:infer, the conversational data intelligence platform |
homepage | https://github.com/reinfer/cli |
repository | |
max_upload_size | |
id | 259857 |
size | 1,179,428 |
Command line interface for Re:infer
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).
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.
zsh
and bash
.Statically linked binaries with no dependencies are provided for selected platforms:
You can download a .deb
package here.
To build from source, you need a recent version of the Rust toolchain installed.
cargo install
To install using cargo install
run the following.
cargo install reinfer-cli
Ensure you have the cargo bin directory in your path (typically ~/.cargo/bin
).
Build it the usual way using cargo
cargo build --release
The binary is located at ../target/release/re
. Move it somewhere suitable, e.g.
sudo mv ../target/release/re /usr/local/bin/
Check the installation and see a full listing of the available commands by running re
with no arguments.
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
➜ re get datasets
input: Enter API token [none]: MYSUPERSECRETAPITOKEN
Name ID Updated (UTC) Title
InvestmentBank/collateral-triggers aa9dda7c059e5a8d 2019-04-30 17:25:03 IB Collateral Triggers
InvestmentBank/george-test 1aaeacd49dfce8a0 2019-05-10 15:32:34 Test Dataset
InvestmentBank/margin-call b9d50fb2b38c3af5 2019-05-08 07:51:09 IB Margin Call
InvestmentBank/margin-call-large 6d00b9f69ab059f6 2019-05-11 09:23:43 IB Margin Call Large
The token can also be specified using --token
➜ re --token MYSUPERSECRETAPITOKEN get datasets
This is not generally a good idea (e.g. it'll be stored in your shell history). Better to store in a environment variable.
➜ re --token $REINFER_TOKEN get datasets
Even better to use contexts, see further below.
By default, the endpoint for all commands is https://reinfer.dev
. This can be overidden using --endpoint
, e.g.
re --endpoint http://localhost:8000 --token $REINFER_TOKEN get datasets
Contexts help avoid having to manually specify the token and endpoint with every command. A context is composed of
https://reinfer.dev
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
➜ re config add --name production --endpoint https://reinfer.dev/
I A new context `production` will be created.
* Enter API token [none]: MYSUPERSECRETTOKEN
W Be careful, API tokens are stored in cleartext in /home/marius/.config/reinfer/contexts.json.
I New context `production` was created.
The current context will be used for all subsequent commands.
➜ re get datasets
Name ID Updated (UTC) Title
InvestmentBank/collateral-triggers aa9dda7c059e5a8d 2019-04-30 17:25:03 IB Collateral Triggers
InvestmentBank/george-test 1aaeacd49dfce8a0 2019-05-10 15:32:34 Test Dataset
InvestmentBank/margin-call b9d50fb2b38c3af5 2019-05-08 07:51:09 IB Margin Call
InvestmentBank/margin-call-large 6d00b9f69ab059f6 2019-05-11 09:23:43 IB Margin Call Large
Any of the context settings can be overwritten as a one off using global flags such as --token
, --endpoint
and --proxy
.
➜ re --proxy http://proxy.example get datasets
Adding a context with a name that already exists will allow you to update any of the saved settings.
WIP
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.
api/Cargo.toml
and cli/Cargo.toml
.
cli/Cargo.toml
that points to api/Cargo.toml
.cargo build
to update all lockfiles.CHANGELOG.md
to mark all Unreleased
changes as part of the new version.
README.md
v0.10.1
.Publish release
will upload build artefacts and tag the relevant commit.This project is licensed under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).