yireo / magento2-customer-commands
N/A
Yireo_CustomerCommands
This Magento 2 module adds various CLI commands to manage customers
Installation
Install this package via composer:
composer require yireo/magento2-customer-commands
Next, enable this module:
bin/magento module:enable Yireo_CustomerCommands
Usage
All commands identify a customer with either --customer_id or --customer_email (not both). With --website (ID or code), the customer is looked up in that website, which is needed when customer accounts are shared per website.
bin/magento customer:address:list [email protected] --website=base
bin/magento customer:address:add --customer_id=42 --firstname=Jane --lastname=Doe --street="1 Congress Avenue" \
--city=Austin --postcode=78701 --region=Texas --country=US --telephone=0123456789 --default-billing --default-shipping
bin/magento customer:address:remove 12 --customer_id=42
bin/magento customer:address:remove-all [email protected] --dry-run
customer:address:add:--countryis a two-letter ISO code.--regionis a region ID or name that must belong to that country; for countries without predefined regions, a name is stored as text.--default-billingand--default-shippingare flags without a value.customer:address:remove: With--customer_idor--customer_email, the address is only removed when it belongs to that customer.customer:address:removeandcustomer:address:remove-allask for confirmation. In non-interactive mode (scripts, cron, CI) they refuse to remove anything unless--force(-f) is passed.customer:address:remove-all --dry-runonly shows what would be removed, and the command exits with a failure code when some addresses could not be removed.
Note that customer:address:list prints personal data, and options like --customer_email end up in your shell history.
Current status
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
[2.0.0] - 25 November 2026
Added
- Confirmation prompt for
customer:address:removeandcustomer:address:remove-all, with a--forceoption to skip it --dry-runoption forcustomer:address:remove-all--websiteoption to look up a customer by email within a specific website
Changed
- BREAKING: the address removal commands refuse to remove anything in non-interactive mode unless
--forceis given customer:address:remove-allexits with a failure code when some addresses could not be removed--default-billingand--default-shippingofcustomer:address:addare now flags without a value- Passing both
--customer_idand--customer_emailis rejected
Removed
- PHP 8.1 support (PHP 8.2 up to 8.5 is supported)
Fixed
- Installing Magento with this module enabled failed with "Table eav_entity_type doesn't exist"
- Crash "Area code is not set" in the list, add and remove-all commands for customers with addresses
- An unknown customer ID or email reports "Unable to load customer" instead of throwing an exception
customer:address:addno longer crashes when--regionis omitted- Compatibility with
symfony/consolev5
Security
- Stored address data and error messages are escaped before being written to the terminal, preventing terminal escape sequence injection
- Strict validation of customer, country code, region, address ID and option lengths;
customer:address:removechecks that the address belongs to the given customer
[1.0.1] - 08 April 2026
Fixed
- PHP 8.4 compat
[1.0.0] - 07 January 2026
Fixed
- Finalize commands
- Add address as well
- Fix wrong check
- Allow by email; Output with table
- Adding all files to git via Yireo Command
Requires 7
| Package | Constraint |
|---|---|
| ext-pcre | * |
| magento/framework | ^103.0 |
| magento/module-customer | ^103.0 |
| magento/module-directory | ^100.4 |
| magento/module-store | ^101.0 |
| php | >=8.2 <8.6 |
| symfony/console | ^5.0 | ^6.0 | ^7.0 |
Requires-dev 3
| Package | Constraint |
|---|---|
| loki/magento2-functional-tests | @dev |
| phpunit/phpunit | ^10.5 |
| yireo/magento2-integration-test-helper | ~0.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. A phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from yireo
View vendorReplace bundled third party packages from Magento
N/A
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.