Skip to main content

A language-agnostic documentation generator using Cursor AI

Project description

waygrounddocgen

A language-agnostic CLI tool that leverages Cursor AI to automatically discover modules in any codebase and generate comprehensive documentation for each module in parallel.

Features

  • 🔍 Auto-Discovery: Uses Cursor AI to identify logical modules/components in any language
  • 📝 Parallel Generation: Runs multiple Cursor tasks simultaneously for faster documentation
  • 🌐 Language Agnostic: Works with TypeScript, Python, Go, Java, Rust, and more
  • 📋 Customizable Prompts: Built-in prompt templates with support for customization
  • 📊 Progress Tracking: Clear output showing progress and results

Prerequisites

  1. Python 3.8+ installed
  2. Cursor CLI installed and available in PATH
    curl https://cursor.com/install -fsS | bash
    
    Or from GUI: Cursor → Settings → General → Command Line → Install

Installation

From PyPI (Recommended)

pip install waygrounddocgen

From Source

git clone https://github.com/gauravmadan/waygrounddocgen.git
cd waygrounddocgen
pip install -e .

Quick Start

# Check if Cursor CLI is available
waygrounddocgen check

# Discover modules in a repository
waygrounddocgen discover /path/to/your/repo

# Generate documentation (discover + generate)
waygrounddocgen generate /path/to/your/repo

Usage

Discover Modules

Analyze a repository to identify its logical modules/components:

waygrounddocgen discover /path/to/repo
waygrounddocgen discover /path/to/repo --output modules.json

Output is a JSON file with discovered modules:

{
  "repo_path": "/path/to/repo",
  "language": "typescript",
  "framework": "express",
  "modules": [
    {
      "name": "auth",
      "path": "src/services/auth",
      "description": "Authentication and authorization service",
      "type": "service",
      "files": ["auth.service.ts", "auth.guard.ts"],
      "entry_points": ["AuthService", "authenticate"]
    }
  ]
}

Generate Documentation

Generate documentation for all discovered modules:

# Full pipeline (discover + generate)
waygrounddocgen generate /path/to/repo

# With custom parallelism
waygrounddocgen generate /path/to/repo --parallel 8

# From existing modules.json
waygrounddocgen generate /path/to/repo --modules modules.json

# Only specific modules
waygrounddocgen generate /path/to/repo --filter auth,users,payments

# Custom output directory
waygrounddocgen generate /path/to/repo --output ./docs/api

Options

Option Short Description
--modules -m Path to existing modules.json file
--output -o Output directory for documentation
--parallel -p Number of parallel Cursor tasks (default: 4)
--filter -f Comma-separated list of module names
--template -t Prompt template: generate_doc (default) or comprehensive
--quiet -q Suppress streaming output (hide Cursor's thinking)

Output Structure

docs/generated/
├── README.md           # Index of all modules
├── auth.md            # Auth module documentation
├── users.md           # Users module documentation
├── payments.md        # Payments module documentation
└── ...

Example Workflow

# 1. Navigate to your repository
cd /path/to/your/project

# 2. Discover modules
waygrounddocgen discover . --output modules.json

# 3. Review discovered modules
cat modules.json | jq '.modules[].name'

# 4. Generate documentation
waygrounddocgen generate . --modules modules.json

# 5. View generated docs
open docs/generated/README.md

Troubleshooting

Cursor CLI not found

# Check if cursor is in PATH
which cursor

# If not, install from Cursor:
# Settings → General → Command Line → Install

No modules discovered

  1. Check if the repository has a recognizable structure
  2. Verify the prompts match your project patterns
  3. Run discovery manually and review output

Parallel tasks timing out

Reduce parallelism or increase timeout:

# Use fewer parallel tasks
waygrounddocgen generate /path/to/repo --parallel 2

Development

Install for Development

git clone https://github.com/gauravmadan/waygrounddocgen.git
cd waygrounddocgen
pip install -e ".[dev]"

Build and Publish

# Build the package
python -m build

# Upload to PyPI
twine upload dist/*

License

MIT License - see LICENSE for details.

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

waygrounddocgen-0.1.0.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

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

waygrounddocgen-0.1.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file waygrounddocgen-0.1.0.tar.gz.

File metadata

  • Download URL: waygrounddocgen-0.1.0.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for waygrounddocgen-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78faa433b3b9e830a118b50ac8264692b351f69694bc842d641199b04dca3f19
MD5 af3ba691a5d1f53a2fafe05a0147f413
BLAKE2b-256 bbc3c64e0780af7fdfee885496ebe0428d949f3f67aadcc25fd29b40c3a71a72

See more details on using hashes here.

File details

Details for the file waygrounddocgen-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for waygrounddocgen-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2de2728dd7877825cff9599f01967e42ea21c12168d00e0b819cb7724f5eca78
MD5 3bb73eecfbccfad10f2cacf20cb59974
BLAKE2b-256 c004947f0a6c8b8c860df7ff530333a95be7132384e2b3c713edc86763e1646b

See more details on using hashes here.

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