CLI
Install the ChartQuery CLI SDK and make your first API call.
The official ChartQuery command-line interface, with one command per endpoint.
Requirements
- Node.js 20+
Install
npm install --global @chartquery/cli
chartquery --helpnpx @chartquery/cli --helpGet your API key
Copy your API key from the ChartQuery dashboard and set it in the CHARTQUERY_API_KEY environment variable, which the SDK reads by default. Keep it out of source control.
export CHARTQUERY_API_KEY="YOUR_API_KEY"$env:CHARTQUERY_API_KEY = "YOUR_API_KEY"Usage
chartquery chart-ai --prompt 'Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18'chartquery chart-ai --help # parameters of one command
chartquery endpoints # every command and its HTTP path
chartquery endpoints search # filter the listchartquery qrcode --data https://chartquery.com --format png -o qrcode.pngecho '{"prompt": "Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18"}' | chartquery chart-ai --params -
chartquery chart-ai --params params.json --compactchartquery request get /v1/usage
chartquery request post /v1/some/new/endpoint --params body.jsonchartquery chart-ai --prompt 'Monthly revenue 2026 as a bar chart: Jan 10, Feb 14, Mar 18' | jq .Exit codes
0: success1: API or network failure2: invalid usage, such as an unknown command, a missing API key or a missing parameter
Links
- Package:
@chartquery/cli - Source code: github.com/chartquery/chartquery-cli
- API reference