Skip to main content

Generate and maintain README files for Python repositories from static analysis.

Project description

AutoReadme

PyPI version Python versions License CI Downloads

Generate and maintain a README for your Python repo from static analysis — no source code ever leaves your machine.

uvx --from 'autoreadme-ai' autoreadme .

AutoReadme walks your repo with the stdlib ast module, extracts structured metadata (signatures, docstrings, project config, CLI parsers), and sends only that metadata to an LLM to write prose. The payload schema has no field for function bodies, so source code transmission isn't prevented by policy — it's prevented by the shape of the data.

Installation

uv tool install autoreadme-ai[anthropic,openai]

Install the tool as a command-line application using uv. The extras include optional dependencies for Anthropic and OpenAI providers. For one-shot usage without persistent installation, use uvx autoreadme-ai[all]. You can also install with pipx install autoreadme-ai[all] or pip install autoreadme-ai.

Quick start

export ANTHROPIC_API_KEY=sk-...
autoreadme .

That's the whole flow: extract → pre-flight token check → single LLM call → colored diff → approve (Y/n/d/q) → write with .bak backup.

Preview without writing:

autoreadme --dry-run

Inspect exactly what would be sent to the LLM (no network call):

autoreadme --show-payload

How it protects your code

Three layers:

  1. Schema. RepoMetadata, FileMetadata, FunctionSignature etc. have no body / source / raw field. There is no code path that can attach one.
  2. Pre-flight disclosure. Before every LLM call, stderr shows exactly how many KB are about to leave your machine and where they're going:
    → Sending 14KB of structured metadata to anthropic (claude-sonnet-4-...).
      No source code included.
    
  3. --show-payload. Dumps the full JSON to stdout and exits without making the call. Diff it, grep it, paste it into an issue.

Secret files (.env*, *.key, *.pem, credentials.*) are unconditionally excluded from extraction regardless of config.

Staying in sync

Generated sections are wrapped in HTML comment markers:

<!-- autoreadme:install:start -->
(generated content)
<!-- autoreadme:install:end -->

## Docker Setup
(your content — never touched)

On subsequent runs, only content between markers is replaced. Manual sections between, before, or after markers are preserved verbatim.

Providers

Provider Default model Env var
anthropic claude-sonnet-4-20250514 ANTHROPIC_API_KEY
openai gpt-4o OPENAI_API_KEY
ollama llama3.1 OLLAMA_HOST

If no --provider is set, AutoReadme picks the one whose env var is populated. Override the model with --model or .autoreadme.toml.

Config file

Drop .autoreadme.toml at your repo root:

[llm]
provider = "anthropic"
model = "claude-sonnet-4-20250514"

[extract]
exclude = ["tests/**", "docs/**"]

Resolution precedence: CLI flags > .autoreadme.toml > env vars > defaults.

GitHub Action

- uses: atharvakadam/autoreadme-ai@v1
  with:
    provider: anthropic
    api-key: ${{ secrets.ANTHROPIC_API_KEY }}

The action runs with --force (non-interactive). Pair it with a PR-opening step if you want review before merge.

CLI Reference

autoreadme [PATH] [OPTIONS]

Arguments:

  • PATH - Path to the repo root (default: .)

Options:

  • --provider - LLM provider: anthropic | openai | ollama
  • --model - Model override
  • --dry-run - Write result to stdout instead of disk
  • --force - Apply without interactive approval
  • --show-payload - Dump JSON payload to stdout and exit
  • --verbose - Verbose log output
  • --output - Output path (default:
  • --version - Print version and exit

Exit codes: 0 success · 1 user rejected diff · 2 config/usage/non-TTY · 3 extraction failed · 4 LLM failed.

Scope

v0.1 is deliberately narrow. No monorepo handling, no section-level approval, no custom prompt templates, no non-Python languages, no telemetry. See SPEC.md §15 for the full non-goals list and §16 for the v0.2 plan.

Contributing

See CONTRIBUTING.md. TL;DR: uv sync --all-extras, then uv run pytest / uv run ruff check / uv run mypy src/ before opening a PR.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoreadme_ai-0.1.2.tar.gz (86.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoreadme_ai-0.1.2-py3-none-any.whl (39.5 kB view details)

Uploaded Python 3

File details

Details for the file autoreadme_ai-0.1.2.tar.gz.

File metadata

  • Download URL: autoreadme_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 86.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autoreadme_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a2a1e63ca647d1c438dd6ff3c91929cc24dcd684683f16c6164110870607fbaa
MD5 0ed3c2cea612ca83d3a71163a7ee9176
BLAKE2b-256 c7fe33c57d54b0abe873f7435a136781aaba58f7540395ed95a39446e6bc4a5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoreadme_ai-0.1.2.tar.gz:

Publisher: release.yml on atharvakadam/autoreadme-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autoreadme_ai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: autoreadme_ai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 39.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for autoreadme_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0546a633c915c3cd9fee6747dbe2ff0cbfbcd4130b2e349a25234da21d01bf41
MD5 e0ac2e500bb6b1a94c30f0c9ecd74b3a
BLAKE2b-256 dbea96c3debac8ceafec4630f5a1ef53a3936ddd66bed97a9594b849f6b1df7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for autoreadme_ai-0.1.2-py3-none-any.whl:

Publisher: release.yml on atharvakadam/autoreadme-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page