Giter VIP home page Giter VIP logo

startree-cli's Introduction

startree-cli

This is a naive CLI implementation for StarTree using the swagger.json file from the Apache Pinot server

Installation Instructions

To use, copy releases/startree-arm64 to /usr/local/bin and then chmod +x /usr/local/bin/startree-arm64 You will likely want to run ln -s /usr/local/bin/startree-arm64 /usr/local/bin/startree to make it easier to run

To avoid having to manually set the hostname and auth token each time, create the following directory mkdir -p /Users/$USER/.config/startree then copy the config from releases/config.yaml to that new directory

Edit the config.yaml and replace $HOSTNAME with the hostname of your cluster (something like pinot.startree.cloud, do not include https://) and replace ${TOKEN} with your API token. Note that this field is encapsulated and requires the auth type prepended, so it should look something like: Authorization: 'Basic OIFDGsjfe24234sdfdfsdv...='

Usage instructions

This "should" work identically to the swagger UI that's hosted in the cluster. All functions include any help text that was included in the original swagger.json.

If something isn't working as expected, the --debug flag is useful to see what is actually going on.

Enable Shell Completion on Mac

To enable shell completion on mac, first you will need to enable Shell Completion in zsh. Run the following command once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

After that, you can run the following command to enable shell completion for the current session.

source <(startree completion zsh)

If you would like to add this permanently to the system, you can do the following:

mkdir -p ${fpath[1]}
chown $USER ${fpath[1]}
sudo startree completion zsh > "${fpath[1]}/_startree"

Building / Development

This CLI was built using the swagger build tools from https://goswagger.io/generate/cli.html

To install swagger, you can download the appropriate binary from https://github.com/go-swagger/go-swagger/releases/ and copy it to /usr/local/bin

Make sure your clone of this repo is in your $GOPATH, cd src, and then run the following commands:

go mod tidy
swagger generate cli -f swagger.json --cli-app-name startree
go build -o cmd/startree/main.go 

startree-cli's People

Stargazers

 avatar

Watchers

 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.