influxdb3 CLI

The influxdb3 CLI writes and queries data and administers your InfluxDB 3 Cloud instance from the command line. Because InfluxDB 3 Cloud is fully managed, the CLI connects to your hosted instance instead of running a local server.

Connect and authenticate

The CLI connects to http://127.0.0.1:8181 by default. Before you run commands, set your instance host and authenticate:

  • Host: Set the INFLUXDB3_HOST_URL environment variable, or pass --host, to your instance host URL.
  • Authentication:
    • For interactive use, log in with the OAuth device-code flow: influxdb3 auth login --oauth. Don’t set INFLUXDB3_AUTH_TOKEN for interactive use.
    • For applications and automated clients, use a database token: set the INFLUXDB3_AUTH_TOKEN environment variable, or pass --token.

For setup steps, see Set up InfluxDB 3 Cloud.

Commonly used commands

  • influxdb3 create database: Create a database
  • influxdb3 create token --admin: Create a named admin token
  • influxdb3 create token --permission: Create a scoped database token
  • influxdb3 show tokens: List tokens
  • influxdb3 delete token: Delete a token
  • influxdb3 write: Write data to a database
  • influxdb3 query: Query data in a database

InfluxDB 3 Cloud runs the same InfluxDB 3 engine as InfluxDB 3 Enterprise, so the influxdb3 CLI works the same way. Server-management commands like serve don’t apply, because InfluxData runs the server for you.


Was this page helpful?

Thank you for your feedback!