PHPackages                             trunglv/mage2-dev - 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. trunglv/mage2-dev

ActiveMagento2-module

trunglv/mage2-dev
=================

A few tools to understand Magento2

1.0.0.x-dev(1y ago)5794↓100%1OSL-3.0PHPPHP &gt;=8.0

Since Jul 21Pushed 1y agoCompare

[ Source](https://github.com/trunglv/mage2_dev)[ Packagist](https://packagist.org/packages/trunglv/mage2-dev)[ RSS](/packages/trunglv-mage2-dev/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)DependenciesVersions (2)Used By (0)

mage2\_dev - A few CLI tools for Magento 2 Development and Deployment
=====================================================================

[](#mage2_dev---a-few-cli-tools-for-magento-2-development-and-deployment)

[![Packagist](https://camo.githubusercontent.com/4d784ba4a8afd11dd73d6bba48d4be5c22228df2ea45afa00f9b599110a3afbb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7472756e676c762f6d616765322d6465762e737667)](https://packagist.org/packages/trunglv/mage2_dev)

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

[](#installation)

##### 1. Clone and copy a source code into a folder app/code/Betagento

[](#1-clone-and-copy-a-source-code-into-a-folder-appcodebetagento)

##### 2. Install from Composer

[](#2-install-from-composer)

```
composer require trunglv/mage2-dev:dev-main [Recommend]

```

Debug tools
-----------

[](#debug-tools)

### -1. Dependency Injection checking

[](#-1-dependency-injection-checking)

\*\* !!! Need to run setup:di:compile first to load DI configs (for preferences) and create kinds of Interceptor and Factory classes. \*\*

```
php bin/magento beta_dev:check_di -t "Magento\Quote\Model\QuoteManagement"

```

```
----------------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
| checkoutSession            | Magento\Checkout\Model\Session                      | Check possible interfaces. A class that relies on another class should interact with it through an interface!  | Magento\Framework\Session\SessionManagerInterface                         |
|                            |                                                     | Magento\Framework\Session\SessionManagerInterface                                                              |  ---> Magento\Framework\Session\Generic\Interceptor                       |
|                            |                                                     | Magento\Framework\ObjectManager\ResetAfterRequestInterface                                                     | Magento\Framework\ObjectManager\ResetAfterRequestInterface                |
|                            |                                                     |                                                                                                                |  ---> Magento\Framework\ObjectManager\ResetAfterRequestInterface          |
+----------------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
+----------------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
| customerSession            | Magento\Customer\Model\Session                      | Check possible interfaces. A class that relies on another class should interact with it through an interface!  | Magento\Framework\Session\SessionManagerInterface                         |
|                            |                                                     | Magento\Framework\Session\SessionManagerInterface                                                              |  ---> Magento\Framework\Session\Generic\Interceptor                       |
|                            |                                                     | Magento\Framework\ObjectManager\ResetAfterRequestInterface                                                     | Magento\Framework\ObjectManager\ResetAfterRequestInterface                |
|                            |                                                     |                                                                                                                |  ---> Magento\Framework\ObjectManager\ResetAfterRequestInterface          |
+----------------------------+-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
```

### 0. List all plugins by their listener type \[before, around, after\]

[](#0-list-all-plugins-by-their-listener-type-before-around-after)

Example:

```
bin/magento beta_dev:show_plugins_by_listener_type -t around

```

```
------Plugins for Scope graphql------

+------------------------------------------------------------------+-----------------------------------------------------------------------+-----------------+--------------------------------------------------------------------------------------------------------------------+
| class                                                            | code                                                                  | original_method | instance                                                                                                           |
+------------------------------------------------------------------+-----------------------------------------------------------------------+-----------------+--------------------------------------------------------------------------------------------------------------------+
| Magento\Framework\GraphQl\Query\ResolverInterface                | cacheResolverResult                                                   | resolve         | Magento\GraphQlResolverCache\Model\Plugin\Resolver\Cache                                                           |
| Magento\Framework\Mail\Template\TransportBuilder                 | graphQlEmulateEmail                                                   | getTransport    | Magento\StoreGraphQl\Plugin\LocalizeEmail                                                                          |
| Magento\Framework\App\FrontControllerInterface                   | front-controller-builtin-cache                                        | dispatch        | Magento\PageCache\Model\App\FrontController\BuiltinPlugin                                                          |
| Magento\InventoryIndexer\Model\ResourceModel\GetStockItemData    | inventory_catalog_get_legacy_stock_item_data_from_stock_registry      | execute         | Magento\InventoryCatalog\Plugin\InventoryIndexer\Model\ResourceModel\GetLegacyStockStatusDataFromStockRegistry     |
| Magento\InventoryIndexer\Model\ResourceModel\GetStockItemsData   | inventory_catalog_get_bulk_legacy_stock_item_data_from_stock_registry | execute         | Magento\InventoryCatalog\Plugin\InventoryIndexer\Model\ResourceModel\GetBulkLegacyStockStatusDataFromStockRegistry |
| Magento\InventoryConfiguration\Model\GetLegacyStockItem          | inventory_catalog_get_legacy_stock_item_from_stock_registry           | execute         | \Magento\InventoryCatalog\Plugin\InventoryConfiguration\Model\GetLegacyStockItemFromStockRegistry                  |
| Magento\ConfigurableProduct\Model\Product\Type\Configurable      | used_products_cache_graphql                                           | getUsedProducts | Magento\ConfigurableProduct\Model\Plugin\Frontend\UsedProductsCache                                                |
| Magento\InventorySales\Model\AreProductsSalable                  | are_products_salable                                                  | execute         | Magento\InventoryIndexer\Plugin\InventorySales\AreProductsSalable                                                  |
| Magento\ReCaptchaValidationApi\Api\ValidatorInterface            | graphql_recaptcha_validation_override                                 | isValid         | Magento\ReCaptchaWebapiGraphQl\Plugin\ValidationOverrider                                                          |
| Magento\CatalogGraphQl\Model\Resolver\Layer\DataProvider\Filters | add_swatch_data_to_filters                                            | getData         | Magento\SwatchesGraphQl\Plugin\Filters\DataProviderPlugin                                                          |
+------------------------------------------------------------------+-----------------------------------------------------------------------+-----------------+--------------------------------------------------------------------------------------------------------------------+
```

### 1. List all plugins for a class

[](#1-list-all-plugins-for-a-class)

Example:

```
bin/magento beta_dev:show_plugins -t "Magento\InventorySales\Model\AreProductsSalableForRequestedQty"

```

Examples of results:

```
bin/magento beta_dev:show_plugins -t 'Magento\Quote\Api\CartManagementInterface'
 ------Plugins for Scope global------

Plugins for type Magento\Quote\Api\CartManagementInterface

+--------------------+-----------------+--------------------+--------------------------------------------------+---------------+
| code               | original_method | plugin_method_type | instance                                         | method_exists |
+--------------------+-----------------+--------------------+--------------------------------------------------+---------------+
| order_cancellation | placeOrder      | around             | PayPal\Braintree\Plugin\OrderCancellation        | method is ok  |
| order_update       | placeOrder      | before             | Magento\PaymentServicesPaypal\Plugin\OrderUpdate | method is ok  |
+--------------------+-----------------+--------------------+--------------------------------------------------+---------------+
Plugins for type Magento\Quote\Model\QuoteManagement

+----------------------------------+-----------------+--------------------+------------------------------------------------------------+---------------+
| code                             | original_method | plugin_method_type | instance                                                   | method_exists |
+----------------------------------+-----------------+--------------------+------------------------------------------------------------+---------------+
| update_bundle_quote_item_options | submit          | before             | Magento\Bundle\Plugin\Quote\UpdateBundleQuoteItemOptions   | method is ok  |
| validate_purchase_order_number   | submit          | before             | Magento\OfflinePayments\Plugin\ValidatePurchaseOrderNumber | method is ok  |
| coupon_uses_increment_plugin     | submit          | around             | Magento\SalesRule\Plugin\CouponUsagesIncrement             | method is ok  |
+----------------------------------+-----------------+--------------------+------------------------------------------------------------+---------------+

 ----- END Plugins for Scope ------global
-- No specific scoped plugins injected for Magento\Quote\Api\CartManagementInterfaces in frontend --
-- No specific scoped plugins injected for Magento\Quote\Api\CartManagementInterfaces in adminhtml --
-- No specific scoped plugins injected for Magento\Quote\Api\CartManagementInterfaces in webapi_rest --
-- No specific scoped plugins injected for Magento\Quote\Api\CartManagementInterfaces in graphql --
```

When you find plugins for an interface 'Magento\\Quote\\Api\\CartManagementInterface', it will show plugins that are injected into the interface itself and a preference concrete class 'Magento\\Quote\\Model\\QuoteManagement'.

### 2. List all observers for an event

[](#2-list-all-observers-for-an-event)

```
bin/magento beta_dev:show_observers -e catalog_product_get_final_price

```

```
Usage:
  beta_dev:show_observers [options]

Options:
  -e, --event=EVENT              Event code : --e catalog_product_get_final_price
  -s, --scope_code[=SCOPE_CODE]  Scope : -s global|frontend|adminhtml|crontab|webapi_rest|webapi_soap|graphql

```

[![image](https://user-images.githubusercontent.com/820411/140700694-3d79bcc3-cbbb-4ecf-8d04-f31f8c653b72.png)](https://user-images.githubusercontent.com/820411/140700694-3d79bcc3-cbbb-4ecf-8d04-f31f8c653b72.png)

### 3. Show all controller actions per a scope

[](#3-show-all-controller-actions-per-a-scope)

```
bin/magento beta_dev:show_controller_action  -f checkout -a frontend

```

```
Description:
  Show all controller actions per a scope

Usage:
  beta_dev:show_controller_action [options]

Options:
  -f, --frontname=FRONTNAME  Frontname : --m catalog
  -a, --area=AREA            Area Code: --a frontend|adminhtml

```

Example Result:

[![image](https://user-images.githubusercontent.com/820411/141668634-744cf4a5-4322-461d-9705-508ebae0bb8f.png)](https://user-images.githubusercontent.com/820411/141668634-744cf4a5-4322-461d-9705-508ebae0bb8f.png)

### 4. Reflection for Api Services

[](#4-reflection-for-api-services)

```
Description:
  Refection for API Services

Usage:
  beta_dev:api_reflection [options]

Options:
  -a, --api=API                    API ID : -a : /V1/carts/:cartId/shipping-information
  -m, --http_method[=HTTP_METHOD]  HTTP Method: -m POST

```

Example :

```
bin/magento beta_dev:api_reflection --api "/V1/carts/:cartId/shipping-information" -m POST

```

##### General information

[](#general-information)

[![image](https://user-images.githubusercontent.com/820411/142757603-e20ba6e8-f950-4a13-8bb4-c4646787b271.png)](https://user-images.githubusercontent.com/820411/142757603-e20ba6e8-f950-4a13-8bb4-c4646787b271.png)

##### Input Data Reflection

[](#input-data-reflection)

[![image](https://user-images.githubusercontent.com/820411/142757393-25dd2ae0-d06a-4319-8e7c-937aaaf6b3d1.png)](https://user-images.githubusercontent.com/820411/142757393-25dd2ae0-d06a-4319-8e7c-937aaaf6b3d1.png)

##### Output Data Reflection

[](#output-data-reflection)

[![image](https://user-images.githubusercontent.com/820411/142757398-e75dda1a-c441-4be0-b1d0-458a315e80f2.png)](https://user-images.githubusercontent.com/820411/142757398-e75dda1a-c441-4be0-b1d0-458a315e80f2.png)

Deploy static files ( Javascript, Css, Html, Js-translation, requirejs-config.js )
----------------------------------------------------------------------------------

[](#deploy-static-files--javascript-css-html-js-translation-requirejs-configjs-)

### Before running CLI commands below - Pls ensure you have deleted the folder var/view\_proccessed ( Some static files are cached in that folder)

[](#before-running-cli-commands-below---pls-ensure-you-have-deleted-the-folder-varview_proccessed--some-static-files-are-cached-in-that-folder)

```
bin/magento   beta_dev:deploy_static -h
Description:
  Deploy a static file.
  ---> Deploy static files from a/an module/extension.
  E.g. bin/magento beta_dev:deploy_static -f js/view/shipping-address/address-renderer/default.js -t Magento/luna -m Magento_Checkout
  ---> Deploy Css files base on a theme base Magento-Luna architecure.
  E.g. bin/magento beta_dev:deploy_static -f css/styles-l.css -t Magento/luna
  E.g. bin/magento beta_dev:deploy_static -f css/styles-m.css -t Magento/luna
  ---> Deploy JS Translation Json File base on a theme base Magento-Luna architecure.
  E.g. bin/magento   beta_dev:deploy_static -t Magento/blank -f js-translation.json

Usage:
  beta_dev:deploy_static [options]

Options:
  -f, --file_path=FILE_PATH        File Path/ Directory Path: for specific file -f js/view/shipping-address/address-renderer/default.js OR for a specific folder -f js
  -t, --theme_path=THEME_PATH      Theme path: -t Magento/luna
  -a, --area=AREA                  Area Code: -a frontend|adminhtml
  -m, --module_name[=MODULE_NAME]  Module name: -m Magento_Checkout
  -l, --locale_code[=LOCALE_CODE]  Locale code: -l da_DK
```

### 1. Build/Deploy CSS/Javascript Files COME FROM an/a extension/module

[](#1-builddeploy-cssjavascript-files-come-from-ana-extensionmodule)

```
bin/magento beta_dev:deploy_static -m Magento_Checkout -f js/view/shipping-address/address-renderer/default.js -t Magento/luna

```

\-- Able to deploy Adminhtml themes and fully deploy for a directory

```
bin/magento beta_dev:deploy_static -t Magento/backend -a adminhtml -m Magento_Catalog -f js

```

### 2. Deploy a js-translation.json

[](#2-deploy-a-js-translationjson)

Example:

```
bin/magento   beta_dev:deploy_static-t Magento/luna -f js-translation.json

```

### 3. Deploy css/styles-m.css, css/styles-l.css

[](#3-deploy-cssstyles-mcss-cssstyles-lcss)

```
bin/magento   beta_dev:deploy_static-t Magento/luna -f css/styles-l.css

```

```
bin/magento   beta_dev:deploy_static -t Magento/luna -f css/styles-m.css

```

RequireJS Config
----------------

[](#requirejs-config)

### Deploy a requirejs-config.js

[](#deploy-a-requirejs-configjs)

Example:

```
bin/magento  beta_dev:deploy_requirejs -t Magento/luna

```

### I love coding

[](#i-love-coding)

```
@Trung,lv - skype: beta.trunglv@outlook.com - email : luuvantrung@gmail.com

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

657d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/15e9d0c7c6322100e7f10b8efb4ed2a28193b52d7ba32d96033635838c7c09f0?d=identicon)[trunglv](/maintainers/trunglv)

---

Top Contributors

[![trunglv](https://avatars.githubusercontent.com/u/820411?v=4)](https://github.com/trunglv "trunglv (161 commits)")

---

Tags

magentomagento-extensionmagento2magento2-module

### Embed Badge

![Health badge](/badges/trunglv-mage2-dev/health.svg)

```
[![Health](https://phpackages.com/badges/trunglv-mage2-dev/health.svg)](https://phpackages.com/packages/trunglv-mage2-dev)
```

PHPackages © 2026

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