PHPackages                             molbal/ai-phpdoc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. molbal/ai-phpdoc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

molbal/ai-phpdoc
================

Writes missing PHPDoc comments using GPT-3.

1.0.8(1y ago)194.4k↓92.9%4[1 PRs](https://github.com/molbal/ai-phpdoc/pulls)AGPL-3.0-or-laterPHPPHP ^8.1CI passing

Since Jan 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/molbal/ai-phpdoc)[ Packagist](https://packagist.org/packages/molbal/ai-phpdoc)[ RSS](/packages/molbal-ai-phpdoc/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (2)Versions (12)Used By (0)

 [![Code example](https://raw.githubusercontent.com/molbal/ai-phpdoc/main/art/code-example.png)](https://raw.githubusercontent.com/molbal/ai-phpdoc/main/art/code-example.png)

 [![Total Downloads](https://camo.githubusercontent.com/9dcc86a18e47a48062e5d9cec187cd8afc0ff3cba253221e667327353efabe3e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6c62616c2f61692d706870646f63)](https://packagist.org/packages/molbal/ai-phpdoc) [![Latest Version](https://camo.githubusercontent.com/b5f12e9d9bc2c6049a0666a51ca93ec9301ee41bc48fa9aa5150dc7d5523a8cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6c62616c2f61692d706870646f63)](https://packagist.org/packages/molbal/ai-phpdoc) [![License](https://camo.githubusercontent.com/b7b31dfba70cd48ad6485f04b6646788ca58599c9ec1d51971f7922496d48412/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6f6c62616c2f61692d706870646f63)](https://packagist.org/packages/molbal/ai-phpdoc)

---

[![Cute icon. You like it!](https://raw.githubusercontent.com/molbal/ai-phpdoc/main/art/icon.png)](https://raw.githubusercontent.com/molbal/ai-phpdoc/main/art/icon.png) AI PHPDocs
===================================================================================================================================================================================

[](#-ai-phpdocs)

AI PHPDocs is a tool that uses GPT-3 to automatically add missing PHPDoc comments to your PHP code.

Demo video:

Example output:

Prerequisites
-------------

[](#prerequisites)

This package uses the OpenAI API. Before using AI PHPDocs, you will need to have an OpenAI API key set as an environment variable.

```
export OPENAI_KEY=...
```

You can get an API key at

Installation
------------

[](#installation)

To install AI PHPDocs, run the following command:

```
composer global require molbal/ai-phpdoc
```

Usage
-----

[](#usage)

To add missing PHPDoc comments to a single file, use the following command:

```
aiphpdocs file  /path/to/file.php
```

To add missing PHPDoc comments to a directory of files, use the following command. By default it iterates through the current directory for all files, but does not go into subdirectories:

```
aiphpdocs dir
```

You may set the `--recursive` flag, or `-r` for short for it to go into subdirectories.

If you pass another variable (regardless of the recursive flag) it will treat it as another directory to sweep through instead of the working directory.

```
aiphpdocs dir -r /somewhere/else
```

License
-------

[](#license)

AI PHPDocs is licensed under the AGPL-3.0 license. See LICENSE for more information.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance63

Regular maintenance activity

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 73.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~143 days

Total

9

Last Release

699d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53e6ad68a246310b4962fb2d17d75debebfb895cf9c3428e8c27afa099fa9882?d=identicon)[molbal](/maintainers/molbal)

---

Top Contributors

[![molbal](https://avatars.githubusercontent.com/u/5754480?v=4)](https://github.com/molbal "molbal (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 commits)")[![npotier](https://avatars.githubusercontent.com/u/1151094?v=4)](https://github.com/npotier "npotier (2 commits)")[![ashfame](https://avatars.githubusercontent.com/u/858906?v=4)](https://github.com/ashfame "ashfame (1 commits)")[![dade1987](https://avatars.githubusercontent.com/u/19210174?v=4)](https://github.com/dade1987 "dade1987 (1 commits)")

### Embed Badge

![Health badge](/badges/molbal-ai-phpdoc/health.svg)

```
[![Health](https://phpackages.com/badges/molbal-ai-phpdoc/health.svg)](https://phpackages.com/packages/molbal-ai-phpdoc)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[phel-lang/phel-lang

Phel is a functional programming language that compiles to PHP

5186.0k18](/packages/phel-lang-phel-lang)[eliashaeussler/typo3-solver

Solver - Extends TYPO3's exception handling with AI generated solutions. Problems can also be solved from command line. Several OpenAI parameters are configurable and prompts and solution providers can be customized as desired.

302.1k](/packages/eliashaeussler-typo3-solver)[dagger/dagger

Dagger PHP SDK

261.1k](/packages/dagger-dagger)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
