Metadata-Version: 2.5
Name: code-to-docs
Version: 0.2.0
Summary: Generate and maintain end-user product documentation from application source code.
Project-URL: Homepage, https://github.com/MoshikoKar/Code-to-Docs
Project-URL: Repository, https://github.com/MoshikoKar/Code-to-Docs
Project-URL: Documentation, https://github.com/MoshikoKar/Code-to-Docs#readme
Project-URL: Issues, https://github.com/MoshikoKar/Code-to-Docs/issues
Project-URL: Changelog, https://github.com/MoshikoKar/Code-to-Docs/blob/main/CHANGELOG.md
Author: Code-to-Docs contributors
License: MIT License
        
        Copyright (c) 2026 Code-to-Docs contributors
        
        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: cli,documentation,help-center,nextjs,product,react
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: mcp<2.0,>=1.0
Provides-Extra: browser
Requires-Dist: playwright>=1.49; extra == 'browser'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: mypy>=1.11; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: twine>=5.1; extra == 'dev'
Description-Content-Type: text/markdown

# Code-to-Docs

Turn your app’s screens into a Help Center your users can actually read.

Code-to-Docs scans a React / Next.js project, figures out pages, forms, buttons, and navigation, then writes **plain-language product documentation** and a **searchable Help Center website**. Everything runs on your machine. Your source code is not uploaded anywhere.

**Current status:** alpha (`0.2.0`). The local workflow works today. Best results are with Next.js (App Router or Pages Router) apps. MCP and agent hooks are available for Claude Code, Codex, and Cursor.

---

## Who this is for

- Product and engineering teams who need user-facing docs that stay closer to the real UI
- People who want a starting Help Center without writing every article from scratch
- Teams that prefer a **local, private** tool over sending the codebase to a cloud service

It is **not** a general Markdown wiki and **not** developer API docs. The output is meant for end users of your product.

---

## What you get

After a successful build you typically have:

1. **Help Center site** — searchable, responsive pages styled from your app’s detected theme  
2. **User-facing articles** — written without source file paths or implementation jargon  
3. **Project state** — stored under `.code-to-docs/` inside your app repo so later runs can update only what changed

You can open the site locally with `code-to-docs preview`, or host the generated static files wherever you already publish docs.

---

## Requirements

- Python **3.10 or newer**
- Windows, macOS, or Linux
- A project Code-to-Docs can recognize (for example a Next.js / React app with `package.json`)

---

## Quick start

```shell
uvx code-to-docs init
```

## Recommended installation

```shell
uv tool install code-to-docs
```

## pipx

```shell
pipx install code-to-docs
```

## pip

```shell
pip install code-to-docs
```

To install from GitHub instead of PyPI:

```shell
uv tool install git+https://github.com/MoshikoKar/Code-to-Docs.git
```

```shell
pip install git+https://github.com/MoshikoKar/Code-to-Docs.git
```

Then initialize a project:

```shell
code-to-docs init
```

Check that it works:

```shell
code-to-docs --version
code-to-docs --help
```

### Upgrade

```shell
uv tool upgrade code-to-docs
pipx upgrade code-to-docs
pip install --upgrade code-to-docs
```

### Uninstall

```shell
uv tool uninstall code-to-docs
pipx uninstall code-to-docs
pip uninstall code-to-docs
```

Uninstalling the tool does **not** delete `.code-to-docs/` inside your application repositories.

---

## Everyday workflow

Install the **application once** on your machine (`uv tool install` / `pipx` / `pip`). Then, from inside an application repository:

### 1. Set up the project (and AI platforms)

```shell
code-to-docs install
```

This creates `.code-to-docs/config.yaml`, adds managed instruction sections for detected AI tools, and for Claude Code / Codex / Cursor also registers **global MCP + hooks** when those hosts support them. Your existing agent configs are preserved.

Preview without writing files:

```shell
code-to-docs install --dry-run
```

Target one or more tools explicitly:

```shell
code-to-docs install --platform cursor
code-to-docs install --platform codex --platform claude-code
```

Other instruction-only platforms include: `gemini-cli`, `antigravity`, `windsurf`, `zed`, `continue`, `opencode`, `qwen`, `qoder`, `kiro`, `copilot`, `copilot-cli`, `codebuddy`.

Prefer a guided setup wizard for **this repository only**?

```shell
code-to-docs init          # interactive
code-to-docs init --yes    # safe defaults, no prompts
```

`init` does not reinstall the global application or duplicate global MCP registrations.

### 2. Build the Help Center

```shell
code-to-docs build
```

This is the main command. It scans the app, generates documentation, and writes the static site (by default under `.code-to-docs/site/`).

### 3. Preview locally

```shell
code-to-docs preview
```

Open the URL it prints (default `http://127.0.0.1:4173`). Press Ctrl+C to stop.

### 4. Keep docs in sync as the product changes

```shell
code-to-docs update      # refresh after code changes
code-to-docs status      # see project + integration state
code-to-docs validate    # check for broken relationships
code-to-docs hook stop   # agent lifecycle impact check (no full rebuild)
code-to-docs mcp         # stdio MCP server for connected agents
```

See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md) for MCP tools, hooks, uninstall, and the global vs project model.

### 5. Remove platform integration (optional)

```shell
code-to-docs uninstall --platform cursor
```

This removes owned MCP/hook/instruction entries and **keeps** `.code-to-docs/` project state.
---

## Where files live

| Location | Purpose |
|---|---|
| `.code-to-docs/config.yaml` | Your project settings |
| `.code-to-docs/docs/` | Generated Markdown / documentation model |
| `.code-to-docs/site/` | Static Help Center you can preview or publish |
| `.code-to-docs/graph/` | Internal product map used to build articles |
| `.code-to-docs/state.db` | Fingerprints so unchanged files are not reworked every time |

You can commit or ignore generated output depending on your team’s preference. Secrets and `.env` files are not scanned into documentation.

---

## Privacy

- Analysis runs **locally**
- Source is **not** sent to an external service by default
- Optional browser extras are separate; the normal install stays lightweight and does not download browser runtimes

Optional (advanced) browser package:

```shell
pip install "code-to-docs[browser]"
```

---

## Useful commands at a glance

| Command | When to use it |
|---|---|
| `install` | First-time setup + AI tool instructions |
| `build` | Create or fully rebuild the Help Center |
| `preview` / `serve` | View the site on your machine |
| `update` | Refresh after product changes |
| `status` | See current state at a glance |
| `validate` | Catch stale or broken doc links to the product map |
| `detect` | See what stack Code-to-Docs detected |
| `init` | Wizard-style configuration |
| `scan` / `analyze` | Advanced: run individual stages only |

Run any command from another folder with `--root path/to/your-app`.

---

## Tips for better results

- Start with a Next.js app that has clear pages (`page.tsx` / `pages/…`), visible headings, and labeled buttons/forms
- Run `build` again after larger UI changes, or use `update` for ongoing maintenance
- Use `install --dry-run` before letting the tool touch AI instruction files
- Treat generated articles as a **strong first draft**: edit tone and product nuance where humans still know best

---

## Contributing & internals

If you are developing Code-to-Docs itself, see [CONTRIBUTING.md](CONTRIBUTING.md). Architecture and release notes live in [ARCHITECTURE.md](ARCHITECTURE.md), [docs/IMPLEMENTATION.md](docs/IMPLEMENTATION.md), and [docs/RELEASING.md](docs/RELEASING.md).

## License

MIT — see [LICENSE](LICENSE). Community standards: [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
