Metadata-Version: 2.4
Name: hello-build-agent
Version: 0.5.5
Summary: Autonomous build assistant that generates Dockerfiles, ingests repos into Qdrant, and self-heals via LLM.
Project-URL: Homepage, https://github.com/x0iv/hello-build-agent
Project-URL: Changelog, https://github.com/x0iv/hello-build-agent/releases
Project-URL: Issues, https://github.com/x0iv/hello-build-agent/issues
Author-email: Ivan Khozyainov <ivan.khozyainov@gmail.com>
License: Copyright 2025 Ivan Khozyainov
        
        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
License-File: LICENSE
Keywords: agent,agentic-ai,devops-tools,dind,docker,langchain,langchain-python,pypi-package,qdrant,rag
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.9
Requires-Dist: docker>=7.0
Requires-Dist: gitpython>=3.1
Requires-Dist: langchain-openai>=0.1.0
Requires-Dist: openai>=1.14
Requires-Dist: python-dotenv>=1.0
Requires-Dist: qdrant-client>=1.9
Requires-Dist: rich>=13.7
Requires-Dist: typer[all]>=0.12
Provides-Extra: dev
Requires-Dist: black; extra == 'dev'
Requires-Dist: bumpver; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# hello-build-agent

> **Autonomous DevOps side-kick**  
> Clones any public repo, indexes docs to Qdrant, asks an LLM to craft the
> optimal **Dockerfile**, then builds, self-repairs and logs every step.

[![PyPI](https://img.shields.io/pypi/v/hello-build-agent.svg)](https://pypi.org/project/hello-build-agent)
[![CI](https://github.com/x0iv/hello-build-agent/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/x0iv/hello-build-agent/actions)
[![Docker](https://img.shields.io/docker/pulls/x0iv/hello-build-agent)](https://hub.docker.com/r/x0iv/hello-build-agent)

[Changelog](CHANGELOG.md) • [License](LICENSE)

[![Build Agent Demo](https://github.com/x0iv/hello-build-agent/raw/main/peek.gif)](https://github.com/x0iv/hello-build-agent/raw/main/peek.gif)
---

## ✨ Key features

| 🧩 | Description |
|----|-------------|
| **LLM-driven Dockerfile** | Uses OpenAI (GPT-4o* by default) to propose a minimal, working Dockerfile based on real file-tree analysis. |
| **Self-healing loop**     | If the image fails to build, the agent feeds the error back to the LLM → receives a patch → retries ― until success or user input. |
| **Qdrant ingestion & search** | README and file-tree chunks are embedded and stored in Qdrant; you can query them later (`query_qdrant`). |
| **Quota guards**          | Two env-controlled limits: `QUOTA_TOKENS`, `QUOTA_FAILS` ― agent pauses and asks the human before overspending. |
| **Live Rich logs**        | Timestamp · action · comment · token-counter, neatly aligned and colourised. |
| **CI/CD ready**           | GitHub Actions → PyPI wheel + Docker Hub image on each `vX.Y.Z` tag. |

\* Change the model with the `MODEL` env var or `--model` CLI flag.

---

## 🚀 Quick start


```bash
./quickstart.sh
```

`build_logs/` and `workspace/` are mounted on the host for inspection.

---

## 🛠️  CLI flags & env vars

| CLI flag / env                  | Default              | Purpose                                    |
| ------------------------------- | -------------------- | ------------------------------------------ |
| `--docker-host` / `DOCKER_HOST` | `tcp://dind:2375`    | Where to talk to Docker daemon             |
| `--qdrant-url` / `QDRANT_URL`   | `http://qdrant:6333` | Qdrant instance                            |
| `--model` / `MODEL`             | `gpt-4o-mini`        | OpenAI model name                          |
| `QUOTA_TOKENS`                  | `10000`              | Ask human after this many tokens           |
| `QUOTA_FAILS`                   | `3`                  | Ask human after N consecutive build errors |
| `DISABLE_HITL`                  | `false`              | `true` → fully autonomous, no prompts      |

---

## 🧭  Architecture (90 sec overview)

```
CLI ─┬─ SystemPrompt (strict JSON contract)
     │
     ├─ loop.py  (LLM ↔ actions ↔ tracker/logs)
     │     ├─ tracker  ─── prints Rich log & enforces quotas
     │     ├─ actions  ─── clone, ingest, build, …
     │     └─ logger   ─── file logs (.log) for post-mortem
     │
     └─ docker_io.py  ── minimal, tail-aware build helper
```

---


## 📜 License

This project is distributed under the **MIT License** (see `LICENSE`).

---

Made with ❤️ & LLM-powered automation.