cli

Autoredocs CLI — command-line interface for generating code documentation.

📄 /home/runner/work/autoredocs/autoredocs/src/autoredocs/cli.py

Functions

def
def _build_docs(source: Path, output: Path, fmt: str, config: AutoredocsConfig, incremental: bool = False, ai: bool = False) -> None
Core build pipeline: parse -> [AI fill] -> generate (with optional incremental mode).
📍 Line 34
def
def _resolve_paths(source: str | None, output: str | None, fmt: str | None, config_file: str | None) -> tuple[Path, Path, str, AutoredocsConfig]
Resolve CLI args with config file fallbacks.
📍 Line 209
def
@app.command()
def generate(source: str = typer.Option(None, '--source', '-s', help='Source directory to parse'), output: str = typer.Option(None, '--output', '-o', help='Output directory for docs'), format: str = typer.Option(None, '--format', '-f', help='Output format: markdown or html'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml'), incremental: bool = typer.Option(False, '--incremental', '-i', help='Only rebuild changed files'), ai: bool = typer.Option(False, '--ai', help='Auto-fill missing docstrings with AI'), deploy: str = typer.Option(None, '--deploy', '-d', help='Deploy after build (netlify/vercel/s3)')) -> None
Generate documentation from your codebase.
📍 Line 229
def
@app.command()
def watch(source: str = typer.Option(None, '--source', '-s', help='Source directory to watch'), output: str = typer.Option(None, '--output', '-o', help='Output directory for docs'), format: str = typer.Option(None, '--format', '-f', help='Output format: markdown or html'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml')) -> None
Watch for file changes and auto-regenerate docs.
📍 Line 285
def
@app.command()
def preview(source: str = typer.Option(None, '--source', '-s', help='Source directory to parse'), output: str = typer.Option(None, '--output', '-o', help='Output directory for docs'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml'), port: int = typer.Option(None, '--port', '-p', help='Port for the preview server')) -> None
Generate HTML docs and open a local preview server.
📍 Line 310
def
@app.command()
def init(path: str = typer.Option('.', '--path', help='Project directory to initialize'), source: str = typer.Option('./src', '--source', '-s', help='Source directory containing your code'), ci: bool = typer.Option(True, '--ci/--no-ci', help='Scaffold GitHub Actions workflow'), with_ai: bool = typer.Option(True, '--ai/--no-ai', help='Include .env.example for AI setup')) -> None
Initialize autoredocs in your project — scaffolds config, CI/CD, and env files.
📍 Line 347
def
@app.command('ai-fill')
def ai_fill(source: str = typer.Option(None, '--source', '-s', help='Source directory to scan'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml'), dry_run: bool = typer.Option(False, '--dry-run', '-n', help='Preview without writing changes'), style: str = typer.Option(None, '--style', help='Docstring style: google, numpy, sphinx')) -> None
Generate missing docstrings using AI (OpenAI GPT).
📍 Line 439
def
@app.command()
def serve(source: str = typer.Option(None, '--source', '-s', help='Source directory'), output: str = typer.Option(None, '--output', '-o', help='Output directory'), fmt: str = typer.Option(None, '--format', '-f', help='Output format (html/markdown)'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml'), port: int = typer.Option(None, '--port', '-p', help='Server port (default: 8000)'), webhook_secret: str = typer.Option('', '--webhook-secret', help='GitHub webhook secret')) -> None
Start a live documentation server with build API and webhook support.
📍 Line 516
def
@app.command()
def deploy(output: str = typer.Option(None, '--output', '-o', help='Docs directory to deploy'), target: str = typer.Option(..., '--target', '-t', help='Deploy target: netlify, vercel, or s3'), config: str = typer.Option(None, '--config', '-c', help='Path to autoredocs.yaml')) -> None
Deploy generated docs to a hosting provider.
📍 Line 561
def
@app.command()
def version() -> None
Show autoredocs version.
📍 Line 599
def
@app.callback()
def main(verbose: bool = typer.Option(False, '--verbose', '-v', help='Enable verbose logging')) -> None
Autoredocs — self-maintaining code documentation tool.
📍 Line 608