Metadata-Version: 2.4
Name: oneport-docgen
Version: 0.1.0
Summary: Enterprise documentation generator — point it at any repo (no upload) and get a branded, sign-off-ready Technical Design Document as PDF, editable Word (.docx) and Markdown, with full document control. Runs locally on your own key.
Project-URL: Homepage, https://github.com/oneport-debug/oneport-docgen
Project-URL: Repository, https://github.com/oneport-debug/oneport-docgen
Author: OnePort Contributors
License: Apache-2.0
License-File: LICENSE
Keywords: compliance,design-document,developer-tools,docgen,documentation,docx,enterprise,pdf,sdd,technical-writing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Documentation
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: click>=8.1.7
Requires-Dist: oneport-context>=0.1.0
Requires-Dist: oneport-debug-core>=0.1.0
Requires-Dist: python-docx>=1.1.0
Requires-Dist: reportlab>=4.0.0
Requires-Dist: rich>=13.8.0
Description-Content-Type: text/markdown

# oneport-docgen

**Enterprise documentation for any codebase — generated locally, never uploaded.**

Point it at a repo and it produces a formal, sign-off-ready **Technical Design
Document** as a branded **PDF**, an **editable Word (`.docx`)** file, and
**Markdown** — with the full apparatus enterprises expect: cover page,
document-control table, revision history, classification banner, numbered
sections and an approval/sign-off page.

It reuses [`oneport-context`](https://pypi.org/project/oneport-context/)'s local
repo index (file → module → repo understanding), so your code never leaves the
machine. Runs on your own model key (Google Gemini free tier) or fully heuristic —
free and offline.

## Quickstart

```bash
pip install oneport-docgen
oneport-docgen generate ./my-repo
```

You'll be asked for the title, version, classification and sign-off names (authors
are pre-filled from `git`). Out come three files in `./my-repo/.docgen/`:

```
my-repo-technical-design-document.pdf     # branded, ready to hand to an exec/auditor
my-repo-technical-design-document.docx    # editable in Word / SharePoint
my-repo-technical-design-document.md      # for the wiki / repo
```

Set a key for richer prose (optional):

```bash
export GEMINI_API_KEY=…       # free key at aistudio.google.com/apikey
```

Without a key it still generates a complete, accurate document — module breakdown,
tech stack and file inventory come straight from the code; only the narrative
sections get shorter.

## Commands

| Command | What it does |
|---|---|
| `generate ./repo` | Build the document (PDF + DOCX + Markdown) |
| `init` | Scaffold a `docgen.toml` branding file |
| `formats` | List output formats and document types |

## Document types (`--type`)

| Type | Produces |
|---|---|
| `tdd` *(default)* | Technical Design Document — architecture, modules, data flow, setup |
| `sdd` | Software Design Description (same engine, formal title) |
| `onboarding` | Engineering Onboarding Guide |
| `sbom` | **Software Bill of Materials** — deterministic dependency + license inventory with risk findings |

```bash
oneport-docgen generate ./repo --type sbom      # audit-grade dependency/license report
```

The **SBOM** is generated *deterministically* from your manifests (`requirements.txt`,
`pyproject.toml`, `package.json`, `go.mod`, `Cargo.toml`, `Gemfile`, `composer.json`,
`pom.xml`, Gradle) — **no AI, fully auditable**. For Python it resolves real versions
and licenses from installed metadata, and flags unpinned versions, unknown licenses and
copyleft components.

## Useful flags

```bash
oneport-docgen generate ./repo \
  --format pdf,docx \                 # pick outputs (pdf, docx, md)
  --scope module:services/billing \   # document just one module
  --classification Internal \
  --version 2.1 --status "In Review" \
  --author "Ada Lovelace" --approver "Grace Hopper" \
  -y                                   # non-interactive (for CI)
```

## Branding

```bash
oneport-docgen init            # writes docgen.toml
```

```toml
[brand]
company = "Acme Corporation"
logo    = "assets/logo.png"
primary = "#0F172A"
accent  = "#4F46E5"
footer  = "Confidential — internal distribution only"
```

Every generated document then carries your company name, logo and colours.

## Where it's going

- **Phase 1 — formal deliverable** *(shipped)*: branded PDF + editable DOCX + Markdown.
- **Phase 2 — compliance doctypes** *(in progress)*: `--type sbom` shipped; threat model
  and ADR log next.
- **Phase 3 — living docs:** `oneport-docgen check` fails CI when the code and the
  document drift apart (every claim is provenance-linked to the source).

## License

Apache-2.0
