Metadata-Version: 2.4
Name: docwright
Version: 0.1.27
Summary: AI-powered documentation agent: auto-generates and maintains README & wiki on every commit
License: MIT
License-File: LICENSE
Keywords: documentation,ai,llm,claude,openai,git,automation
Author: Artem Gotlib
Author-email: gotlib.artem.m@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Topic :: Utilities
Requires-Dist: anthropic (>=0.28,<0.29)
Requires-Dist: click (>=8.1,<9.0)
Requires-Dist: gitpython (>=3.1,<4.0)
Requires-Dist: httpx (>=0.27,<0.28)
Requires-Dist: jinja2 (>=3.1,<4.0)
Requires-Dist: openai (>=1.30,<2.0)
Requires-Dist: pydantic (>=2.0,<3.0)
Requires-Dist: pyyaml (>=6.0,<7.0)
Requires-Dist: rich (>=13.0,<14.0)
Project-URL: Homepage, https://github.com/GotlibArtem/docwright
Project-URL: Repository, https://github.com/GotlibArtem/docwright
Description-Content-Type: text/markdown

# docwright

AI-powered documentation agent that watches your commits and keeps README and wiki pages up to date automatically.

## How It Works

```
Developer commits / pushes
        │
        ▼
CI runs docwright
        │
        ├─ First run?
        │   └─ Generates all docs from scratch via LLM
        │
        └─ Already initialized?
            ├─ No relevant changes → skips (fast)
            └─ Relevant changes → updates only affected AUTO sections
                        │
                        ▼
             Direct commit  OR  Pull Request (configurable)
```

The agent only rewrites `<!-- AUTO:section -->` blocks. Anything you write manually stays untouched.

## Quick Start

Install into any repository:

```bash
pip install docwright
docwright install
```

This asks two questions (AI provider, commit mode) and creates:
- `.docwright/docwright.yml` — config
- `Makefile` targets: `make docs`, `make docs-sync`
- CI workflow (GitHub Actions or GitLab CI)

Then generate docs for the first time:

```bash
make docs
```

After that, docs update automatically on every push.

## CLI Commands

| Command | Description |
|---------|-------------|
| `docwright install` | Bootstrap a repository (interactive or `--auto`) |
| `docwright init` | Generate all documents from scratch |
| `docwright run` | Update changed sections based on latest diff |
| `docwright sync` | Force re-sync all AUTO sections |
| `docwright dashboard` | Terminal table of all registered projects |
| `docwright report` | Generate static HTML status report |

## Configuration

`.docwright/docwright.yml`:

```yaml
provider:
  type: claude          # claude | openai | ollama
  model: claude-opus-4-7
  api_key_env: ANTHROPIC_API_KEY

output:
  mode: direct          # direct | pull_request

triggers:
  paths:
    - "src/**"
    - "app/**"
  ignore:
    - "tests/**"

documents:
  - type: readme
    template: readme/default
    target: README.md
  - type: wiki
    template: wiki/architecture
    target: docs/wiki/architecture.md
```

## Supported Providers

| Provider | When to use |
|----------|-------------|
| Claude (Anthropic) | Best output quality |
| OpenAI (GPT-4o) | Alternative if you have OpenAI keys |
| Ollama | Local model, no external API — for private projects |

## Document Templates

Built-in templates cover the full documentation surface:

| Template | AUTO sections |
|----------|---------------|
| `readme/default` | overview, getting_started, architecture, api, development |
| `wiki/architecture` | overview, components, data_flow, dependencies |
| `wiki/api-contracts` | endpoints, authentication, error_codes |
| `wiki/development-guide` | setup, testing, code_style |
| `wiki/operations` | deployment, monitoring, runbooks, incident_response |
| `wiki/data-model` | entities, business_rules, relationships |
| `wiki/db-schema` | tables, indexes, migrations |
| `wiki/integrations` | external_services, auth_credentials, data_exchange |
| `wiki/security` | access_model, sensitive_data, requirements |
| `wiki/troubleshooting` | common_issues, diagnostics, known_limitations |
| `wiki/adr` | recent_decisions, decision_index |

Custom templates go in `.docwright/templates/` inside your repository.

## AUTO / MANUAL Sections

```markdown
# README

<!-- AUTO:overview -->
This section is managed by docwright.
<!-- /AUTO:overview -->

<!-- MANUAL -->
## Contributing

Write whatever you want here — docwright never touches MANUAL blocks.
<!-- /MANUAL -->
```

## Central Registry

After `docwright init`, the project is registered in a central `registry.yml`. View all projects:

```bash
docwright dashboard          # terminal table
docwright report             # HTML page at docwright-report.html
```

## Development

```bash
poetry install
poetry run pytest             # 46 tests
poetry run ruff check .       # lint
poetry run mypy docwright    # type check
```

## License

MIT

