Search by

eshimischi / vendor-cleanup

eshimischi

Global CLI tool & Composer plugin to strip tests, docs, and dev files from vendor in production

Package info

github.com/eshimischi/vendor-cleanup

Type:composer-plugin

pkg:composer/eshimischi/vendor-cleanup

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v2.0.3 2026-11-24 16:47 UTC

This package is auto-updated.

Last update: 2026-11-24 16:50:22 UTC


README

PHP Version Coding Standard License

Global CLI utility and Composer plugin to strip tests, documentation, CI configs, and other non-production files from your vendor directory.

Installation

Global installation (recommended)

composer global config --no-plugins allow-plugins.eshimischi/vendor-cleanup true
composer global require eshimischi/vendor-cleanup

Make sure Composer's global bin directory (composer global config bin-dir --absolute) is in your system $PATH.

Project installation

composer config --no-plugins allow-plugins.eshimischi/vendor-cleanup true
composer require eshimischi/vendor-cleanup

Usage

1. Automatic mode (Composer Plugin)

When installed globally or locally, the plugin automatically cleans vendor after composer install --no-dev or composer update --no-dev. In dev mode (--dev), automatic cleanup is skipped so your local test suites stay intact.

You can customize patterns or disable auto-run in your project's composer.json:

{
    "extra": {
        "vendor-cleanup": {
            "auto": true,
            "include": ["*.zip", "*.rar"],
            "exclude": ["doc", "docs"]
        }
    }
}

2. Manual CLI mode

Run cleanup inside any Composer project directory:

# Preview what will be deleted (dry run)
cleanup --dry

# Clean vendor with verbose output
cleanup -v

# Clean only a specific vendor subdirectory with custom patterns
cleanup -v --path symfony --include "*.zip,*.rar" --exclude "doc,docs,test"

Options

Flag Description
-h, --help Display help message
-i, --include Add comma-separated glob patterns
-e, --exclude Remove comma-separated patterns from defaults
-p, --path Target a specific subdirectory inside vendor
-d, --dry Run without deleting any files
-v, --verbose Print every matched path