|
1 | 1 | # AGENTS.md |
2 | 2 |
|
3 | | -This file provides guidance for AI assistants working with the Gold Digger codebase. |
| 3 | +This file provides guidance for AI coding assistants working with the Gold Digger Rust codebase. |
| 4 | + |
| 5 | +## Rules of Engagement for AI Assistants |
| 6 | + |
| 7 | +### File Priority Order |
| 8 | + |
| 9 | +Always consult these files in order when working with this codebase: |
| 10 | + |
| 11 | +1. **AGENTS.md** (this file) - Primary AI assistant guidance |
| 12 | +2. **GEMINI.md** - Gemini-specific overrides (if present) |
| 13 | +3. **.cursor/rules/**/\*.mdc\*\* - Cursor-specific rules (if present) |
| 14 | + |
| 15 | +### Critical Restrictions |
| 16 | + |
| 17 | +- **NEVER** commit code, switch branches, or alter git settings without explicit maintainer |
| 18 | + permission |
| 19 | +- **NEVER** log raw `DATABASE_URL`, connection strings, or credentials |
| 20 | +- **NEVER** use direct MySQL row indexing: `row[index]` or `mysql::from_value::<String>()` |
| 21 | +- **ALWAYS** ask clarifying questions before making risky changes |
| 22 | +- **ALWAYS** run `just check` and validate changes before proposing them |
| 23 | + |
| 24 | +### Change Proposals |
| 25 | + |
| 26 | +- Present changes as unified diffs, not direct file modifications |
| 27 | +- Include test updates when adding features |
| 28 | +- Run `just ci-full` locally when feasible to validate changes |
| 29 | +- Use context7 website or MCP tool to get current documentation for APIs and crates |
| 30 | + |
| 31 | +### Review Process |
| 32 | + |
| 33 | +- This project prefers **CodeRabbit.ai** for code review |
| 34 | +- Do **NOT** enable GitHub Copilot auto-review in pull requests |
| 35 | +- Maintainer: **UncleSp1d3r** (single-maintainer workflow) |
4 | 36 |
|
5 | 37 | ## Project Overview |
6 | 38 |
|
7 | | -Gold Digger is a Rust-based MySQL/MariaDB query tool that outputs results in CSV, JSON, or TSV |
8 | | -formats. It's designed for headless operation via environment variables, making it ideal for |
9 | | -database automation workflows. |
| 39 | +Gold Digger is a production-ready Rust CLI tool for MySQL/MariaDB database queries with structured |
| 40 | +output (CSV, JSON, TSV). It features comprehensive CLI interface, rustls-only TLS, and safe data |
| 41 | +type handling. |
| 42 | + |
| 43 | +**Current Architecture (v0.2.6):** |
| 44 | + |
| 45 | +- CLI-first with environment variable fallbacks using `clap` |
| 46 | +- Rustls-only TLS implementation (no OpenSSL dependencies) |
| 47 | +- Safe MySQL value conversion with NULL handling |
| 48 | +- Structured exit codes and error handling |
| 49 | +- Modular output format system |
| 50 | + |
| 51 | +**Command Examples:** |
10 | 52 |
|
11 | | -**Key Characteristics:** |
| 53 | +```bash |
| 54 | +# CLI interface (preferred) |
| 55 | +gold_digger --db-url "mysql://user:pass@host:3306/db" \ |
| 56 | + --query "SELECT id, name FROM users" \ |
| 57 | + --output results.json --pretty |
12 | 58 |
|
13 | | -- CLI-first (uses Clap) with environment variable overrides |
14 | | -- Outputs to structured formats based on file extension |
15 | | -- Fully materialized result sets (no streaming) |
16 | | -- Single-maintainer project by UncleSp1d3r |
17 | | -- Under active development toward v1.0 |
| 59 | +# Environment variables (legacy support) |
| 60 | +DATABASE_URL="mysql://user:pass@host:3306/db" \ |
| 61 | +DATABASE_QUERY="SELECT * FROM table" \ |
| 62 | +OUTPUT_FILE="/tmp/data.csv" \ |
| 63 | +cargo run --release |
| 64 | +``` |
18 | 65 |
|
19 | 66 | ## 🚨 Critical Safety Rules |
20 | 67 |
|
|
0 commit comments