@huangzhuxing/dbc
v0.0.1
Published
[](https://github.com/huangzhuxing/dbc/actions/workflows/ci.yml)
Readme
DBC (Database Copilot)

This repository contains DBC (Database Copilot), an intelligent database management CLI tool that simplifies database operations for DBAs and developers. Built on the foundation of Gemini CLI, DBC brings AI-powered database management to your terminal.
With DBC (Database Copilot) you can:
- Connect to multiple database types (MySQL, PostgreSQL, MongoDB, Redis, etc.) with natural language commands
- Execute SQL queries using plain English - no need to remember complex syntax
- Manage database drivers intelligently with automatic installation and version management
- Perform database health checks and monitoring with AI-powered insights
- Handle database migrations, backups, and recovery operations safely
- Switch between different database connections seamlessly
- Get intelligent suggestions for query optimization and performance tuning
Quickstart
Prerequisites: Ensure you have Node.js version 18 or higher installed.
Run the CLI: Execute the following command in your terminal:
npx @huangzhuxing/dbcOr install it with:
npm install -g @huangzhuxing/dbc dbcPick a color theme
Configure your first database connection: DBC will guide you through setting up your database connections with natural language prompts.
You are now ready to use DBC (Database Copilot)!
For advanced use or increased limits:
If you need to use a specific model or require a higher request capacity, you can use an API key:
Generate a key from Google AI Studio.
Set it as an environment variable in your terminal. Replace
YOUR_API_KEYwith your generated key.export GEMINI_API_KEY="YOUR_API_KEY"
For other authentication methods, including Google Workspace accounts, see the authentication guide.
Examples
Once DBC is running, you can start managing your databases with natural language.
Connect to a MySQL database:
dbc
> Connect to MySQL database at localhost:3306 with username adminQuery your database with natural language:
dbc
> Show me all users who registered in the last 7 days
> Find the top 10 products by sales volume this month
> Check the health of my database connectionsNext steps
- Learn how to contribute to or build from the source.
- Explore the available CLI Commands.
- If you encounter any issues, review the Troubleshooting guide.
- For more comprehensive documentation, see the full documentation.
- Take a look at some popular tasks for more inspiration.
Troubleshooting
Head over to the troubleshooting guide if you're having issues.
Popular tasks
Database Connection Management
Start by running dbc and set up your database connections.
> Connect to my production MySQL database> Switch to my development PostgreSQL instanceQuery and Analysis
> Show me all tables in this database> Find slow running queries from the last hourDatabase Operations
> Create a backup of the users table> Check database performance metricsSchema Management
> Show me the schema for the orders table> Find all foreign key relationships in this databaseMonitoring and Health Checks
> Check the health of all my database connections> Show me database size and storage usageTerms of Service and Privacy Notice
For details on the terms of service and privacy notice applicable to your use of Gemini CLI, see the Terms of Service and Privacy Notice.
