A command-line interface tool for Oracle MySQL HeatWave POC demonstrations. This tool simplifies database connections, OCI authentication setup, and provides easy access to HeatWave features for proof-of-concept demonstrations.
- Secure database connection management with encrypted password storage
- OCI (Oracle Cloud Infrastructure) authentication configuration
- Automatic connection testing after setup
- Schema (database) management commands
- HeatWave GenAI permission setup automation
- HeatWave Lakehouse Dynamic Group and Policy automation
- Text generation using HeatWave GenAI with ML_GENERATE
- Batch text processing with ML_GENERATE_TABLE
- Interactive mode for continuous text generation
- Designed specifically for HeatWave POC demonstrations
- Local configuration storage with encryption
- Python 3.11 or higher
- MySQL HeatWave instance
- OCI account (for Lakehouse features)
pip install heatwaved-cligit clone https://github.com/afininc/heatwaved-cli.git
cd heatwaved-cli
pip install -e .git clone https://github.com/afininc/heatwaved-cli.git
cd heatwaved-cli
uv pip install -e .Initialize both database and OCI configuration:
heatwaved initThis will:
- Prompt for database connection details
- Test the database connection
- Ask if you want to configure OCI
- Test OCI authentication if configured
heatwaved init dbheatwaved init ociWhen running heatwaved init or heatwaved init db, you'll be prompted for:
- DB Host: Your MySQL HeatWave instance hostname
- DB Port: Database port (default: 3306)
- Username: Database username
- Password: Database password (stored encrypted)
For OCI setup, you'll need to:
-
Generate API keys in OCI Console:
- Visit: https://cloud.oracle.com/identity/domains/my-profile/auth-tokens
- Go to API keys -> Add API key
-
Copy the configuration from OCI Console and paste when prompted
-
Provide the path to your private key file (will be copied to the project)
# Complete setup (DB + OCI)
heatwaved init
# Database only
heatwaved init db
# OCI only (requires existing DB config)
heatwaved init oci# Test both database and OCI
heatwaved test
# Test database only
heatwaved test --db
# Test OCI only
heatwaved test --oci# Show current configuration
heatwaved config show
# Show configuration directory path
heatwaved config path# Create a new schema
heatwaved schema create my_database
# List all schemas
heatwaved schema list
# List schemas matching pattern
heatwaved schema list --pattern "test%"
# Drop a schema (with confirmation)
heatwaved schema drop my_database
# Drop a schema without confirmation
heatwaved schema drop my_database --force
# Set default schema for future operations
heatwaved schema use my_database# Set up GenAI permissions for a schema
heatwaved genai setup my_schema
# Set up with different input/output schemas
heatwaved genai setup main_schema --input-schema source_data --output-schema results
# Preview SQL statements without executing
heatwaved genai setup my_schema --show-only
# Check current user's GenAI permissions
heatwaved genai check# Set up Dynamic Group and Policy for Object Storage access
heatwaved lakehouse setup
# Set up with specific compartment
heatwaved lakehouse setup --compartment-id ocid1.compartment.oc1..xxxxx
# Preview resources without creating
heatwaved lakehouse setup --show-only
# List buckets in a compartment
heatwaved lakehouse list-buckets# Generate text using default query and model
heatwaved generate text
# Generate text with custom query
heatwaved generate text "Explain quantum computing in simple terms"
# Generate text with specific model and language
heatwaved generate text --model mistral-7b-instruct-v1 --lang ko
# Interactive mode for multiple queries
heatwaved generate text --interactive
# Show SQL query being executed
heatwaved generate text --show-query
# List available generation models
heatwaved generate models
# Batch generation from input table
heatwaved generate batch input_table.queries output_table.responses
# Batch generation with specific database
heatwaved generate batch mydb.queries.prompt mydb.results.answer --database productionAll configuration is stored locally in the .heatwaved/ directory:
.heatwaved/
βββ config.json # Encrypted database credentials and settings
βββ .key # Encryption key (auto-generated)
βββ .oci/
βββ config # OCI configuration file
Important: The .heatwaved/ directory contains sensitive information and is automatically excluded from git.
- Database passwords are encrypted using Fernet encryption
- Configuration files are stored locally only
- The
.heatwaved/directory is git-ignored by default - Private keys are copied to the local configuration directory
- Verify your MySQL HeatWave instance is running
- Check network connectivity to the database host
- Ensure the username and password are correct
- Verify the port number (default is 3306)
- Ensure your API key is properly generated in OCI Console
- Verify the private key file path is correct
- Check that the key file has proper permissions
- Ensure your OCI user has necessary permissions
If you see "HeatWave configuration not found", run:
heatwaved init# Clone the repository
git clone https://github.com/afininc/heatwaved-cli.git
cd heatwaved-cli
# Install with development dependencies
uv pip install -e .
uv add --dev ruff
# Run linting
ruff check heatwaved/
# Run with auto-fix
ruff check heatwaved/ --fixheatwaved-cli/
βββ heatwaved/
β βββ commands/ # CLI commands
β β βββ init.py # Initialization commands
β β βββ test.py # Connection testing
β β βββ config.py # Configuration management
β βββ config/ # Configuration utilities
β β βββ manager.py # Config file management
β βββ main.py # CLI entry point
βββ pyproject.toml # Project configuration
βββ README.md # This file
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes following Conventional Commits
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
For issues and feature requests, please visit: https://github.com/afininc/heatwaved-cli/issues
- Ryan Kwon - [email protected]
Built for Oracle MySQL HeatWave POC demonstrations