This is a submission for the GitHub Copilot CLI Challenge
✨ Updates (Jan 27)
Benchmark Profile & Production-Ready Features Added!
Since the challenge submission, I've added several major features that take SQL-Speak from demo to production-ready:
-
🏁 PostgreSQL Benchmark Profile (
--profile benchmark-postgres)- Safe for analytics workloads: SELECT-only enforcement, auto-applies
🏗️ Project Architecture (NEW!)
SQL-Speak is a multi-component system with:
- CLI Layer: Terminal-native interface using Typer
- Core Engine: Database connection, schema detection, Copilot integration, query execution
- REST API: Programmatic access with authentication & authorization
- Web Dashboard: Modern Next.js interface for enterprise use
- Data Generator: PostgreSQL benchmark data generation (10M+ rows)
- Configuration: TOML-based environment management
💻 Development Setup
Prerequisites
- Python 3.8+
- Node.js 16+ (for web dashboard)
- GitHub CLI with Copilot extension
- PostgreSQL 12+ (optional, for benchmarks)
Quick Start
# Backend
git clone https://github.com/jemiridaniel/SQL-Speak.git
cd SQL-Speak
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Frontend
cd web
npm install
npm run dev
# CLI Usage
python3 main.py --db hospital.db "Show me all patients older than 30"
📦 Key Dependencies
- typer[all]: CLI framework
- sqlalchemy: Database toolkit
- pexpect: GitHub Copilot CLI interaction
- psycopg2-binary: PostgreSQL adapter
- tabulate: Result formatting
- Next.js: Web dashboard framework
🔒 Security & Environment Setup
Protected Environment Variables
A .env.example template is provided for safe setup:
cp .env.example .env
# Edit .env with your actual values (NOT committed to git)
All .env* files are gitignored to prevent credential leaks.
🚀 Deployment Ready
- API Server: Gunicorn production deployment
- Web Dashboard: Vercel-ready Next.js build
- Database: PostgreSQL, SQLite, MySQL support
- Benchmarking: Safe profile for 10M+ row datasets
🛠️ Contributing
Extend SQL-Speak by:
- Adding database dialect support in
core/db.py - Implementing features in appropriate modules
- Documenting API changes
- Testing with provided generator
📚 Core Modules
- core/copilot.py: GitHub Copilot integration
- core/engine.py: Query execution pipeline
- core/db.py: Database operations & schema detection
- core/profiles.py: Execution profiles (standard, benchmark)
- api/: REST API with authentication
- web/: Next.js enterprise dashboard
🎯 What's Next
- [ ] Query caching & optimization
- [ ] Advanced result visualization
- [ ] Multi-database transactions
- [ ] Query performance analytics
- [ ] Community plugin system
GitHub: https://github.com/jemiridaniel/SQL-Speak
*Built with ❤️ for the GitHub Copilot CLI Challenge*LIMIT 100
- Shows EXPLAIN ANALYZE before execution to catch performance issues
-
Real-world scenario: Query 10M+ row datasets safely from the terminal
- 📊 Built-in EXPLAIN ANALYZE Preview
Validates query performance before running (no more accidental full-table scans!)
-
Shows query plans to understand what's happening under the hood
- 🏗️ Data Generator for Benchmarking
Generates 10M+ row realistic datasets with
python -m generator.cliTables: customers, products, orders, order_items, payments
-
Perfect for stress-testing analytics queries
- 🔄 Multi-Turn Refinement Mode
Ask follow-up questions to refine queries naturally
Example: "Show revenue by country" → "Only completed payments" → "Top 5 by revenue"
Check the updated GitHub repo for full details and the new README!
What I Built
SQL-Speak is a terminal-native utility that bridges the gap between natural language and structured data. It leverages the GitHub Copilot CLI as an intelligent translation layer, allowing developers to query local databases (like SQLite) using plain English. Instead of context-switching to a heavy GUI or manually writing complex JOINs for a quick data check, you can simply "speak" to your database directly from the command line.
Demo
Source Code: https://github.com/jemiridaniel/SQL-Speak
Video Walkthrough: https://monosnap.ai/file/qdcGJmiFRoaegroJOc19X7uxwcZivV
My Experience with GitHub Copilot CLI
Building SQL-Speak highlighted the "agentic" power of the Copilot CLI. By integrating the new gh copilot -p agentic prompt syntax into the application's backend, I was able to transform vague natural language intents into precise SQL queries.
The CLI's ability to understand context made it possible to pass database schema hints into the prompt, ensuring the generated SQL was not just syntactically correct, but also contextually aware of my specific table structures. It turned the terminal from a static environment into a conversational data assistant.
Top comments (0)