Code Monkey home page Code Monkey logo

influx-cli's Introduction

influx-cli

CLI for managing resources in InfluxDB v2

Motivation

This repository decouples the influx CLI from the OSS influxdb codebase. Our goals are to:

  1. Make it easier to keep the CLI up-to-date with InfluxDB Cloud API changes
  2. Enable faster turn-around on fixes/features that only affect the CLI
  3. Allow the CLI to be built & released for a wider range of platforms than the server can support

Building the CLI

Follow these steps to build the CLI. If you're updating your CLI build, see Updating openapi below.

  1. Clone this repo (influx-cli) and change to your influx-cli directory.

    git clone [email protected]:influxdata/influx-cli.git
    cd influx-cli
    
  2. Build the CLI. The make and make influx commands write the new binary to bin/$(GOOS)/influx.

    make
    

Updating openapi

If you change or update your branch, you may also need to update influx-cli/openapi and regenerate the client code. influx-cli/openapi is a Git submodule that contains the underlying API contracts and client used by the CLI. We use OpenAPITools/openapi-generator to generate the HTTP client.

To update, run the following commands in your influx-cli repo:

  1. Update the openapi Git submodule. The following command pulls the latest commits for the branch and all submodules.

    git pull --recurse-submodules

  2. With Docker running locally, regenerate openapi.

    make openapi

  3. Rebuild the CLI

    make

Running the CLI

After building, use influx -h to see the list of available commands.

Enabling Completions

The CLI supports generating completions for bash, zsh, and powershell. To enable completions for a single shell session, run one of these commands:

# For bash:
source <(influx completion bash)
# For zsh:
source <(influx completion zsh)
# For pwsh:
Invoke-Expression ((influx completion powershell) -join "`n`")

To enable completions across sessions, add the appropriate line to your shell's login profile (i.e. ~/.bash_profile).

Testing

Run make test to run unit tests.

influx-cli's People

Contributors

danxmoran avatar candrewlee14 avatar jeffreyssmith2nd avatar williamhbaker avatar dstrand1 avatar serenibyss avatar mcfarlm3 avatar lesam avatar adepke avatar stuartcarnie avatar jdstrand avatar bnpfeife avatar slai avatar fernandobenayas avatar glinton avatar jstirnaman avatar sranka avatar simonrichardson avatar ymmmtym avatar geek981108 avatar

Watchers

James Cloos avatar  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.