Metadata-Version: 2.4
Name: clidbs
Version: 0.6.1
Summary: A CLI tool for managing databases on VPS systems
Author: Andrew Wade
Requires-Python: >=3.8
Requires-Dist: click>=8.0.0
Requires-Dist: docker>=6.1.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: requests>=2.31.0
Description-Content-Type: text/markdown

# CLIDB - Simple Database Management CLI

A command-line tool for managing databases on VPS systems using Docker containers. Supports multiple database types and provides ready-to-use connection strings.

## Supported Databases

- 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)

## Prerequisites

- Python 3.8 or higher
- Docker installed and running
- pip (Python package installer)

## Installation

```bash
pip install clidbs
```

## Usage

### Create a Database

```bash
# Create a PostgreSQL database (latest version)
clidb create mydb

# Create a specific version
clidb create mydb --type postgres --version 16

# Create other database types
clidb create myredis --type redis --version 7.2
clidb create mymongo --type mongo
clidb create mysql1 --type mysql --version 8.0
```

The tool will output connection details including:
- Connection string (ready to copy/paste)
- CLI command with credentials
- Host/IP address (automatically detected)
- Port, user, and password

### Manage Databases

```bash
# List all databases
clidb list

# Stop a database
clidb stop mydb

# Start a database
clidb start mydb

# Remove a database
clidb remove mydb

# See supported databases and versions
clidb supported
```

### Public vs Private Access

```bash
# Create with public access (default)
clidb create mydb --access public

# Create with private access (localhost only)
clidb create mydb --access private
```

### Discord Notifications

Enable notifications by:

1. Setting the webhook URL in command:
```bash
clidb create mydb --discord-webhook "YOUR_WEBHOOK_URL"
```

2. Or using environment variable:
```bash
export CLIDB_DISCORD_WEBHOOK="YOUR_WEBHOOK_URL"
```

## Configuration

Environment variables:
- `CLIDB_DISCORD_WEBHOOK`: Discord webhook URL
- `CLIDB_HOST_IP`: Override auto-detected IP address
- `CLIDB_DEFAULT_DB`: Default database type (defaults to "postgres")
- `CLIDB_DEFAULT_PORT`: Default port for the database

## Security

- Secure random passwords generated for each database
- Private mode uses host networking for better security
- Public mode exposes ports for remote access
- Connection strings provided with proper credentials
- Discord notifications exclude sensitive information

## License

MIT License 


# Create different types of databases
clidb create mypostgres --type postgres --version 16
clidb create mymongo --type mongo --version 7.0
clidb create myredis --type redis
clidb create mysql1 --type mysql --version 8.0

# List all databases
clidb list

# See supported databases and versions
clidb supported

# Start/stop any database
clidb stop mypostgres
clidb start mymongo