yireo / magento2-customer-commands

yireo/magento2-customer-commands

N/A

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: Fail Security: Pass OSL-3.0

Yireo_CustomerCommands

Magento version
PHP version
License
Latest Version

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: --country is a two-letter ISO code. --region is a region ID or name that must belong to that country; for countries without predefined regions, a name is stored as text. --default-billing and --default-shipping are flags without a value.
  • customer:address:remove: With --customer_id or --customer_email, the address is only removed when it belongs to that customer.
  • customer:address:remove and customer:address:remove-all ask for confirmation. In non-interactive mode (scripts, cron, CI) they refuse to remove anything unless --force (-f) is passed. customer:address:remove-all --dry-run only 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

Static Tests
Unit Tests
Integration Tests
Playwright
DI Compilation

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:remove and customer:address:remove-all, with a --force option to skip it
  • --dry-run option for customer:address:remove-all
  • --website option 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 --force is given
  • customer:address:remove-all exits with a failure code when some addresses could not be removed
  • --default-billing and --default-shipping of customer:address:add are now flags without a value
  • Passing both --customer_id and --customer_email is 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:add no longer crashes when --region is omitted
  • Compatibility with symfony/console v5

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:remove checks 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
Versions
Version Stability QA Status Compatibility Released
2.0.0 stable Fail Magento 2.4.7-2.4.9 Details 2026-11-25 18:54:23
1.0.1 stable Pass Not yet tested Details 2026-04-08 13:16:05
1.0.0 stable Not tested Not yet tested Details 2026-01-07 04:14:38

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.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

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.

Static analysis results
Tool Status Findings Summary
PHPCS Fail 46 13 errors, 33 warnings (ruleset: Magento2)
PHPMD Warning 9 9 rule violations (TooManyPublicMethods:6, UnusedFormalParameter:2, TooManyMethods:1)
Cpd Pass 0
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Error Error
2.4.8 Pass Pass
2.4.9 Pass Pass

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

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 2 2
2.4.8 Pass Pass
2.4.9 Pass Pass

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.

Security results
Tool Status Findings Summary
Composer audit N/A 0 no resolvable dependency tree to audit: Your requirements could not be resolved to an installable set of packages. Problem 1
Malware scan Pass 0
License
OSL-3.0

More from yireo

View vendor
Make it pay

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.