Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Documentation

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Install dependencies
run: |
uv sync --extra docs
uv pip install -e .

- name: Build and deploy docs
run: uv run mkdocs gh-deploy --force
11 changes: 8 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install 3.10

- name: Install dependencies
run: uv sync --dev

- uses: pre-commit/action@v3.0.1

- name: Install docs dependencies
run: |
uv sync --extra docs
uv pip install -e .

- name: Build docs
run: uv run mkdocs build --strict
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ htmlcov
.vscode
*.swp

logs
logs
site
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,68 @@
# databricks-dbt-cli
# Brix

[![PyPI version](https://badge.fury.io/py/brix.svg)](https://badge.fury.io/py/brix)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation](https://img.shields.io/badge/docs-mkdocs-blue.svg)](https://spycner.github.io/brix/)

**CLI for dbt project and profile management with Databricks focus**

Brix simplifies dbt workflow by providing convenient commands for profile and project management while allowing full passthrough to the native dbt CLI.

## Features

- **Profile Management** - Initialize, view, and edit `profiles.yml` with interactive or CLI modes
- **Project Scaffolding** - Create dbt projects with sensible defaults and package management
- **dbt Passthrough** - Run any dbt command through brix (`brix dbt run`, `brix dbt test`, etc.)
- **Multiple Adapters** - Built-in support for DuckDB (local development) and Databricks
- **Interactive & CLI Modes** - Use guided wizards or script with CLI flags

## Installation

```bash
pip install brix
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv tool install brix
```

## Quick Start

```bash
# Initialize a dbt profile
brix dbt profile init

# Create a new dbt project
brix dbt project init

# Run dbt commands
brix dbt run
brix dbt test
```

## Documentation

Full documentation is available at **[spycner.github.io/brix](https://spycner.github.io/brix/)**

- [Installation](https://spycner.github.io/brix/getting-started/installation/)
- [Quick Start](https://spycner.github.io/brix/getting-started/quickstart/)
- [Command Reference](https://spycner.github.io/brix/user-guide/commands/)
- [Developer Guide](https://spycner.github.io/brix/developer-guide/architecture/)
- [API Reference](https://spycner.github.io/brix/api/)

## Development

```bash
git clone https://github.com/Spycner/brix.git
cd brix
uv sync
uv run brix --help
```

See the [Contributing Guide](https://spycner.github.io/brix/developer-guide/contributing/) for development setup and guidelines.

## License

MIT License - see [LICENSE](LICENSE) for details.
81 changes: 81 additions & 0 deletions docs/api/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# API Reference

Brix can be used as a Python library in addition to the CLI.

## Overview

The brix package is organized into modules that can be imported directly:

```python
from brix.modules.dbt.profile.models import DbtProfiles, DuckDbOutput
from brix.modules.dbt.profile.service import init_profile
from brix.modules.dbt.project.models import DbtProject
```

## Package Structure

```
brix.modules.dbt.profile
├── models # Pydantic models for profiles.yml
├── service # Profile initialization and operations
├── editor # Profile CRUD operations
└── prompts # Interactive prompts

brix.modules.dbt.project
├── models # Pydantic models for dbt_project.yml
├── service # Project initialization
├── editor # Project CRUD operations
├── finder # Project discovery
└── prompts # Interactive prompts

brix.utils
└── logging # Terraform-style logger
```

## Quick Examples

### Working with Profiles

```python
from brix.modules.dbt.profile.models import DbtProfiles, DuckDbOutput

# Create a profile programmatically
profiles = DbtProfiles(
profiles={
"my_project": {
"target": "dev",
"outputs": {
"dev": DuckDbOutput(path="./dev.duckdb"),
},
},
},
)

# Serialize to YAML
yaml_content = profiles.to_yaml()

# Parse from YAML
loaded = DbtProfiles.from_yaml(yaml_content)
```

### Working with Projects

```python
from brix.modules.dbt.project.models import DbtProject

# Load a project
with open("dbt_project.yml") as f:
project = DbtProject.from_yaml(f.read())

# Modify
project.name = "new_name"

# Save
with open("dbt_project.yml", "w") as f:
f.write(project.to_yaml())
```

## Reference Sections

- [Modules](modules.md) - Service and editor functions
- [Models](models.md) - Pydantic data models
19 changes: 19 additions & 0 deletions docs/api/models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Models Reference

Auto-generated API documentation for brix Pydantic models.

## Profile Models

::: brix.modules.dbt.profile.models
options:
show_root_heading: true
members_order: source
show_bases: true

## Project Models

::: brix.modules.dbt.project.models
options:
show_root_heading: true
members_order: source
show_bases: true
52 changes: 52 additions & 0 deletions docs/api/modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Modules Reference

Auto-generated API documentation for brix modules.

## Profile Service

::: brix.modules.dbt.profile.service
options:
show_root_heading: true
members_order: source

## Profile Editor

::: brix.modules.dbt.profile.editor
options:
show_root_heading: true
members_order: source

## Project Service

::: brix.modules.dbt.project.service
options:
show_root_heading: true
members_order: source

## Project Editor

::: brix.modules.dbt.project.editor
options:
show_root_heading: true
members_order: source

## Project Finder

::: brix.modules.dbt.project.finder
options:
show_root_heading: true
members_order: source

## dbt Passthrough

::: brix.modules.dbt.passthrough
options:
show_root_heading: true
members_order: source

## Logging

::: brix.utils.logging
options:
show_root_heading: true
members_order: source
Loading