PHPackages                             php-stubs/wp-cli-stubs - 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. php-stubs/wp-cli-stubs

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

php-stubs/wp-cli-stubs
======================

WP-CLI function and class declaration stubs for static analysis.

v2.12.0(11mo ago)302.3M—7.9%3[3 issues](https://github.com/php-stubs/wp-cli-stubs/issues)20MITPHP

Since Aug 4Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/php-stubs/wp-cli-stubs)[ Packagist](https://packagist.org/packages/php-stubs/wp-cli-stubs)[ Docs](https://github.com/php-stubs/wp-cli-stubs)[ RSS](/packages/php-stubs-wp-cli-stubs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (13)Used By (20)

WP-CLI Stubs
============

[](#wp-cli-stubs)

[![Build Status](https://camo.githubusercontent.com/a0e968a4680b3ab162be2e61806856cb28fdc7e1182c09cdffe33255053f2078/68747470733a2f2f6170702e7472617669732d63692e636f6d2f7068702d73747562732f77702d636c692d73747562732e7376673f6272616e63683d6d6173746572)](https://app.travis-ci.com/php-stubs/wp-cli-stubs)

This package provides stub declarations for [WP-CLI](https://wp-cli.org/) functions, classes and interfaces. These stubs can help plugin and theme developers leverage static analysis tools like [PHPStan](https://github.com/phpstan/phpstan), which are unable to parse WP-CLI as it is not clean OOP code.

Stubs are generated directly from the [source](https://wp-cli.org/) using [giacocorsiglia/stubs-generator](https://github.com/GiacoCorsiglia/php-stubs-generator).

### Requirements

[](#requirements)

- PHP &gt;=7.1

### Installation

[](#installation)

Require this package as a development dependency with [Composer](https://getcomposer.org).

```
composer require --dev php-stubs/wp-cli-stubs
```

Alternatively you may download `wp-cli-stubs.php` directly.

### Usage in PHPStan

[](#usage-in-phpstan)

Include all stubs in PHPStan configuration file.

```
parameters:
    scanFiles:
        - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php
        - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-stubs.php
        - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-commands-stubs.php
        - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-i18n-stubs.php
        - %rootDir%/../../php-stubs/wp-cli-stubs/wp-cli-tools-stubs.php
```

###  Health Score

51

—

FairBetter than 96% of packages

Maintenance49

Moderate activity, may be stable

Popularity52

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~161 days

Recently: every ~184 days

Total

12

Last Release

342d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/135d8104cdf926e2b15b6a06413153a9582729f0cd48ccba7bc7e62878a39781?d=identicon)[szepeviktor](/maintainers/szepeviktor)

---

Top Contributors

[![Mte90](https://avatars.githubusercontent.com/u/403283?v=4)](https://github.com/Mte90 "Mte90 (24 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (24 commits)")[![lipemat](https://avatars.githubusercontent.com/u/1688181?v=4)](https://github.com/lipemat "lipemat (3 commits)")

---

Tags

PHPStanwordpressstatic analysiswp-cli

### Embed Badge

![Health badge](/badges/php-stubs-wp-cli-stubs/health.svg)

```
[![Health](https://phpackages.com/badges/php-stubs-wp-cli-stubs/health.svg)](https://phpackages.com/packages/php-stubs-wp-cli-stubs)
```

###  Alternatives

[php-stubs/woocommerce-stubs

WooCommerce function and class declaration stubs for static analysis.

942.9M66](/packages/php-stubs-woocommerce-stubs)[php-stubs/wordpress-stubs

WordPress function and class declaration stubs for static analysis.

19513.0M263](/packages/php-stubs-wordpress-stubs)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3287.8M898](/packages/szepeviktor-phpstan-wordpress)[woocommerce/woocommerce-sniffs

WooCommerce sniffs

496.8M42](/packages/woocommerce-woocommerce-sniffs)[php-stubs/wordpress-globals

Global variables and global constants from WordPress core.

13799.0k17](/packages/php-stubs-wordpress-globals)[php-stubs/acf-pro-stubs

Advanced Custom Fields PRO stubs for static analysis.

73692.8k50](/packages/php-stubs-acf-pro-stubs)

PHPackages © 2026

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