Conversation
bednar
left a comment
There was a problem hiding this comment.
@TheTrueAI thanks for the PR. There is already an existing CLI tool: https://docs.influxdata.com/influxdb3/core/reference/cli/influxdb3/. What’s the reason for creating a new one in the Python v3 client?
|
Good point — the official influxdb3 query CLI does cover the same query functionality. My motivation was zero-install in Python environments: Happy to scope this down or close if you feel the overlap isn't justified. |
Thanks for explanation, every PR is welcome so we will be happy to review your code. Thanks again for your contribution. |
There was a problem hiding this comment.
Pull request overview
Introduces a first-party, scriptable influx3 query CLI for executing SQL/InfluxQL queries against InfluxDB 3, and adds a small Windows-focused TLS root cert compatibility fix for Flight query PEM loading.
Changes:
- Add
influx3console script +python -m influxdb_client_3module entrypoint for query workflows. - Implement query execution + output formatting (JSON/JSONL/CSV/pretty), config/env precedence, and basic error handling.
- Normalize PEM certificate line endings when reading Flight query root certs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
influxdb_client_3/cli.py |
New CLI implementation for influx3 query including formatting, env precedence, and output handling. |
influxdb_client_3/__main__.py |
Enables python -m influxdb_client_3 CLI execution. |
setup.py |
Adds console_scripts entry point for influx3. |
tests/test_cli.py |
Adds unit tests for CLI parsing and core query execution paths. |
influxdb_client_3/query/query_api.py |
Normalizes PEM line endings when reading root certificates. |
README.md |
Documents CLI usage, formats, and configuration precedence. |
CHANGELOG.md |
Adds feature + bug-fix entries for the CLI and PEM normalization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a new query CLI to support quick read/debug workflows from terminal and AI agents. - add influx3 query with json, jsonl, csv, and pretty output - add module execution path via python -m influxdb_client_3 - wire console entry point in setup - add CLI tests
Proposed Changes
Developers and AI tooling need a simple, scriptable query command for fast feedback during development. Existing community Python CLI seems unmaintained and not aligned with current behavior. So this PR introduces the following:
Checklist