PHPackages                             tnegeli/m2clitools - 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. tnegeli/m2clitools

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

tnegeli/m2clitools
==================

Some nice commands to cleanup media files and tables on production systems

1.5.5(6mo ago)4068.2k↓10.4%14[5 issues](https://github.com/ThomasNegeli/M2CliTools/issues)MITPHPPHP &gt;=7.1

Since Jul 12Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/ThomasNegeli/M2CliTools)[ Packagist](https://packagist.org/packages/tnegeli/m2clitools)[ RSS](/packages/tnegeli-m2clitools/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (15)Used By (0)

CLI Tools for Magento 2
=======================

[](#cli-tools-for-magento-2)

Various CLI Tools for Magento 2

Available commands:
-------------------

[](#available-commands)

```
php bin/magento tnegeli:cleanup-unused-product-media

```

Use this command to backup (or delete) unused product media from filesystem.

You can use the --dry-run option to just test the result.

You can use the --delete option to remove files, instead of doing a backup.

```
php bin/magento tnegeli:cleanup-unused-category-media

```

Use this command to backup (or delete) unused category media from filesystem.

You can use the --dry-run option to just test the result.

You can use the --delete option to remove files, instead of doing a backup.

```
php bin/magento tnegeli:cleanup-unused-swatches-media

```

Use this command to backup (or delete) unused swatches media from filesystem.

You can use the --dry-run option to just test the result.

You can use the --delete option to remove files, instead of doing a backup.

```
php bin/magento tnegeli:cleanup-illegal-product-media

```

Use this command to identify and remove illegal entries in the media gallery database table, which might break catalog:images:resize process.

You can use the --dry-run option to just test the result and give you a list of value\_id entries from the media gallery table which are illegal.

```
php bin/magento tnegeli:cleanup-illegal-product-media-non-existing-files

```

Use this command to identify and remove illegal entries in the media gallery database table that have no files on the filesystem, which might break catalog:images:resize process.

You can use the --dry-run option to just test the result and give you a list of value\_id entries from the media gallery table which are illegal.

```
php bin/magento tnegeli:cleanup-illegal-product-image-markers-non-existing-files

```

Each product is checked for the attribute values of

- image
- small\_image
- thumbnail

If a product references a file that does not exist, the reference is removed.

You can use the --dry-run option to just test your database.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance65

Regular maintenance activity

Popularity44

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Every ~234 days

Recently: every ~495 days

Total

14

Last Release

192d ago

PHP version history (3 changes)1.0.0PHP &gt;=7.0.20

1.2.3PHP &gt;=7.0

1.5.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7418963?v=4)[Thomas Negeli](/maintainers/ThomasNegeli)[@ThomasNegeli](https://github.com/ThomasNegeli)

---

Top Contributors

[![ThomasNegeli](https://avatars.githubusercontent.com/u/7418963?v=4)](https://github.com/ThomasNegeli "ThomasNegeli (14 commits)")[![ThomasNegeli-CYBERHOUSE](https://avatars.githubusercontent.com/u/15209113?v=4)](https://github.com/ThomasNegeli-CYBERHOUSE "ThomasNegeli-CYBERHOUSE (13 commits)")[![lfolco](https://avatars.githubusercontent.com/u/1709329?v=4)](https://github.com/lfolco "lfolco (2 commits)")[![fharms](https://avatars.githubusercontent.com/u/1123285?v=4)](https://github.com/fharms "fharms (1 commits)")[![shinesoftware](https://avatars.githubusercontent.com/u/1553035?v=4)](https://github.com/shinesoftware "shinesoftware (1 commits)")

---

Tags

climagento

### Embed Badge

![Health badge](/badges/tnegeli-m2clitools/health.svg)

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[n98/magerun

Tools for managing Magento projects and installations

1.4k264.7k7](/packages/n98-magerun)[wp-cli/php-cli-tools

Console utilities for PHP

68325.0M367](/packages/wp-cli-php-cli-tools)

PHPackages © 2026

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