Metadata-Version: 2.3
Name: crystaldba
Version: 0.8.0rc1
Summary: Crystal DBA Agent CLI
License: Apache 2.0
Author: Crystal DBA Developers
Author-email: info@crystaldba.ai
Requires-Python: >=3.10
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: attrs (>=25.1.0)
Requires-Dist: email-validator (>=2.2.0)
Requires-Dist: http-message-signatures (>=0.5.0)
Requires-Dist: prompt-toolkit (>=3.0.48)
Requires-Dist: psycopg2-binary (>=2.9.10)
Requires-Dist: pydantic (>=2.10.6)
Requires-Dist: python-dotenv (>=1.0.1)
Requires-Dist: pyyaml (>=6.0.2)
Requires-Dist: requests-http-signature (>=0.7.1)
Requires-Dist: rich (>=13.9.4)
Requires-Dist: sqlalchemy (>=2.0.36)
Requires-Dist: sseclient (>=0.0.27)
Project-URL: Documentation, https://www.crystaldba.ai/docs
Project-URL: Homepage, https://www.crystaldba.ai
Project-URL: Repository, https://github.com/crystaldba/crystaldba
Description-Content-Type: text/markdown

# CrystalDBA Agent

## Prerequisites

- Python 3.12 exactly. It is possible later versions will work, but in the past some of our dependencies were not compatible with them.
- Poetry (Python package manager)

## Development Setup

1. Clone the repository:

   ```bash
   git clone git@github.com:crystaldba/crystaldba.git
   cd crystaldba/agent
   ```

2. Install dependencies using Poetry:

   ```bash
   poetry install
   ```

3. Copy the environment example file:

   ```bash
   cp env.example .env
   ```

4. Edit the `.env` file with your configuration:

## Environment Variables

See `agent/shared/constants.py` for current details.

#### Database to Monitor

- `DATABASE_URL`: PostgreSQL connection string (required)
  Example: `postgresql://user:password@localhost:5432/dbname`

## Running the Application

```bash
poetry run crystaldba
```

You can add `-v` or `-vv` in order to increase verbosity.

## Development Tools

- Code formatting and linting:

  ```bash
  poetry run ruff format .
  poetry run ruff check .
  ```

- Type checking:
  ```bash
  poetry run pyright
  ```

## Running Tests

Install test dependencies:

```bash
poetry install --with dev
```

Apply the required changes to the `.env` file.

Run unit tests:

```bash
poetry run pytest
```

Run unit tests with increased verbosity:

```bash
poetry run pytest -v
```

