PHPackages                             zero-to-prod/docblock-annotator-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. zero-to-prod/docblock-annotator-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

zero-to-prod/docblock-annotator-cli
===================================

A cli for annotating Docblocks.

v4.1.0(1y ago)01301MITPHPPHP &gt;=8.1CI passing

Since Feb 16Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/docblock-annotator-cli)[ Packagist](https://packagist.org/packages/zero-to-prod/docblock-annotator-cli)[ Docs](https://github.com/zero-to-prod/docblock-annotator-cli)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-docblock-annotator-cli/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (5)Versions (18)Used By (1)

Zerotoprod\\DocblockAnnotatorCli
================================

[](#zerotoproddocblockannotatorcli)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/docblock-annotator-cli)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/ad649fb5c2ac824492112b3c2ef5a8a3b6e11c7d72b9979787f10f580e5c90df/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c692f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/docblock-annotator-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/10f518eddaaf5b76261586ab8992e9761451c8e2f1c77ea1ad0421a0d07afdb1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c692f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/docblock-annotator-cli/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/378d5334aa28468a321da5f2757de2ad1c54a48a84fd21e5e39cfee9d518fe23/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c692f6275696c645f646f636b65725f696d6167652e796d6c3f6c6162656c3d6275696c645f646f636b65725f696d616765)](https://github.com/zero-to-prod/docblock-annotator-cli/actions)[![Packagist Downloads](https://camo.githubusercontent.com/6f32e4cfae0f9717e740862b5287cd0a3760c112532a7833e8cc7f96fbfb4397/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c693f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/docblock-annotator-cli/stats)[![php](https://camo.githubusercontent.com/895777071c8c17e882879fc11975e2ba76712abfdd486d7abd3ef3bf56846e47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c692e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/docblock-annotator-cli/stats)[![Packagist Version](https://camo.githubusercontent.com/a3a6e83b03076fdf8ac8e3189d2f282089987e8a9b5ea0645cc20afe2d47894e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c693f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/docblock-annotator-cli)[![License](https://camo.githubusercontent.com/aad4719c079ce96e3fa377df8e1d5e4426f998f6018d1c5f4565b0db984393ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c693f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/docblock-annotator-cli/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/c1dd5f6c0a30f1fb9435c199993c142da7c9acc919e7c7e442759b771ad4aff9/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c692e737667)](https://wakatime.com/badge/github/zero-to-prod/docblock-annotator-cli)[![Hits-of-Code](https://camo.githubusercontent.com/41397695d7cdc6d57f96d91a6cc69c5585b50e5894faef961445120af690034d/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f646f63626c6f636b2d616e6e6f7461746f722d636c693f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/docblock-annotator-cli/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
    - [Available Commands](#available-commands)
        - [`docblock-annotator-cli:src`](#docblock-annotator-clisrc)
        - [`docblock-annotator-cli:update-file`](#docblock-annotator-clipdate-file)
        - [`docblock-annotator-cli:update-directory`](#docblock-annotator-clipdate-directory)
- [Docker Image](#docker-image)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Image Development](./IMAGE_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A cli for annotating Docblocks.

Requirements
------------

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

Install `Zerotoprod\DocblockAnnotatorCli` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/docblock-annotator-cli
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/docblock-annotator-cli)
vendor/bin/zero-to-prod-docblock-annotator-cli

# Publish to custom directory
vendor/bin/zero-to-prod-docblock-annotator-cli /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-docblock-annotator-cli"
        ],
        "post-update-cmd": [
            "zero-to-prod-docblock-annotator-cli"
        ]
    }
}
```

Usage
-----

[](#usage)

Run this command to see the available commands:

```
vendor/bin/docblock-annotator-cli list
```

### Available Commands

[](#available-commands)

#### `docblock-annotator-cli:src`

[](#docblock-annotator-clisrc)

Displays the project's GitHub repository URL.

**Usage:**

```
vendor/bin/docblock-annotator-cli docblock-annotator-cli:src
```

**Example:**

```
$ vendor/bin/docblock-annotator-cli docblock-annotator-cli:src
https://github.com/zero-to-prod/docblock-annotator-cli
```

#### `docblock-annotator-cli:update-file`

[](#docblock-annotator-cliupdate-file)

Adds lines to a PHP docblock in a specific file.

**Usage:**

```
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-file [options]  [...]
```

**Arguments:**

- `file` (required) - The PHP file to update
- `comments` (optional) - The comments to add to the docblock

**Options:**

- `--modifiers` - The modifier of the member: public, private, protected (default: public)
- `--statements` - The statements to annotate: class\_method, const, class, class\_const, enum\_case, enum, function, trait, property, interface (default: all)

**Examples:**

```
# Add comments to all public methods in a file
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-file src/MyClass.php "Added by CLI" "Updated on $(date)"

# Update only private methods with custom comments
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-file --modifiers=private src/MyClass.php "Private method updated"

# Update only class methods and properties
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-file --statements=class_method --statements=property src/MyClass.php "Method and property updated"
```

#### `docblock-annotator-cli:update-directory`

[](#docblock-annotator-cliupdate-directory)

Adds lines to PHP docblocks in all files within a directory.

**Usage:**

```
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-directory [options]  [...]
```

**Alias:** `docblock-annotator-cli:update`

**Arguments:**

- `directory` (required) - The directory to update PHP files in
- `comments` (optional) - The comments to add to the docblock

**Options:**

- `--modifiers` - The modifier of the member: public, private, protected (default: public)
- `--statements` - The statements to annotate: class\_method, const, class, class\_const, enum\_case, enum, function, trait, property, interface (default: all)
- `--recursive` / `--no-recursive` - Recursively search for files (default: recursive)

**Examples:**

```
# Update all PHP files in src directory with comments
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-directory src/ "Bulk updated" "$(date)"

# Update only public methods in src directory (non-recursive)
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-directory --no-recursive --statements=class_method src/ "Public methods updated"

# Use the shorter alias command
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update src/ "Updated via alias"

# Update all statement types with specific modifiers
vendor/bin/docblock-annotator-cli docblock-annotator-cli:update-directory --modifiers=public --modifiers=protected src/ "Updated public and protected members"
```

Docker Image
------------

[](#docker-image)

You can also run the cli using the [docker image](https://hub.docker.com/repository/docker/davidsmith3/docblock-annotator-cli/general):

```
docker run --rm davidsmith3/docblock-annotator-cli
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/docblock-annotator-cli/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance45

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

17

Last Release

549d ago

Major Versions

v0.1.1 → v1.0.02025-02-16

v1.1.0 → v2.0.02025-02-16

v2.1.6 → v4.0.02025-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (10 commits)")

---

Tags

zero-to-proddocblock-annotator-cli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-docblock-annotator-cli/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-docblock-annotator-cli/health.svg)](https://phpackages.com/packages/zero-to-prod-docblock-annotator-cli)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.6M7.4k](/packages/illuminate-console)

PHPackages © 2026

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