-
Notifications
You must be signed in to change notification settings - Fork 0
feat: docsfy - AI-powered documentation generator #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3a6e10d
docs: add docsfy implementation plan with 13 TDD tasks
myakove 51992e9
feat: project scaffolding with build config, linters, and container s…
myakove 266378c
feat: add configuration module with pydantic-settings
myakove 46260b0
feat: add pydantic models for requests, doc plans, and project status
myakove 704f95c
feat: add SQLite storage layer for project metadata
myakove 6baa531
feat: add AI CLI provider module with claude, gemini, and cursor support
myakove bf3de30
feat: add multi-strategy JSON response parser for AI CLI output
myakove e677e22
feat: add repository cloning with shallow clone support
myakove a6ebe3c
feat: add AI prompt templates for planner and page generation
myakove ac20aaf
feat: add documentation generator with planner and concurrent page ge…
myakove 87bfd84
feat: add HTML renderer with Jinja2 templates, dark/light theme, and …
myakove ca61712
feat: add FastAPI application with all API endpoints
myakove 5adda1c
test: add integration test for full generate-serve-download flow
myakove d4641af
fix: remove gcloud and cursor volume mounts from docker-compose
myakove c8ae10f
fix: resolve all pre-commit hook issues
myakove 2531288
fix: add uv.lock and copy it in Dockerfile for frozen sync
myakove 2e8c640
fix: optimize Dockerfile layer caching - CLI installs cached independ…
myakove 66f3981
feat: add llms.txt generation, on-this-page TOC, strip AI preamble, f…
myakove 3480e8a
feat: add UI improvements, ai-cli-runner migration, local repo suppor…
myakove 2240baf
chore: remove all Mintlify references
myakove a8f6b3c
fix: address all code review findings - security, bugs, error handling
myakove 5ef8a0d
fix: address all CodeRabbit review findings
myakove f925574
fix: address CodeRabbit round 2 review findings
myakove 74283ca
fix: address CodeRabbit round 3 findings, fix docker watch ignores
myakove 7fd11bb
fix: add status validation, UTF-8 encoding, stronger test assertions
myakove 9096148
fix: incremental page count updates, project name in logs, remove dup…
myakove 8a66f7b
fix: UTF-8 read encoding, slug validation, serve_docs dir guard, prev…
myakove File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # AI Configuration | ||
| AI_PROVIDER=claude | ||
| # [1m] = 1 million token context window, this is a valid model identifier | ||
| AI_MODEL=claude-opus-4-6[1m] | ||
| AI_CLI_TIMEOUT=60 | ||
|
|
||
| # Claude - Option 1: API Key | ||
| # ANTHROPIC_API_KEY= | ||
|
|
||
| # Claude - Option 2: Vertex AI | ||
| # CLAUDE_CODE_USE_VERTEX=1 | ||
| # CLOUD_ML_REGION= | ||
| # ANTHROPIC_VERTEX_PROJECT_ID= | ||
|
|
||
| # Gemini | ||
| # GEMINI_API_KEY= | ||
|
|
||
| # Cursor | ||
| # CURSOR_API_KEY= | ||
|
|
||
| # Logging | ||
| LOG_LEVEL=INFO | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [flake8] | ||
| select=M511 | ||
|
|
||
| exclude = | ||
| doc, | ||
| .tox, | ||
| .git, | ||
| *.yml, | ||
| Pipfile.*, | ||
| docs/*, | ||
| .cache/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [extend] | ||
| useDefault = true | ||
|
|
||
| [allowlist] | ||
| paths = [ | ||
| '''tests/test_repository\.py''', | ||
| ] | ||
myakove marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| default_language_version: | ||
| python: python3 | ||
|
|
||
| ci: | ||
| autofix_prs: false | ||
| autoupdate_commit_msg: "ci: [pre-commit.ci] pre-commit autoupdate" | ||
|
|
||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| - id: check-docstring-first | ||
| - id: check-executables-have-shebangs | ||
| - id: check-merge-conflict | ||
| - id: check-symlinks | ||
| - id: detect-private-key | ||
| - id: mixed-line-ending | ||
| - id: debug-statements | ||
| - id: trailing-whitespace | ||
| args: [--markdown-linebreak-ext=md] | ||
| - id: end-of-file-fixer | ||
| - id: check-ast | ||
| - id: check-builtin-literals | ||
| - id: check-toml | ||
|
|
||
| # flake8 retained for RedHatQE M511 plugin; ruff handles standard linting | ||
| - repo: https://github.com/PyCQA/flake8 | ||
| rev: 7.3.0 | ||
| hooks: | ||
| - id: flake8 | ||
| args: [--config=.flake8] | ||
| additional_dependencies: | ||
| # Tracks main branch intentionally for latest RedHatQE flake8 plugins | ||
| [git+https://github.com/RedHatQE/flake8-plugins.git, flake8-mutable] | ||
|
|
||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - repo: https://github.com/Yelp/detect-secrets | ||
| rev: v1.5.0 | ||
| hooks: | ||
| - id: detect-secrets | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.2 | ||
| hooks: | ||
| - id: ruff | ||
| - id: ruff-format | ||
|
|
||
| - repo: https://github.com/gitleaks/gitleaks | ||
| rev: v8.30.0 | ||
| hooks: | ||
| - id: gitleaks | ||
|
|
||
| - repo: https://github.com/pre-commit/mirrors-mypy | ||
| rev: v1.19.1 | ||
| hooks: | ||
| - id: mypy | ||
| exclude: (tests/) | ||
| additional_dependencies: | ||
| [types-requests, types-PyYAML, types-colorama, types-aiofiles, pydantic, types-Markdown] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # syntax=docker/dockerfile:1 | ||
| FROM python:3.12-slim AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install uv | ||
| COPY --from=ghcr.io/astral-sh/uv:0.5.14 /uv /usr/local/bin/uv | ||
|
|
||
| # Install git (needed for gitpython dependency) | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| git \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Copy project files | ||
| COPY pyproject.toml uv.lock ./ | ||
| COPY src/ src/ | ||
|
|
||
| # Create venv and install dependencies | ||
| RUN uv sync --frozen --no-dev | ||
|
|
||
| # Production stage | ||
| FROM python:3.12-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install bash (needed for CLI install scripts), git (required at runtime for gitpython), curl (for Claude CLI), and nodejs/npm (for Gemini CLI) | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| bash \ | ||
| git \ | ||
| curl \ | ||
| nodejs \ | ||
| npm \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Create non-root user, data directory, and set permissions | ||
| # OpenShift runs containers as a random UID in the root group (GID 0) | ||
| RUN useradd --create-home --shell /bin/bash -g 0 appuser \ | ||
| && mkdir -p /data \ | ||
| && chown appuser:0 /data \ | ||
| && chmod -R g+w /data | ||
|
|
||
| # Copy uv for runtime | ||
| COPY --from=ghcr.io/astral-sh/uv:0.5.14 /uv /usr/local/bin/uv | ||
|
|
||
| # Switch to non-root user for CLI installs | ||
| USER appuser | ||
|
|
||
| # Install Claude Code CLI (installs to ~/.local/bin) | ||
| RUN /bin/bash -o pipefail -c "curl -fsSL https://claude.ai/install.sh | bash" | ||
|
|
||
| # Install Cursor Agent CLI (installs to ~/.local/bin) | ||
| RUN /bin/bash -o pipefail -c "curl -fsSL https://cursor.com/install | bash" | ||
|
|
||
| # Configure npm for non-root global installs and install Gemini CLI | ||
| RUN mkdir -p /home/appuser/.npm-global \ | ||
| && npm config set prefix '/home/appuser/.npm-global' \ | ||
| && npm install -g @google/gemini-cli | ||
|
|
||
| # Switch to root for file copies and permission fixes | ||
| USER root | ||
|
|
||
| # Copy the virtual environment from builder | ||
| COPY --chown=appuser:0 --from=builder /app/.venv /app/.venv | ||
|
|
||
| # Copy project files needed by uv | ||
| COPY --chown=appuser:0 --from=builder /app/pyproject.toml /app/uv.lock ./ | ||
|
|
||
| # Copy source code | ||
| COPY --chown=appuser:0 --from=builder /app/src /app/src | ||
|
|
||
| # Make /app group-writable for OpenShift compatibility | ||
| RUN chmod -R g+w /app | ||
|
|
||
| # Make appuser home accessible by OpenShift arbitrary UID | ||
| # Only chmod directories (not files) — files are already group-readable by default. | ||
| # Directories need group write+execute for OpenShift's arbitrary UID (in GID 0) | ||
| # to create config/cache files at runtime. | ||
| RUN find /home/appuser -type d -exec chmod g=u {} + \ | ||
| && npm cache clean --force 2>/dev/null; \ | ||
| rm -rf /home/appuser/.npm/_cacache | ||
|
|
||
| # Switch back to non-root user for runtime | ||
| USER appuser | ||
|
|
||
| # Ensure CLIs are in PATH | ||
| ENV PATH="/home/appuser/.local/bin:/home/appuser/.npm-global/bin:${PATH}" | ||
| # Set HOME for OpenShift compatibility (random UID has no passwd entry) | ||
| ENV HOME="/home/appuser" | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| HEALTHCHECK --interval=30s --timeout=10s --retries=3 \ | ||
| CMD curl -f http://localhost:8000/health || exit 1 | ||
|
|
||
| # Use uv run for uvicorn | ||
| # --no-sync prevents uv from attempting to modify the venv at runtime. | ||
| # This is required for OpenShift where containers run as an arbitrary UID | ||
| # and may not have write access to the .venv directory. | ||
| ENTRYPOINT ["uv", "run", "--no-sync", "uvicorn", "docsfy.main:app", "--host", "0.0.0.0", "--port", "8000"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # docsfy | ||
|
|
||
| AI-powered documentation generator that creates polished static HTML docs from GitHub repositories using Claude, Gemini, or Cursor CLI. | ||
|
|
||
| [**Documentation**](https://myk-org.github.io/docsfy/) | [**GitHub**](https://github.com/myk-org/docsfy) | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```bash | ||
| # Clone and configure | ||
| git clone https://github.com/myk-org/docsfy.git | ||
| cd docsfy | ||
| cp .env.example .env | ||
| # Edit .env with your AI provider credentials | ||
|
|
||
| # Run | ||
| docker compose up | ||
|
|
||
| # Generate docs for any repo | ||
| curl -X POST http://localhost:8000/api/generate \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"repo_url": "https://github.com/org/repo"}' | ||
|
|
||
| # Browse docs | ||
| open http://localhost:8000/docs/repo/ | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| Apache-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| services: | ||
| docsfy: | ||
| build: . | ||
| ports: | ||
| - "8000:8000" | ||
| env_file: .env | ||
| volumes: | ||
| - ./data:/data | ||
| healthcheck: | ||
| test: ["CMD", "curl", "-f", "http://localhost:8000/health"] | ||
| interval: 30s | ||
| timeout: 10s | ||
| retries: 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.