Skip to content

Commit f2cc8ec

Browse files
binarykclaude
andcommitted
Initial release of aidocs-cli v0.1.0
AI-powered documentation generator CLI for Claude Code projects. Features: - `aidocs init` - Install docs module into any project - `aidocs check` - Verify required tools are installed - `aidocs version` - Show version info Installs slash commands: - /docs:init - Configure project settings - /docs:generate - Document a single page - /docs:analyze - Analyze codebase for a route - /docs:batch - Document multiple pages Requires Playwright MCP for browser automation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
0 parents  commit f2cc8ec

16 files changed

Lines changed: 1951 additions & 0 deletions

File tree

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual environments
24+
.venv/
25+
venv/
26+
ENV/
27+
28+
# IDE
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
34+
# Testing
35+
.tox/
36+
.coverage
37+
.coverage.*
38+
htmlcov/
39+
.pytest_cache/
40+
41+
# Distribution
42+
*.manifest
43+
*.spec
44+
45+
# Installer logs
46+
pip-log.txt
47+
pip-delete-this-directory.txt
48+
49+
# OS
50+
.DS_Store
51+
Thumbs.db

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 BinarCode
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# aidocs-cli
2+
3+
AI-powered documentation generator for web applications. Install docs commands into your Claude Code project.
4+
5+
## Installation
6+
7+
```bash
8+
# Install globally with uv
9+
uv tool install aidocs-cli --from git+https://github.com/binarcode/aidocs-cli.git
10+
11+
# Or install from PyPI (when published)
12+
uv tool install aidocs-cli
13+
14+
# Or use pipx
15+
pipx install aidocs-cli
16+
```
17+
18+
## Quick Start
19+
20+
```bash
21+
# Initialize in current directory
22+
aidocs init .
23+
24+
# Or create a new project
25+
aidocs init my-project
26+
27+
# Check your environment
28+
aidocs check
29+
```
30+
31+
## Commands
32+
33+
### `aidocs init [PROJECT_NAME]`
34+
35+
Initialize the docs module in a project.
36+
37+
```bash
38+
# Current directory
39+
aidocs init .
40+
41+
# New directory
42+
aidocs init my-project
43+
44+
# Force overwrite existing files
45+
aidocs init . --force
46+
47+
# Use with Cursor instead of Claude
48+
aidocs init . --ai cursor
49+
```
50+
51+
**Options:**
52+
- `--ai` - AI assistant to configure for (`claude`, `cursor`, `copilot`). Default: `claude`
53+
- `--force, -f` - Overwrite existing files
54+
- `--no-git` - Skip git initialization
55+
56+
**What it does:**
57+
1. Creates `.claude/commands/docs/` with slash command definitions
58+
2. Creates `docs-workflows/` with workflow implementations
59+
3. Updates `.gitignore` to exclude `.docs-auth`
60+
61+
### `aidocs check`
62+
63+
Check for required tools and dependencies.
64+
65+
```bash
66+
aidocs check
67+
```
68+
69+
**Checks for:**
70+
- Git
71+
- Claude Code CLI
72+
- Python 3.11+
73+
- uv
74+
- npx (for Playwright MCP)
75+
76+
### `aidocs version`
77+
78+
Show version information.
79+
80+
```bash
81+
aidocs version
82+
```
83+
84+
## After Installation
85+
86+
Once installed, use these Claude Code slash commands:
87+
88+
```bash
89+
# Initialize your project settings
90+
/docs:init
91+
92+
# Generate documentation for a page
93+
/docs:generate https://myapp.com/dashboard
94+
95+
# Analyze code without browser
96+
/docs:analyze /campaigns
97+
98+
# Batch generate for multiple pages
99+
/docs:batch --discover
100+
```
101+
102+
## Requirements
103+
104+
- Python 3.11+
105+
- Claude Code (or Cursor/Copilot)
106+
- Playwright MCP (for browser-based commands)
107+
108+
### Installing Playwright MCP
109+
110+
Add to your `~/.claude.json` or project `.mcp.json`:
111+
112+
```json
113+
{
114+
"mcpServers": {
115+
"playwright": {
116+
"command": "npx",
117+
"args": ["@anthropic/mcp-playwright"]
118+
}
119+
}
120+
}
121+
```
122+
123+
## Development
124+
125+
```bash
126+
# Clone the repository
127+
git clone https://github.com/binarcode/aidocs-cli.git
128+
cd aidocs-cli
129+
130+
# Install in development mode
131+
uv pip install -e .
132+
133+
# Run commands
134+
aidocs check
135+
aidocs init test-project
136+
```
137+
138+
## License
139+
140+
MIT

pyproject.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
[project]
2+
name = "aidocs-cli"
3+
version = "0.1.0"
4+
description = "AI-powered documentation generator for web applications. Install docs commands into your Claude Code project."
5+
readme = "README.md"
6+
license = { text = "MIT" }
7+
requires-python = ">=3.11"
8+
keywords = ["documentation", "claude", "ai", "playwright", "automation"]
9+
classifiers = [
10+
"Development Status :: 4 - Beta",
11+
"Environment :: Console",
12+
"Intended Audience :: Developers",
13+
"License :: OSI Approved :: MIT License",
14+
"Operating System :: OS Independent",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12",
18+
"Topic :: Documentation",
19+
"Topic :: Software Development :: Documentation",
20+
]
21+
dependencies = [
22+
"typer>=0.9.0",
23+
"rich>=13.0.0",
24+
]
25+
26+
[project.scripts]
27+
aidocs = "aidocs_cli:main"
28+
29+
[project.urls]
30+
Homepage = "https://github.com/binarcode/aidocs-cli"
31+
Repository = "https://github.com/binarcode/aidocs-cli"
32+
Issues = "https://github.com/binarcode/aidocs-cli/issues"
33+
34+
[build-system]
35+
requires = ["hatchling"]
36+
build-backend = "hatchling.build"
37+
38+
[tool.hatch.build.targets.wheel]
39+
packages = ["src/aidocs_cli"]
40+
41+
[tool.hatch.build.targets.sdist]
42+
include = [
43+
"/src",
44+
"/README.md",
45+
"/LICENSE",
46+
]

src/aidocs_cli/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"""AI-powered documentation generator CLI for Claude Code projects."""
2+
3+
__version__ = "0.1.0"
4+
5+
from .cli import app
6+
7+
8+
def main() -> None:
9+
"""Entry point for the CLI."""
10+
app()

src/aidocs_cli/cli.py

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
"""CLI commands for aidocs."""
2+
3+
from pathlib import Path
4+
from typing import Optional
5+
6+
import typer
7+
from rich.console import Console
8+
from rich.panel import Panel
9+
10+
from .installer import check_tools, install_docs_module
11+
12+
app = typer.Typer(
13+
name="aidocs",
14+
help="AI-powered documentation generator for web applications.",
15+
no_args_is_help=True,
16+
)
17+
console = Console()
18+
19+
20+
@app.command()
21+
def init(
22+
project_name: Optional[str] = typer.Argument(
23+
None,
24+
help="Project name or path. Use '.' for current directory.",
25+
),
26+
ai: str = typer.Option(
27+
"claude",
28+
"--ai",
29+
help="AI assistant to configure for (claude, cursor, copilot).",
30+
),
31+
force: bool = typer.Option(
32+
False,
33+
"--force",
34+
"-f",
35+
help="Overwrite existing files.",
36+
),
37+
no_git: bool = typer.Option(
38+
False,
39+
"--no-git",
40+
help="Skip git initialization.",
41+
),
42+
) -> None:
43+
"""Initialize docs module in a project.
44+
45+
Examples:
46+
aidocs init . # Current directory
47+
aidocs init my-project # New directory
48+
aidocs init . --force # Overwrite existing
49+
"""
50+
if project_name is None or project_name == ".":
51+
target_dir = Path.cwd()
52+
console.print(f"[blue]Initializing docs module in current directory...[/blue]")
53+
else:
54+
target_dir = Path.cwd() / project_name
55+
if not target_dir.exists():
56+
target_dir.mkdir(parents=True)
57+
console.print(f"[blue]Created directory: {project_name}[/blue]")
58+
console.print(f"[blue]Initializing docs module in {project_name}...[/blue]")
59+
60+
try:
61+
install_docs_module(target_dir, ai=ai, force=force, no_git=no_git)
62+
63+
console.print()
64+
console.print(Panel.fit(
65+
"[green]Docs module installed successfully![/green]\n\n"
66+
"[bold]Next steps:[/bold]\n"
67+
"1. Run [cyan]/docs:init[/cyan] in Claude Code to configure your project\n"
68+
"2. Run [cyan]/docs:generate <url>[/cyan] to document a page\n\n"
69+
"[dim]Requires Playwright MCP for browser automation.[/dim]",
70+
title="Success",
71+
border_style="green",
72+
))
73+
except Exception as e:
74+
console.print(f"[red]Error: {e}[/red]")
75+
raise typer.Exit(1)
76+
77+
78+
@app.command()
79+
def check() -> None:
80+
"""Check for required tools and dependencies."""
81+
console.print("[blue]Checking environment...[/blue]")
82+
console.print()
83+
84+
results = check_tools()
85+
86+
all_passed = all(results.values())
87+
88+
console.print()
89+
if all_passed:
90+
console.print(Panel.fit(
91+
"[green]All checks passed![/green]\n\n"
92+
"You're ready to use aidocs.",
93+
title="Environment Check",
94+
border_style="green",
95+
))
96+
else:
97+
console.print(Panel.fit(
98+
"[yellow]Some checks failed.[/yellow]\n\n"
99+
"Install missing tools to use all features.",
100+
title="Environment Check",
101+
border_style="yellow",
102+
))
103+
104+
105+
@app.command()
106+
def version() -> None:
107+
"""Show version information."""
108+
from . import __version__
109+
console.print(f"aidocs-cli version {__version__}")
110+
111+
112+
if __name__ == "__main__":
113+
app()

0 commit comments

Comments
 (0)