#athena #aws #sql #query-execution #execute-query #sql-database

app athena-cli

A command-line interface for AWS Athena with interactive query execution and result management

3 unstable releases

new 0.2.2 Mar 8, 2025
0.2.0 Mar 8, 2025
0.1.0 Feb 27, 2025

#245 in Database interfaces

Download history 157/week @ 2025-02-26

157 downloads per month

MIT license

55KB
1K 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

  1. Ensure you have Rust installed (1.70 or later)
  2. Clone this repository
  3. Run cargo install --path .
  4. 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 query
  • athena-cli workgroup list - List available workgroups
  • athena-cli db list - List databases
  • athena-cli history - Show recent queries
  • athena-cli inspect <query-id> - Show detailed information about a query
  • athena-cli inspect <query-id> -o <path> - Inspect query and download results
  • athena-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
  • Query history tracking
  • Get detail a history query
  • Export results to various formats

Coming Soon 🚀

  • Database schema exploration
  • Custom output formatting

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Dependencies

~63MB
~1M SLoC