InfluxDB CLI
$ influx Official Med RiskThe InfluxDB v2 CLI (influx) manages buckets, orgs, tokens, backups, and Flux time-series queries against InfluxDB v2 OSS and Cloud. Resource commands support --json (or INFLUX_OUTPUT_JSON=true), while INFLUX_HOST, INFLUX_TOKEN, and INFLUX_ORG enable clean headless authentication.
brew install influxdb-cli influx executes Flux queries, bulk line-protocol writes, and influx backup/restore streams directly from local files with minimal overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Resource commands support --json and INFLUX_OUTPUT_JSON=true, and env vars eliminate prompts, though influx query returns annotated CSV rather than JSON.
--jsonon resource commands;influx query --rawoutputs annotated CSV
Token-scoped permissions and INFLUX_TOKEN env var isolation protect credentials, though influx delete and bucket delete act without --dry-run.
- Token-based RBAC and env var support; no global
--dry-run
Compiled Go binary distributed via Homebrew and official tarballs across macOS, Linux, and Windows.
- Available via
brew install influxdb-cliand static release binaries
Covers queries, line-protocol ingestion, bucket lifecycle, and hot backups in one binary.
- Unifies
query,write,bucket,auth, andbackup
Official influxdata/influx-cli under MIT license, focused specifically on InfluxDB v2 APIs.
- Official InfluxData repository under MIT license
Complete CLI subcommand reference on docs.influxdata.com with env var mappings.
- Detailed CLI reference at docs.influxdata.com
Security, Auth & Guardrails
Stores named CLI configs in ~/.influxdbv2/configs or reads INFLUX_HOST, INFLUX_TOKEN, and INFLUX_ORG environment variables.
MIT open-source CLI; InfluxDB Cloud usage incurs vendor charges.
# InfluxDB CLI (influx) Agent Rules - Configure `INFLUX_HOST`, `INFLUX_TOKEN`, and `INFLUX_ORG` via env vars; never pass `--token` inline if avoidable. - Pass `--json` on `list` / `find` management commands for reliable parsing. - Confirm org and bucket names before running `influx bucket delete` or `influx delete`.
Agent-Ready Command Recipes
Safe Read-Only Queries
influx bucket list --json
Returns all accessible buckets, retention rules, and IDs in structured JSON.
influx query 'from(bucket: "metrics") |> range(start: -15m) |> limit(n: 10)' --raw
Executes a Flux time-series query and prints raw annotated CSV output.
Controlled Writes & Previews
influx write --bucket metrics --precision s "cpu_load,host=app01 value=0.42"
Appends a single timestamped line-protocol metric point to the target bucket.
Strengths for Agents
- +
--jsonandINFLUX_*environment variables work cleanly for resource inspection. - + Single static Go binary handles queries, writes, templates, and backups.
Caveats & Pitfalls
- !
influx queryemits Flux annotated CSV instead of JSON. - ! Targets InfluxDB v2 APIs; InfluxDB v3 uses separate SQL/Flight tooling.