4 releases (2 breaking)
new 0.3.0 | Mar 21, 2025 |
---|---|
0.2.2 | Mar 8, 2025 |
0.2.0 | Mar 8, 2025 |
0.1.0 | Feb 27, 2025 |
#324 in Database interfaces
480 downloads per month
1MB
1.5K
SLoC
AWS Athena CLI
A command-line interface tool written in Rust for interacting with AWS Athena, providing a streamlined experience similar to the Athena web console.

Purpose
- Execute SQL queries against AWS Athena databases
- List and manage workgroups
- View query history and results
- Manage databases and tables
- Save frequently used queries
Installation
- Ensure you have Rust installed (1.70 or later)
- Clone this repository
- Run
cargo install --path .
- Copy
config.example.toml
to~/.config/athena-cli/config.toml
and update with your settings
Usage
Basic commands:
athena-cli query "SELECT * FROM table"
- Execute a queryathena-cli database list
- List available databasesathena-cli table list
- List tables in a databaseathena-cli table describe <table-name>
- Describe table structureathena-cli workgroup list
- List available workgroupsathena-cli history
- Show recent queriesathena-cli inspect <query-id>
- Show detailed information about a queryathena-cli inspect <query-id> -o <path>
- Inspect query and download resultsathena-cli download <query-id>
- Download query results (shortcut for inspect with download)
Configuration
For configuration, edit ~/.config/aws-athena-cli/config.toml
to set:
- Default workgroup
- Output location
- AWS credentials (if not using AWS CLI configuration)
Requirements
- AWS account with Athena access
- Configured AWS credentials
- Rust 1.70+
For detailed documentation and examples, see the Wiki.
Milestones
Completed ✅
- Authorize athena with SSO profile and ENV variables
- Basic query execution with AWS Athena
- Configuration management with TOML config file
- Query result caching and reuse
- Polars integration for DataFrame handling
- Get detail a history query
- Database schema exploration
Coming Soon 🚀
- Custom output formatting
- Export results to various formats
- Query history tracking
- Test cases
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
- Clone the repository
- Install pre-commit hooks to ensure code quality:
pip install pre-commit pre-commit install
The pre-commit hooks will automatically:
- Format your code with
cargo fmt
- Run
cargo check
to ensure compilation - Fix common issues with
cargo clippy --fix
- Check for other issues like trailing whitespace, YAML/TOML format, etc.
Dependencies
~63MB
~1M SLoC