Automated Static-Analysis-First Codebase Documentation & API Spec Synthesizer in Pure PHP 8.2+.
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.
- 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.
- 📚 Comprehensive Markdown (
- 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.
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)"]
Clone the repository or install directly into your environment:
git clone https://github.com/eidcloud/eidcloud-doc-gen.git
cd eidcloud-doc-genBecause eidcloud-doc-gen is zero-dependency, you do not need composer install. Simply execute bin/eidcloud-doc with PHP 8.2 or higher.
The CLI binary is located at bin/eidcloud-doc.
Scans source files, synthesizes missing docs, and emits Markdown, HTML, Wiki, OpenAPI, and Coverage files:
php bin/eidcloud-doc generate ./src/ --out=./docs/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 --jsonExtracts 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"Display all available commands and flags:
php bin/eidcloud-doc --helpRun the zero-dependency test suite:
php tests/run_tests.phpAll 48 unit and integration tests run deterministically without external test harnesses.
Try eidcloud-doc-gen directly in your browser without local installation:
Eng. MHD. Shadi AL-Hasan
Email: mhd.shadi.alhasan@gmail.com
Organization: EidCloud
This project is open-source software licensed under the MIT License. Copyright (c) 2026 MHD. Shadi AL-Hasan.
Eng. MHD. Shadi AL-Hasan
- Role: Executive CTO & Enterprise Solutions Architect
- Email: mhd.shadi.alhasan@gmail.com
- Phone / WhatsApp: +963934005922
- Location: Damascus, Syria
- GitHub: shadialhasan
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2026 MHD. Shadi AL-Hasan. All rights reserved.