PHPackages                             blurrywindows/yii2-auto-command - 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. [Database &amp; ORM](/categories/database)
4. /
5. blurrywindows/yii2-auto-command

AbandonedArchivedYii2-extension[Database &amp; ORM](/categories/database)

blurrywindows/yii2-auto-command
===============================

Yii 2 command that generates models for a database and apidoc documentation based on code comments.

15PHP

Since Jun 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/blurrywindows/yii2-auto-command)[ Packagist](https://packagist.org/packages/blurrywindows/yii2-auto-command)[ RSS](/packages/blurrywindows-yii2-auto-command/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (1)Used By (0)

Yii 2 Auto Command
==================

[](#yii-2-auto-command)

[![GitHub tag](https://camo.githubusercontent.com/9c05437e433c57dca5227a842765835be38c611d68817564f66b940841a83f85/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f626c7572727977696e646f77732f796969322d6175746f2d636f6d6d616e642e737667)](https://github.com/xytiq/yii2-auto-command)[![Packagist](https://camo.githubusercontent.com/7025d66e384070e9dd0c0ca7f7e75885dda42345aad7a204069d40e5a958fc33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c7572727977696e646f77732f796969322d6175746f2d636f6d6d616e642e737667)](https://packagist.org/packages/blurrywindows/yii2-auto-command)[![Packagist](https://camo.githubusercontent.com/fc8536642f5e0e7c20a249f14ce0c29a976506da2c09ec403846504dadbc67a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626c7572727977696e646f77732f796969322d6175746f2d636f6d6d616e642e737667)](https://packagist.org/packages/blurrywindows/yii2-auto-command)[![GitHub issues](https://camo.githubusercontent.com/3e989ff851f720e54888af6de81f359dc3d9eef3e7f9febb2f8d0bff1c9f0f8f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f626c7572727977696e646f77732f796969322d6175746f2d636f6d6d616e642e737667)](https://github.com/xytiq/yii2-auto-command/issues)

This is a Yii 2 extension (command) that may be used to automatically generate model classes and apidoc documentation. The actions in this command should normally not run on a production server. The actions mentioned here generate files and data that may be used in development or testing. When executing these actions in a production environment, the controller will generate a warning prompt that you may override.

TABLE OF CONTENTS
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Console commands](#console-commands)
- [How to contribute?](#how-to-contribute)
- [Issues](#issues)
- [Read more](#read-more)

FEATURES
--------

[](#features)

- Generates model classes based on the given database connection.
- Generates model classes that extend a (custom) base class.
- Generates apidoc documentation based on apidoc comment blocks in a custom folder.

REQUIREMENTS
------------

[](#requirements)

- PHP &gt;= 5.6.0
- Composer &gt;= 1.1.2 ()
- Node.js &gt;= 8.1.0 ()
- apidoc &gt;= 0.17.6 (`npm install -g apidoc`)

INSTALLATION
------------

[](#installation)

`composer require blurrywindows/yii2-auto-command`

CONFIGURATION
-------------

[](#configuration)

Add the following lines to your `console.php` configuration:

```
'controllerMap' => [
        'auto' => [
            'class' => 'blurrywindows\AutoCommand\AutoCommand',
            'baseClass' => 'app\models\BaseActiveRecord', // or 'yii\db\ActiveRecord' if you want to use the Yii 2 ActiveRecord as base
            'modelsFolder' => 'models', //Relative to app directory
            'modelsNamespace' => 'app\models',
            'apidocInputFolder' => 'controllers', //Relative to app directory
            'apidocOutputFolder' => 'web/apidoc', //Relative to app directory
            'skipTables' => ['migration'],
        ],
    ],
```

CONSOLE COMMANDS
----------------

[](#console-commands)

### ./yii auto/all

[](#yii-autoall)

Executes all the actions in the AutoController.

### ./yii auto/gii-models

[](#yii-autogii-models)

Generates ActiveRecords for all the tables in your database in your chosen output folder. It automatically overwrites the ActiveRecords if they exist. The ActiveRecords are named `Base[Tablename]` and extend your chosen baseClass. It also creates a class `[Tablename]` which extends `Base[Tablename]` for custom code, extra validation rules, etc. The `[Tablename]` class will not be overridden when executing the action again.

### ./yii auto/apidoc

[](#yii-autoapidoc)

Generates API documentation based on [apidoc](http://apidocjs.com/) from the comments in your chosen input folder. It outputs the documentation in your chosen output folder. You may include this folder in Git if you want to export the documentation to a production server. Please note, apidoc is a dev-dependency in Node.js. It will only be installed when using the `npm install` command.

HOW TO CONTRIBUTE
-----------------

[](#how-to-contribute)

You may contribute in any way you want, but please contact me beforehand to prevent merge-conflicts by [creating an issue](https://github.com/blurrywindows/yii2-auto-command/issues).

ISSUES
------

[](#issues)

If you have any questions or experience any issues with this command, please [submit an issue](https://github.com/blurrywindows/yii2-auto-command/issues).

READ MORE
---------

[](#read-more)

-
-

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f436dbe6c54e7029bd7ba6584fab0d01a05cc118a538d816e2493262c12a695?d=identicon)[bart\_sysf](/maintainers/bart_sysf)

---

Top Contributors

[![bart-sysf](https://avatars.githubusercontent.com/u/16703428?v=4)](https://github.com/bart-sysf "bart-sysf (1 commits)")

### Embed Badge

![Health badge](/badges/blurrywindows-yii2-auto-command/health.svg)

```
[![Health](https://phpackages.com/badges/blurrywindows-yii2-auto-command/health.svg)](https://phpackages.com/packages/blurrywindows-yii2-auto-command)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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