
* add v1-compatible query path and refactor other paths to de-duplicate "/query" * add initial influxQL repl * add ping endpoint to schema * improve prompt UX, implement some commands * fix json column type in schema and improve completion * feat: add table formatter and move to forked go-prompt * improve formatting and add table pagination * implement more REPL commands, including insert and history * implement "INSERT INTO" * move repl command to "v1 repl" * refactor and improve documentation * clean up v1_repl cmd * update to latest openapi, use some openapi paths instead of overrides * remove additional files that were moved to openapi * compute historyFilePath at REPL start * clean up REPL use command logic flow * clean up comments for TODOs now in issues * move gopher (chonky boi) * remove autocompletion for separate PR * run go mod tidy * add rfc3339 precision option * allow left and right column scrolling to display whole table * add error to JSON query response * add tags and partial to JSON response series schema * fix csv formatting and add column formatting * remove table format for separate PR * add pretty table format to REPL * fix getDatabases * move from write to legacy write endpoint for INSERT * remove history vestiges * allow multiple spaces in INSERT commands * add precision comment * remove auth for separate PR * separate parseInsert and add unit test * add additional test case and improve error messages * fix missing errors import * update for simpler horizontal scrolling in table mode * improve dialog printing * improve table format and interactions * jump to first page on shift-up * add keybinding info * change wording from result to table, flip
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:
- Make it easier to keep the CLI up-to-date with InfluxDB Cloud API changes
- Enable faster turn-around on fixes/features that only affect the CLI
- 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.
-
Clone this repo (influx-cli) and change to your influx-cli directory.
git clone git@github.com:influxdata/influx-cli.git cd influx-cli
-
Build the CLI. The
make
andmake influx
commands write the new binary tobin/$(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:
-
Update the openapi Git submodule. The following command pulls the latest commits for the branch and all submodules.
git pull --recurse-submodules
-
With Docker running locally, regenerate openapi.
make openapi
-
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.