Skip to content

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

🇸🇦 العربية | 🇬🇧 English

📖 eidcloud-doc-gen

Automated Static-Analysis-First Codebase Documentation & API Spec Synthesizer in Pure PHP 8.2+.

Release PHP License Open in Colab CI


🌟 Overview

eidcloud-doc-gen is a zero-dependency static analysis and documentation synthesis engine. It inspects PHP 8.2+ class declarations, attributes, PHP type signatures, and docblock annotations to synthesize production-grade developer documentation, comprehensive Markdown references, GitHub Wiki pages, OpenAPI 3.1.0 specifications, and responsive HTML docs with instant client-side search.

Key Capabilities

  • Zero-Hallucination Static Analyzer: Strictly inspects real AST tokens, PHP 8 native type signatures, promoted properties, attributes, and doc comments without executing code.
  • AI-Style Docstring & Architectural Synthesizer: Automatically fills missing summaries, descriptions, and parameter context while maintaining strict fidelity to parameter and return types.
  • Multi-Format Output Generator:
    • 📚 Comprehensive Markdown (API.md) for repositories and wikis.
    • 🌐 Interactive Single-File Static HTML (index.html) with instant client-side full-text search.
    • 📑 GitHub Wiki Pages (wiki/*.md) pre-formatted with internal wiki links and sidebar navigation.
    • 🔌 OpenAPI 3.1.0 Specification (openapi.json) synthesizing route endpoints, query params, schemas, and payloads.
  • Documentation Coverage Metric (coverage): Evaluates percentage coverage of classes, public methods, and properties, identifying undocumented public APIs to maintain codebase hygiene.
  • Zero External Vendor Dependencies: Runs directly on pure PHP 8.2+ without Composer vendor/ bloat.

🏗️ Architecture Workflow

flowchart TD
    A["PHP 8.2+ Codebase"] --> B["ReflectionParser & AST Tokenizer"]
    B --> C["DocBlockParser & Route Extractor"]
    C --> D["DocSynthesizer (Zero-Hallucination Explainer)"]
    D --> E["Core Engine: DocGenerator"]
    E --> F["CoverageCalculator (Coverage Score & Gaps)"]
    E --> G["MarkdownRenderer (API.md & GitHub Wiki)"]
    E --> H["HtmlRenderer (Static Interactive UI + Search)"]
    E --> I["OpenApiSynthesizer (OpenAPI 3.1.0 Spec)"]
Loading

🚀 Quick Start

Installation

Clone the repository or install directly into your environment:

git clone https://github.com/eidcloud/eidcloud-doc-gen.git
cd eidcloud-doc-gen

Because eidcloud-doc-gen is zero-dependency, you do not need composer install. Simply execute bin/eidcloud-doc with PHP 8.2 or higher.


💻 CLI Usage

The CLI binary is located at bin/eidcloud-doc.

1. Generate Complete Documentation Suite

Scans source files, synthesizes missing docs, and emits Markdown, HTML, Wiki, OpenAPI, and Coverage files:

php bin/eidcloud-doc generate ./src/ --out=./docs/

2. Measure Documentation Coverage

Audits the codebase for missing documentation and enforces a quality gate (returns exit code 1 if below threshold):

# Enforce minimum 80% coverage
php bin/eidcloud-doc coverage ./src/ --min=80

# Machine-readable JSON output
php bin/eidcloud-doc coverage ./src/ --min=80 --json

3. Synthesize OpenAPI 3.1.0 Specification

Extracts controllers, route attributes, and docblock annotations into a valid OpenAPI 3.1 JSON document:

php bin/eidcloud-doc openapi ./src/ --out=openapi.json --title="My Service API"

4. Help & Options

Display all available commands and flags:

php bin/eidcloud-doc --help

🧪 Testing

Run the zero-dependency test suite:

php tests/run_tests.php

All 48 unit and integration tests run deterministically without external test harnesses.


📓 Interactive Google Colab

Try eidcloud-doc-gen directly in your browser without local installation:

Open in Colab


👨‍💻 Author & Maintainer

Eng. MHD. Shadi AL-Hasan
Email: mhd.shadi.alhasan@gmail.com
Organization: EidCloud


📄 License

This project is open-source software licensed under the MIT License. Copyright (c) 2026 MHD. Shadi AL-Hasan.


👤 Author & Maintainer

Eng. MHD. Shadi AL-Hasan


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 MHD. Shadi AL-Hasan. All rights reserved.

About

Static-analysis-first codebase documentation generator synthesizing Markdown, OpenAPI specs, and coverage metrics in pure PHP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages