Git Product home page Git Product logo

rportcli's Introduction

Rport CLI (v1)

Rport CLI is a tool to help you managing rport API directly from your terminal.

Installation

As a compiled binary

Jump to our release page and download a binary for your host OS. Don't forget to download a corresponding md5 file as well.

# On MacOS
wget https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-darwin-amd64.tar.gz

# On linux
wget https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-linux-386.tar.gz

# On Windows
Just download https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-windows-amd64.zip
Also download https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-windows-amd64.zip.md5

Verify the checksum:

#On MacOS
curl -Ls https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-darwin-amd64.tar.gz.md5 | sed 's:$: rportcli-v0.0.1pre1-darwin-amd64.tar.gz:' | md5sum -c

#On linux
curl -Ls https://github.com/cloudradar-monitoring/rportcli/releases/download/v0.0.1pre1/rportcli-v0.0.1pre1-linux-386.tar.gz.md5 | sed 's:$: rportcli-v0.0.1pre1-linux-386.tar.gz:' | md5sum -c
 
#On Windows assuming you're in the directory with the donwloaded file
CertUtil -hashfile rportcli-v0.0.1pre1-windows-amd64.zip MD5

#The output will be :
MD5 hash of tacoscript-0.0.4pre-windows-amd64.zip:
7103fcda170a54fa39cf92fe816833d1
CertUtil: -hashfile command completed successfully.

#Compare the command output to the contents of file rportcli-v0.0.1pre1-windows-amd64.zip.md5 they should match

Note: if the checksums didn't match please skip the installation!

Unpack and install the rportcli binary on your host machine

#On linux/MacOS
tar -xzvf rportcli-v0.0.1pre1-darwin-amd64.tar.gz 
mv rportcli /usr/local/bin/rportcli
chmod +x /usr/local/bin/rportcli

For Windows

  • Extract file contents

  • Create a RportCLI folder in C:\Program Files

  • Copy the rportcli.exe binary to C:\Program Files\RportCLI

  • Double click on the rportcli.exe and allow it's execution

Install as a go binary:

go get github.com/cloudradar-monitoring/rportcli

Config

Rportcli looks for a config file at $HOME/.config/rportcli/config.json (for Linux and MacOS) or C:\Users<CurrentUserName>.config\rportcli\config.json (for Windows). If current user has no home folder, RportCli will look for a config file next to the current binary location.

You can override config path by providing env variable CONFIG_PATH, e.g.

CONFIG_PATH=/tmp/config.json rportcli init

You can generate config by running:

rportcli init

Rportcli will interactively ask for config options and validate the result: You'll get request for following parameters:

server address

address of rport server, e.g. http://localhost:3000

login

basic auth login to access rport server, e.g. admin

password

basic auth password to access rport server, e.g. foobaz

You can skip the interactive wizard by providing parameters as cli options , e.g.

 rportcli init -s http://localhost:3000 -l admin -p foobaz

If you prefer to use environment variables instead you can do the following:

export RPORT_USER=admin
export RPORT_PASSWORD=foobaz
export RPORT_SERVER_URL=http://localhost:3000
#now you can run any rportcli command without config
rportcli client list

You can also use a hybrid variant, where e.g. user and server url are provided as config options and password as an environment variable.

 rportcli init -s http://localhost:3000 -l admin
 export RPORT_SERVER_URL=http://localhost:3000
 rportcli client list

After the config initialisation, Rportcli will check the provided options by calling the rport status API.

Cli

Trigger this command to see all available commands and their options:

rportcli --help

You can also display help for a certain command:

rportcli init --help

Additional configuration with environment variables

Variable Description Default Value Example
CONFIG_PATH Changes default config location to the provided value ${HOME}/.config/rportcli/config.json CONFIG_PATH=/tmp/config.json rportcli init
CONN_TIMEOUT_SEC Connection timeout to call rport server (seconds) 10 seconds CONN_TIMEOUT_SEC=20 rportcli client list
SESSION_VALIDITY_SECONDS initial lifetime of an interactive command session in seconds. Max value is 90 days 10(minutes) * 60 SESSION_VALIDITY_SECONDS=1800 rportcli command -i
RPORT_USER basic auth login to access rport server RPORT_USER=admin rportcli client list
RPORT_PASSWORD basic auth password to access rport server RPORT_PASSWORD=foobaz rportcli client list
RPORT_SERVER_URL address of rport server http://localhost:3000 RPORT_SERVER_URL=http://localhost:3000 rportcli client list

rportcli's People

Contributors

breathbath avatar m-terel avatar rafalf avatar thorstenkramm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.