PHPackages                             dmstr/yii2-gii-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. [CLI &amp; Console](/categories/cli)
4. /
5. dmstr/yii2-gii-command

AbandonedArchivedYii2-extension[CLI &amp; Console](/categories/cli)

dmstr/yii2-gii-command
======================

Running Yii2 Framework Code Generator Gii from command line

52.9k2PHP

Since Oct 1Pushed 11y ago4 watchersCompare

[ Source](https://github.com/dmstr/yii2-gii-command)[ Packagist](https://packagist.org/packages/dmstr/yii2-gii-command)[ RSS](/packages/dmstr-yii2-gii-command/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Giic2
=====

[](#giic2)

---

**NOTE! THIS EXTENSION IS OUTDATED AND WILL NOT BE MAINTAINED, FUNCTIONALITY IS AVAILABLE IN YII2-CORE SINCE 2.0.0-RC**
-----------------------------------------------------------------------------------------------------------------------

[](#note-this-extension-is-outdated--and-will-not-be-maintained-functionality-is-available-in-yii2-core-since-200-rc)

Running Yii2 Framework Gii Code Generators from command line

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist dmstr/yii2-gii-command "*"

```

Setup
-----

[](#setup)

**Make sure the Gii module is available in your console configuration.**

```
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = 'yii\gii\Module';

```

The extension will register a `giic` command alias in the application bootstrap process, if Gii is available.

Usage
-----

[](#usage)

Show available generators:

```
./yii help giic

```

**Note: giic is NOT generating and overwriting code files unless you use the option `--generate=1`**

### Create a controller

[](#create-a-controller)

```
./yii giic/controller --template=default --controller=my-first-giic-controller

```

### Create a model

[](#create-a-model)

```
./yii giic/model --template=default --tableName=foo --modelClass=Foo

```

### Run a giiant batch

[](#run-a-giiant-batch)

```
./yii giiant-batch \
  --tables=actor,address,category,city,country,customer,film,film_actor,film_category,film_text,inventory,language,payment,rental,staff,store \
  --modelNamespace=app\\models \
  --crudControllerNamespace=app\\controllers\\crud --crudViewPath=@app/views/crud

```

The above command will create models and CRUDs with relations for all given table names using the [giiant](https://github.com/schmunk42/yii2-giiant) generators.

Known Limitations
-----------------

[](#known-limitations)

### Compatibility with Help command

[](#compatibility-with-help-command)

```
./yii help giic/model

```

Will not show all available options, a workaround is to look at the generator attributes or run the command without any parameters and review the *Attribute Errors*.

```
$ ./yii giic/model
Loading generator 'model'...

Attribute Errors
----------------
template: A code template must be selected.
tableName: Table Name cannot be blank.
modelClass: Model Class cannot be blank if table name does not end with asterisk.

```

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/dmstr/yii2-gii-command)
- [GitHub](https://github.com/dmstr/yii2-gii-command)
- [diemeisterei GmbH](http://diemeisterei.de)

### Related Extensions

[](#related-extensions)

- [giiant](https://github.com/schmunk42/yii2-giiant)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b4ab2b6685ec71887908ec8cff261a16cd5bb24c69bb8ab52840e220f175f9d?d=identicon)[schmunk](/maintainers/schmunk)

---

Top Contributors

[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (11 commits)")

### Embed Badge

![Health badge](/badges/dmstr-yii2-gii-command/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M18](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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