PHPackages                             hammer/wh - 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. hammer/wh

ActiveMagento2-module[CLI &amp; Console](/categories/cli)

hammer/wh
=========

It creates a new shell command with a handful of M2 tools

21.6kPHP

Since Jan 22Pushed 6y ago3 watchersCompare

[ Source](https://github.com/WeidenhammerCommerce/wh)[ Packagist](https://packagist.org/packages/hammer/wh)[ RSS](/packages/hammer-wh/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

¯\\ \_(ツ)\_/¯
-------------

[](#-_ツ_)

WH creates a new shell command {wh} with a handful of M2 tools
--------------------------------------------------------------

[](#wh-creates-a-new-shell-command-wh-with-a-handful-of-m2-tools)

v.0.1.3
-------

[](#v013)

- Added config option to display all layout handles at the top of the page

v.0.1.1
-------

[](#v011)

- Added the {tools:regenerate} command

v.0.1.0
-------

[](#v010)

- Refactored code and added several options to the {create:module} command

v.0.0.7
-------

[](#v007)

- Added the {cloud} command

👁️ Installation
---------------

[](#eye-installation)

- Go to your Magento root folder and run:

```
$ composer require hammer/wh:dev-master

```

- Enter your Company name, theme, store and other optional parameters in the following array, and add it to the app/etc/env.php file:

```
'wh' =>
  array (
      'company_name' => 'CompanyName', // required, where you place your modules (app/code/[CompanyName] or extensions/[CompanyName])
      'default_theme' => 'CompanyName/ThemeName', // required, theme you're currently working on
      'default_store' => 'Default Store View', // required, store you're currently working on
      'localization' => 'en_US', // default localization code
      'composer_files' => 1, // 1 or 0, 1 creates a composer.json on new modules
      'module_version' => '0.0.1', // default version of new modules
      'dummy_categories' => 1, // default qty of dummy categories
      'dummy_products' => 1, // default qty of dummy products
      'view_product_link' => 1, // 1 or 0, 1 shows 'View Product' link on Admin
      'ask_if_multistore' => 0, // 1 or 0, 1 asks for desired theme/store if multistore
      'save_db_folder' => 'var/dump', // folder to save the database dump
      'display_handles' => 0, // display all layout handles at the top of all pages
      'admin_credentials' => 'username::password', // display credentials on the admin login page
      'magento_cloud' => 0, // 1 or 0, 1 if using Magento Cloud
      'magento_cloud_project_id' => '', // magento cloud project ID, if any
      'magento_command' => 'bin/magento' // magento command line
  )

```

Notes for faster development

1. We recommend creating a system alias for "bin/magento". Example: "bm"
2. If multistore, we recommend setting the "default\_theme" config along with "ask\_if\_multistore=0"

- Enable the WH module:

```
$ bin/magento module:enable Hammer_WH
$ bin/magento s:up
$ bin/magento c:f

```

- You are good to go! You can check it was installed correctly by running:

```
$ bin/magento wh

```

### Update the WH module to its latest version

[](#update-the-wh-module-to-its-latest-version)

- Go to your Magento root folder and run:

```
$ composer update hammer/wh

```

Note: remember to always develop in *Developer* mode

👁️ INFO commands
----------------

[](#eye-info-commands)

### Show all available commands

[](#show-all-available-commands)

```
$ bin/magento wh --help

```

### Show all available commands with an option to select it

[](#show-all-available-commands-with-an-option-to-select-it)

```
$ bin/magento wh options (alias op)

```

### Show information of your Magento instance (Edition, Version, Mode, Session, Crypt Key and Install Date)

[](#show-information-of-your-magento-instance-edition-version-mode-session-crypt-key-and-install-date)

```
$ bin/magento wh info:m2 (alias i:m2)

```

### Show information of all of your Stores (ID, Title and Code)

[](#show-information-of-all-of-your-stores-id-title-and-code)

```
$ bin/magento wh info:store (alias i:s)

```

### List modules (with its code version)

[](#list-modules-with-its-code-version)

- (multiselect) Type of modules

```
$ bin/magento wh info:modules (alias i:m)

```

👁️ CACHE commands
-----------------

[](#eye-cache-commands)

### Removes the specific cache to regenerate the templates

[](#removes-the-specific-cache-to-regenerate-the-templates)

```
$ bin/magento wh cache:templates (alias c:t)

```

### Removes the specific cache to regenerate the layouts

[](#removes-the-specific-cache-to-regenerate-the-layouts)

```
$ bin/magento wh cache:layouts (alias c:l)

```

### Removes the specific cache after changing admin configurations

[](#removes-the-specific-cache-after-changing-admin-configurations)

```
$ bin/magento wh cache:config (alias c:c)

```

### Removes var/cache &amp; var/page\_cache

[](#removes-varcache--varpage_cache)

```
$ bin/magento wh cache:layouts (alias c:v)

```

### Removes the specific cache to regenerate the DI

[](#removes-the-specific-cache-to-regenerate-the-di)

```
$ bin/magento wh cache:generated (alias c:g)

```

### Removes the specific cache to regenerate the styles

[](#removes-the-specific-cache-to-regenerate-the-styles)

- (string) Name of the theme

```
$ bin/magento wh cache:styles (alias c:s)

```

### Removes all cache (everything within /var and /pub/static, and /generated if Cloud)

[](#removes-all-cache-everything-within-var-and-pubstatic-and-generated-if-cloud)

```
$ bin/magento wh cache:all (alias c:a)

```

### Removes selected cache (separated by comma)

[](#removes-selected-cache-separated-by-comma)

- (multiselect) Folders to remove (example: 1,3,5)

```
$ bin/magento wh cache:custom (alias c:cu)

```

### Removes the specific cache to regenerate the admin

[](#removes-the-specific-cache-to-regenerate-the-admin)

```
$ bin/magento wh cache:admin (alias c:ad)

```

👁️ CREATION commands
--------------------

[](#eye-creation-commands)

### Create new module

[](#create-new-module)

- (string) Name of the module
- (multiselect) Setup files (example: 1,3 to create InstallData.php and InstallSchema.php)
- (select) Feature
    - Extend Block/Model class
    - Create Plugin for a method
    - Create frontend page to display template
    - Create frontend page to display template using view\_model
    - Create frontend page to return JSON
    - Attach Observer to Event
    - Replace constructor argument
    - Create new Command line
    - Create REST API with ACL
- (other options) Based on the Feature selected

```
$ bin/magento wh create:module (alias cr:m)

```

### Create new theme

[](#create-new-theme)

- (string) Name of the theme
- (int) Theme to extend from: blank, Luma (beta) or custom

```
$ bin/magento wh create:theme (alias cr:t)

```

### Create dummy data

[](#create-dummy-data)

- (int) Quantity of categories
- (int) Quantity of products

```
$ bin/magento wh create:dummy (alias cr:d)

```

👁️ CUSTOMER commands
--------------------

[](#eye-customer-commands)

### Create new customer

[](#create-new-customer)

- (string) First name
- (string) Last name
- (string) Email
- (string) Password

```
$ bin/magento wh customer:create (alias c:cr)

```

### Update password of existing customer

[](#update-password-of-existing-customer)

- (string) Email of existing customer (autocomplete)
- (string) New password

```
$ bin/magento wh customer:password (alias c:p)

```

👁️ ADMIN commands
-----------------

[](#eye-admin-commands)

### Create new admin user

[](#create-new-admin-user)

- (string) Email
- (string) Username
- (string) Password

```
$ bin/magento wh admin:create (alias a:cr)

```

### Update password of existing admin user

[](#update-password-of-existing-admin-user)

- (string) Email of existing admin user (autocomplete)
- (string) New password

```
$ bin/magento wh admin:password (alias a:p)

```

👁️ FRONTEND TOOLS commands
--------------------------

[](#eye-frontend-tools-commands)

### Deploy frontend static content for given theme

[](#deploy-frontend-static-content-for-given-theme)

- (string) Name of the theme

```
$ bin/magento wh tools:static (alias t:s)

```

### Copy core template to theme to override it

[](#copy-core-template-to-theme-to-override-it)

- (string) Name of the theme
- (string) Path to the existing template (example: vendor/magento/module-checkout/view/frontend/templates/cart.phtml)

```
$ bin/magento wh override:template (alias o:t)

```

### Enable the Template Hints

[](#enable-the-template-hints)

```
$ bin/magento wh hints:on (alias h:on)

```

### Disable the Template Hints

[](#disable-the-template-hints)

```
$ bin/magento wh hints:off (alias h:off)

```

👁️ OTHER TOOLS commands
-----------------------

[](#eye-other-tools-commands)

### List of Magento Cloud commands

[](#list-of-magento-cloud-commands)

```
$ bin/magento wh cloud
Select a Magento Cloud command for the project:
  [0 ] See project info
  [1 ] See your account info
  [2 ] See all users
  [3 ] See all envs
  [4 ] See env info
  [5 ] See env URLs
  [6 ] See env logs
  [7 ] See env activity (last 10)
  [8 ] Create branch
  [9 ] Activate env
  [10] Download dump of env database
  [11] Get command to connect to env through SSH

```

### Creates dump of the database in given folder

[](#creates-dump-of-the-database-in-given-folder)

```
$ bin/magento wh dump

```

### Downgrades version of the database module to the one on the code

[](#downgrades-version-of-the-database-module-to-the-one-on-the-code)

(useful after changing branches)

- (string) Name of the existing module

```
$ bin/magento wh module:downgrade (alias m:d)

```

### Regenerate URL rewrites of products/categories in all/specific store/s

[](#regenerate-url-rewrites-of-productscategories-in-allspecific-stores)

- (multiselect) Store

```
$ bin/magento wh tools:regenerate (alias t:r)

```

### Deploy to given mode

[](#deploy-to-given-mode)

- (select) Name of the mode (show, developer or production)

```
$ bin/magento wh deploy:mode (alias d:m)

```

### Show M2 snippets

[](#show-m2-snippets)

- (select) Snippet to show

```
$ bin/magento wh snippets (alias sn)

```

Send us your feedback!
======================

[](#send-us-your-feedback)

📧

¯\\\_(ツ)\_/¯
============

[](#_ツ_)

Badges
------

[](#badges)

[![](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)[![](https://camo.githubusercontent.com/4d2e0b216a8a44aa89445667505c655893a94f61c7e00afe3b554b28198e9c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d737461626c652d677265656e2e737667)](https://camo.githubusercontent.com/4d2e0b216a8a44aa89445667505c655893a94f61c7e00afe3b554b28198e9c46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7374617475732d737461626c652d677265656e2e737667)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

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/7a7fbdffac12b02885bf6376b3277b5622935c9bb5099f126226a7c7cc41efcf?d=identicon)[weidenhammer](/maintainers/weidenhammer)

![](https://www.gravatar.com/avatar/ec7806dd59131da34a12d7b7f14f056e143835e02ba18ca20c612b93d7f7d4ef?d=identicon)[emafernandez](/maintainers/emafernandez)

![](https://www.gravatar.com/avatar/ba2fa4327eefac940f89357ecc0430721e6068f01aba0922ad9a39acd603c494?d=identicon)[rsisco](/maintainers/rsisco)

---

Top Contributors

[![spraxis](https://avatars.githubusercontent.com/u/17143366?v=4)](https://github.com/spraxis "spraxis (77 commits)")

### Embed Badge

![Health badge](/badges/hammer-wh/health.svg)

```
[![Health](https://phpackages.com/badges/hammer-wh/health.svg)](https://phpackages.com/packages/hammer-wh)
```

###  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.8M19](/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)
