PHPackages                             krifollk/module-code-generator - 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. krifollk/module-code-generator

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

krifollk/module-code-generator
==============================

Code generator for magento 2

v0.4.0(8y ago)256.4k6MITPHPPHP ~7.0

Since Jul 15Pushed 8y ago5 watchersCompare

[ Source](https://github.com/Krifollk/magento2-code-generator)[ Packagist](https://packagist.org/packages/krifollk/module-code-generator)[ RSS](/packages/krifollk-module-code-generator/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Magento2 Code Generator
-----------------------

[](#magento2-code-generator)

This module provide possibility to generate code via command line tool.

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

[](#requirements)

- Magento 2 (CE, EE) 2.1.0 and later
- PHP &gt;=7.0

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

[](#installation)

Install the latest version with

```
$ composer require krifollk/module-code-generator
```

Usage
-----

[](#usage)

Currently, module supports the next commands:

Generating module skeleton.

- 1-st param is module name.
- 2-nd module version (not required, by default 0.1.0).

```
$ php bin/magento generate:module Config_Editor 0.2.0

Output:
File /var/www/magento2/app/code/Config/Editor/registration.php was generated.
File /var/www/magento2/app/code/Config/Editor/etc/module.xml was generated.
File /var/www/magento2/app/code/Config/Editor/composer.json was generated.
File /var/www/magento2/app/code/Config/Editor/Setup/InstallData.php was generated.
File /var/www/magento2/app/code/Config/Editor/Setup/InstallSchema.php was generated.
File /var/www/magento2/app/code/Config/Editor/Setup/Uninstall.php was generated.
File /var/www/magento2/app/code/Config/Editor/Setup/UpgradeData.php was generated.
File /var/www/magento2/app/code/Config/Editor/Setup/UpgradeSchema.php was generated.
```

Generating 'Model Triad' by DB table.

- 1-st param is module name.
- 2-nd entity name.
- 3-th table name.

```
$ php bin/magento generate:model:triad Config_Editor Config core_config_data

Output:
File /var/www/magento2/app/code/Config/Editor/Api/Data/ConfigInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ResourceModel/Config.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/Config.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ResourceModel/Config/Collection.php was generated.
File /var/www/magento2/app/code/Config/Editor/Api/Data/ConfigSearchResultsInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Api/ConfigRepositoryInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ConfigRepository.php was generated.
File /var/www/magento2/app/code/Config/Editor/etc/di.xml was generated.
```

Generating 'Crud' by DB table.

- 1-st param is module name.
- 2-nd entity name.
- 3-th table name.

```
$ php bin/magento generate:crud Config_Editor Config core_config_data

Output:
File /var/www/magento2/app/code/Config/Editor/Api/Data/ConfigInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ResourceModel/Config.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/Config.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ResourceModel/Config/Collection.php was generated.
File /var/www/magento2/app/code/Config/Editor/Api/Data/ConfigSearchResultsInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Api/ConfigRepositoryInterface.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ConfigRepository.php was generated.
File /var/www/magento2/app/code/Config/Editor/etc/di.xml was generated.
File /var/www/magento2/app/code/Config/Editor/Model/UiComponent/Listing/Column/ConfigActions.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/Config/DataProvider.php was generated.
File /var/www/magento2/app/code/Config/Editor/Model/ResourceModel/Config/Grid/Collection.php was generated.
File /var/www/magento2/app/code/Config/Editor/view/adminhtml/ui_component/config_editor_config_form.xml was generated.
File /var/www/magento2/app/code/Config/Editor/view/adminhtml/ui_component/config_editor_config_listing.xml was generated.
File /var/www/magento2/app/code/Config/Editor/view/adminhtml/layout/config_editor_config_edit.xml was generated.
File /var/www/magento2/app/code/Config/Editor/view/adminhtml/layout/config_editor_config_index.xml was generated.
File /var/www/magento2/app/code/Config/Editor/view/adminhtml/layout/config_editor_config_new.xml was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/Index.php was generated.
File /var/www/magento2/app/code/Config/Editor/etc/adminhtml/routes.xml was generated.
File /var/www/magento2/app/code/Config/Editor/etc/di.xml was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/Edit.php was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/NewAction.php was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/Save.php was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/Delete.php was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/MassDelete.php was generated.
File /var/www/magento2/app/code/Config/Editor/Controller/Adminhtml/Config/InlineEdit.php was generated.
```

Generating 'Plugins' (Interactive mode)

- 1-st param is module name.

```
$ php bin/magento generate:plugin Config_Editor

Output:
Enter the name of the class for which you want to create plugin: \Magento\Cms\Controller\Index\Index
Enter the name of the plugin class (\Module\Name\ part not required) Default: \Config\Editor\Plugin\Magento\Cms\Controller\Index\Index:
+-----+-----------------+
| #id | Allowed methods |
+-----+-----------------+
| 0   | execute         |
| 1   | dispatch        |
| 2   | getActionFlag   |
| 3   | getRequest      |
| 4   | getResponse     |
+-----+-----------------+
Enter method ids and types of interception(a - after, b - before, ar - around)
for which you want to create plugin using next format: id:b-ar-a, id:a-b: 0:a-b-ar
+-------------+--------------------+
| Method Name | Interception types |
+-------------+--------------------+
| execute     | Before             |
|             | Around             |
|             | After              |
|             |                    |
+-------------+--------------------+
Is everything alright ? (y\n - yes by default)
File /var/www/magento2/app/code/Config/Editor/Plugin/Magento/Cms/Controller/Index/Index.php has been generated.
File /var/www/magento2/app/code/Config/Editor/etc/di.xml has been generated.
```

In additional, all commands supports --dir option where you can specify your custom module directory.

Ex: --dir=modules/module-some-dir

Submitting bugs and feature requests
------------------------------------

[](#submitting-bugs-and-feature-requests)

Bugs and feature request are tracked on [GitHub](https://github.com/Krifollk/magento-code-generator/issues)

Author
------

[](#author)

Rostyslav Tymoshenko

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3273d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/933de51ff0775ac2d99be42e4cc53f12f38eb31ff09dcd5996126bc5df80388d?d=identicon)[Krifollk](/maintainers/Krifollk)

---

Tags

code-generationcode-generatordeveloper-toolsmagento2-module

### Embed Badge

![Health badge](/badges/krifollk-module-code-generator/health.svg)

```
[![Health](https://phpackages.com/badges/krifollk-module-code-generator/health.svg)](https://phpackages.com/packages/krifollk-module-code-generator)
```

###  Alternatives

[bezhansalleh/filament-addons

A Set of Filament Component Addons with different designs and extra functionalities

5614.4k](/packages/bezhansalleh-filament-addons)[micc83/acf-fonticonpicker

ACF-FontIconPicker is a Fonts Icons Picker field type for the Advanced Custom Fields WordPress plugin.

469.8k](/packages/micc83-acf-fonticonpicker)[laravel-ready/license-server

License server for Laravel

1291.2k](/packages/laravel-ready-license-server)

PHPackages © 2026

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