CLIDB
Tired of the database setup hassle? CLIDB is for developers who need instant databases for their projects. No more Docker compose files, no more configuration headaches - just one command and you're ready to code.
A powerful command-line tool for managing local development databases using Docker. Simplify your database management with features like automatic port allocation, backups, metrics monitoring, and more.
Why CLIDB?
-
🚀 Zero to Database in Seconds
clidb create myproject-db
-
😌 No More Setup Headaches
- Forget about Docker compose files
- No manual port configuration
- Automatic credential management
-
💪 Perfect for:
- Rapid prototyping
- Multiple client projects
- Testing and development
- CI/CD environments
Features
-
🗃️ Multiple Database Support
- PostgreSQL (versions 11-16)
- MySQL (8.0, 5.7)
- MariaDB (11.0, 10.11, 10.10)
- Redis (7.2, 7.0, 6.2)
- MongoDB (7.0, 6.0, 5.0)
- Neo4j (5, 4.4)
-
🔄 Automatic Port Management
- Smart port allocation for multiple instances
- Conflict resolution for occupied ports
- Public and private access modes
-
🔒 Security Features
- Automatic password generation
- SSL/TLS support with Let's Encrypt
- Secure credential storage
-
📊 Monitoring & Metrics
- Real-time performance monitoring
- CPU and memory usage
- Network and disk I/O stats
- Container health checks
-
💾 Backup & Restore
- Full database backups
- Point-in-time restoration
- Backup management with descriptions
- Automatic backup rotation
-
🔔 Notifications
- Discord integration
- Event notifications for:
- Database creation/deletion
- Start/stop events
- Backup operations
- Error alerts
Prerequisites
- Python 3.8 or higher
- Docker (can be installed using
clidb install-docker) - pip (Python package installer)
Installation
# Install using pip
pip install clidb
# Or install using pipx (recommended)
pipx install clidb
Quick Start
# Install Docker if needed
clidb install-docker
# Create a PostgreSQL database
clidb create mydb --type postgres --version 16
# List all databases
clidb list
# View database info
clidb info mydb
Usage Guide
Database Management
# Create a database
clidb create mydb --type postgres --version 16
# Create with specific port and access
clidb create mydb --type mysql --port 3306 --access private
# List all databases
clidb list
# Get connection info
clidb info mydb
# Start/stop databases
clidb start mydb
clidb stop mydb
# Remove a database
clidb remove mydb
Backup Operations
# Create a backup
clidb backup mydb --description "Pre-deployment backup"
# List all backups
clidb backups
# List backups for specific database
clidb backups --db mydb
# Restore from backup
clidb restore mydb 20240101_120000
# Delete old backup
clidb delete-backup mydb 20240101_120000
Performance Monitoring
# View current metrics
clidb metrics mydb
# Watch metrics in real-time
clidb metrics mydb --watch
SSL Configuration
# Setup SSL with automatic certificate
clidb ssl mydb example.com --email admin@example.com
# Remove SSL
clidb remove-ssl mydb example.com
# Verify domain configuration
clidb verify-domain example.com
Discord Notifications
Enable notifications by providing a webhook URL:
# Via command line
clidb create mydb --discord-webhook "https://discord.com/api/webhooks/..."
# Or via environment variable
export CLIDB_DISCORD_WEBHOOK="https://discord.com/api/webhooks/..."
Environment Variables
| Variable | Description | Default |
|---|---|---|
CLIDB_DISCORD_WEBHOOK |
Discord webhook URL for notifications | None |
CLIDB_HOST_IP |
Override auto-detected IP address | Auto-detected |
CLIDB_DEFAULT_DB |
Default database type | postgres |
CLIDB_DEFAULT_PORT |
Default starting port | Based on DB type |
File Locations
- Credentials:
~/.config/clidb/credentials.json - Backups:
~/.config/clidb/backups/ - Backup Metadata:
~/.config/clidb/backups/backup_metadata.json
Security Best Practices
-
Access Control
- Use private access mode for development
- Enable SSL for production environments
- Regularly rotate database passwords
-
Backup Management
- Regular backups with descriptive labels
- Test restore procedures periodically
- Keep backup metadata up to date
-
SSL/TLS
- Use valid email for Let's Encrypt notifications
- Keep certificates up to date
- Verify domain ownership before SSL setup
Troubleshooting
-
Port Conflicts
- CLIDB automatically finds the next available port
- Use
--portto specify a different port - Check port availability with
netstatorlsof
-
Docker Issues
- Run
clidb install-dockerto fix common problems - Check Docker daemon status
- Verify user is in docker group
- Run
-
Backup/Restore
- Ensure sufficient disk space
- Check database connection before backup
- Verify backup file permissions
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- GitHub Issues: Report a bug
- Documentation: Wiki
- Discussions: Community
Metadata
Release files for clidbs 4.26.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| clidbs-4.26.0.tar.gz | 33.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clidbs-4.26.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.4 kB
Release files / clidbs-4.26.0.tar.gz
| Download URL | clidbs-4.26.0.tar.gz |
|---|---|
| Size | 33.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2d4d324838aeb8e417b10c1335f85031bf6f80c970904e759261f1874989d0b5
|
|
BLAKE2b-256 checksum How to use checksums |
41ccdf3a0fc19d1adcc1c142241985ac96982db02128f87538c3478b2cc34ee6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / clidbs-4.26.0-py3-none-any.whl
| Download URL | clidbs-4.26.0-py3-none-any.whl |
|---|---|
| Size | 40.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
747c4c99dccc6498b4002e387dc1b45a0d5210ace71dd49b7fa336446d3ddebc
|
|
BLAKE2b-256 checksum How to use checksums |
4bb3a6d04ceb74271531c72effe96478463b041c117a00550c4eebd6a50ebaa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Security for clidbs 4.26.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.