# DX Labs CLI - Development & Release Guide

This document provides instructions on how to set up local development, build the package, and upload to PyPI for the `dxlabs` library.

## 1. Local Installation

To install the library in "Editable" mode (changes in code are immediately reflected), run the following command at the project root:

```bash
pip install -e .
```

After installation, you can use the `dxlabs` command directly from your terminal.

## 2. Build Package

To build the project into distribution files (`.whl` and `.tar.gz`), you need to install the `build` tool:

```bash
pip install build
```

Then, run the build command:

```bash
python -m build
```

After the build completes, the distribution files will be located in the `dist/` directory.

## 3. Upload to PyPI (Release)

To publish the library to [PyPI](https://pypi.org/), you need a PyPI account and the `twine` tool:

```bash
pip install twine
```

### Step 1: Check the package (Optional)
Check if the distribution files are valid:
```bash
python -m twine check dist/*
```

### Step 2: Upload
Upload to PyPI (the system will prompt for username/password or API Token):
```bash
python -m twine upload dist/*
```

### Step 3: Upload to TestPyPI (Recommended before official release)
If you want to test the upload before making it public:
```bash
python -m twine upload --repository testpypi dist/*
```

## 4. Project Structure

- `src/dxlabs/cli.py`: Entry point for the CLI.
- `src/dxlabs/config.py`: Management of `.dxlabs.json` configuration.
- `src/dxlabs/core/`: Contains core business logic.
- `src/dxlabs/providers/`: Contains providers (S3, etc.).

## 5. AWS Credentials Note

The library uses `boto3`. You should configure AWS credentials through:
1. Run `aws configure` to create a profile.
2. Or use environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
3. When initializing the project (`init`), you can use the `--profile` flag to specify the desired AWS profile.
