The install command sets up a local Amazon Redshift command-line client so you can run SQL against Redshift clusters from your terminal.
The CLI lets you submit SQL, download results, and automate Redshift tasks without logging into the AWS Console. It wraps AWS APIs so you can script queries, load data, and manage clusters with the same ease as psql.
Run brew install aws/tap/amazon-redshift-utils
.Homebrew downloads the binary, adds it to /usr/local/bin
, and installs required PostgreSQL libraries automatically.
First install Python 3 & pip. Then run pip install redshift-cli
. The package installs a wrapper script called rsql
that behaves like psql but routes traffic through the Redshift Data API.
Configure AWS credentials once with aws configure
or environment variables.The CLI then signs every request with your IAM user or role.
Execute rsql -h my-redshift.xxxx.us-east-1.redshift.amazonaws.com -p 5439 -d dev -U analyst -c "SELECT 1"
. A single row proves network, IAM, and VPC rules are correct.
Yes. Any Redshift-compatible SQL works. Example: rsql -f daily_sales.sql
where the file contains joins across Orders
, OrderItems
, and Products
.
Append -o report.csv --format csv
.The CLI streams rows locally, perfect for ad-hoc analysis in spreadsheets.
Grant redshift-data:ExecuteStatement
, redshift-data:GetStatementResult
, and redshift:DescribeClusters
. Without them, every call returns an AccessDenied error.
Add your rsql
command to crontab
or a CI runner.The CLI exits non-zero on SQL errors, so failed jobs are easy to detect.
Store credentials in AWS Secrets Manager, use parameterized SQL files, and confirm row counts before deleting or updating data.
.
No. It wraps the Redshift Data API and adds AWS authentication, but the SQL syntax and keyboard shortcuts feel familiar to psql users.
The tool itself is free. You pay only for Redshift compute and any Data API calls, which are covered by standard Redshift pricing.
Yes. Combine `rsql` with `ssh -L` port forwarding, or place the CLI inside the same VPC using AWS Systems Manager Session Manager.