Skip to content

Commit a1f83e9

Browse files
committed
feat: add docgen init wizard for project scaffolding
New `docgen init` command interactively scaffolds a project with: - docgen.yaml configuration tailored to the project - Wrapper shell scripts (generate-all.sh, compose.sh, etc.) - Directory structure (narration/, audio/, animations/, terminal/, recordings/) - Starter narration files for each segment - Optional pre-push validation hook via pre-commit - narration/README.md with voice-first editing tips The wizard auto-detects git root, scans for existing narration files to infer segments, and preserves any files already present. Generated config is immediately usable with all docgen commands. 12 unit tests cover detection, scanning, generation, and edge cases. Made-with: Cursor
1 parent 7bb55f3 commit a1f83e9

File tree

3 files changed

+672
-0
lines changed

3 files changed

+672
-0
lines changed

src/docgen/cli.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
import os
6+
from pathlib import Path
67

78
import click
89

@@ -39,6 +40,22 @@ def main(ctx: click.Context, config_path: str | None) -> None:
3940
_load_env(cfg)
4041

4142

43+
@main.command()
44+
@click.argument("target_dir", required=False, default=None, type=click.Path())
45+
@click.pass_context
46+
def init(ctx: click.Context, target_dir: str | None) -> None:
47+
"""Scaffold a new project: docgen.yaml, wrapper scripts, directories.
48+
49+
Optionally pass a target directory (defaults to current directory).
50+
"""
51+
from docgen.init import generate_files, print_summary, run_wizard
52+
53+
target = Path(target_dir).resolve() if target_dir else None
54+
plan = run_wizard(target_dir=target)
55+
created = generate_files(plan)
56+
print_summary(plan, created)
57+
58+
4259
@main.command()
4360
@click.option("--port", default=8501, help="Port for the wizard web server.")
4461
@click.pass_context

0 commit comments

Comments
 (0)