Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Magerun2 Laravel Package

n98/magerun2

n98/magerun2 is the Swiss Army knife CLI for Magento 2 developers, offering commands to manage cache, indexes, configuration, databases, modules, and more. It streamlines everyday development and maintenance tasks from the terminal.

View on GitHub
Deep Wiki
Context7

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

Frequently asked questions about Magerun2
Can I install n98/magerun2 with Composer in a Laravel application?
You can technically run the Composer require, but you should not. n98/magerun2 is a standalone Symfony Console CLI distributed as a .phar, and every command bootstraps a Magento 2 application through app/bootstrap.php, Magento's DI container, area scoping and env.php. There is no service provider, facade, publishable config or contract a Laravel kernel can consume, and the transitive Magento framework packages can conflict with your app. Install it only where a Magento 2 runtime actually exists.
Is n98/magerun2 a Laravel package?
No. It is a swiss-army command line tool for Magento 2 developers, sysadmins and devops, providing commands for cache, index, config and database tasks. It ships no Laravel integration surface at all. If your estate is Laravel-only, feasibility is effectively zero because there is nothing for the tool to operate on.
How do I call magerun2 from a Laravel deploy script or CI pipeline?
Treat it strictly as an out-of-process ops tool. Shell out to the pinned phar from CI jobs, Deployer or Envoyer hooks, or a Makefile target, and bake the phar into a container image that also carries a Magento 2 runtime. Keep it out of the Laravel app's Composer dependencies so it never loads in the application lifecycle. Run each command in staging first, especially anything touching cache, indexers or the database.
What license does n98/magerun2 use and is it safe to adopt?
Registry metadata reports NOASSERTION; upstream is believed to be MIT, but this is unverified in the record. Confirm it against the repository LICENSE file and get legal sign-off before adoption, because this is a CLI that can drop databases with commands like db:dump and cache:flush. Release 10.1.0 does not resolve this licensing ambiguity.
Which Laravel or PHP versions does n98/magerun2 support?
Laravel version support is not applicable, since the tool does not integrate with Laravel at all. What matters is the PHP version matrix across your Magento 2 fleet, which the tool follows. Establish that matrix before pinning a magerun2 version, and record who owns upgrades internally.
How do I disable dangerous magerun2 commands like db:dump on production?
Version 10.1.0 adds global and MCP command disabling via wildcards (PR #2172), turning destructive-surface control into a supported declarative guardrail. Use that disable list to block db:dump, cache:flush, setup:upgrade wrappers and indexer resets on shared or production environments. Apply the same wildcard list to the MCP surface specifically, not just the interactive CLI, and pair it with an approval gate.
What is the new MCP support in n98/magerun2 10.1.0 and is it safe for agents?
10.1.0 bumps mcp/sdk from 0.7.1 to 0.8.1 and fixes MCP argument-handling and repeated-execution regressions, so MCP is now a first-class, actively maintained interface for agent-based ops assistants. The documented repeated-execution regressions are a warning that the MCP path can retry or duplicate writes. Block non-idempotent commands over MCP outright rather than merely discouraging them.
Is the phar distribution of n98/magerun2 a supply chain risk?
Yes. A .phar is already a single opaque artifact, and 10.1.0 adds a fast DI compiler binary downloader and installer (PRs #2164 and #2165), meaning the tool can fetch a second opaque binary at runtime. Pin versions, verify checksums, and never pipe a remote download into php. Pre-bake the DI compiler binary into your image instead of allowing outbound egress from production hosts.
Is n98/magerun2 actively maintained?
The 10.1.0 changelog covers roughly 25 PRs, the large majority dependency bumps, which indicates active but churn-heavy maintenance. Metadata showing a future-dated last release of 2026-10-07 and zero dependents should not be read at face value, since dependents are expected to be near zero for a phar-distributed tool. Assign internal ownership of the pinned version, checksum and upgrade cadence.
What are the alternatives to n98/magerun2 for a Laravel team?
For Laravel-only work there is no direct substitute, because the tool exists to operate Magento 2; use Artisan, migrations and Envoy hooks instead. If you run Magento alongside Laravel, the magerun2 extension module API can cover bespoke needs, or you fork it. Before evaluating further, confirm whether a Magento 2 footprint exists in your estate today or on the roadmap, and stop there if it does not.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager