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

Technical Evaluation

Architecture fit — poor for a Laravel application, by design. n98/magerun2 is not a Laravel package and should not be evaluated as one. It is a standalone Symfony Console CLI distributed as a .phar, and every command assumes it is bootstrapping a Magento 2 application (app/bootstrap.php, Magento's DI container, area scoping, env.php/config.php). There is no service provider, facade, publishable config, or contract that a Laravel kernel could consume. Attempting to composer require it into a Laravel app produces a dependency with no integration surface and a transitive footprint that conflicts with Magento framework packages.

Integration feasibility — only as an out-of-process ops tool. The realistic touchpoints are:

  • Shelling out from CI jobs, deploy scripts (Deployer, Envoyer hooks), or a Makefile target
  • Baking the phar into a container image alongside a Magento 2 runtime
  • Invoking it via a scheduler for cache/index/backup routines
  • New in 10.1.0: driving it as an MCP (Model Context Protocol) tool server for agent-based ops assistants — the release 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 rather than a curiosity

That is operational coupling, not application architecture. If the estate is Laravel-only, feasibility is effectively zero — there is nothing for it to operate on.

Technical risk.

  • License is the top risk. Registry metadata reports NOASSERTION; upstream is believed to be MIT but this is unverified in the record. This must be confirmed against LICENSE and, ideally, legal sign-off before adoption — a CLI that can drop databases is not a tool to ship on an unverified license. 10.1.0 does not resolve this.
  • Supply chain — increased in 10.1.0. Distribution as a phar already means a single opaque artifact; 10.1.0 adds a fast DI compiler binary downloader/installer (PRs #2164, #2165), i.e. the tool now fetches a second opaque binary at runtime. Pin versions and verify checksums; do not curl | php; and pre-bake the DI compiler binary into the image rather than allowing runtime egress from production hosts.
  • Destructive surface — partially mitigated in 10.1.0. PR #2172 adds global and MCP command disabling via wildcards. This is the single most useful control in the release and converts an adopter-only responsibility into a supported, declarative guardrail. Commands such as db:dump, cache:flush, setup:upgrade wrappers, and indexer resets remain high-blast-radius.
  • Agent-driven execution. Exposing an MCP surface to LLM assistants while fix(customer) in 10.1.0 documents "repeated execution regressions" is a warning: the MCP path can retry or duplicate writes. Non-idempotent commands must be blocked over MCP, not just discouraged.
  • Metadata quality. Last release: 2026-10-07 is future-dated, and Dependents: 0 is expected for a phar-distributed tool rather than a signal of abandonment — neither should be read at face value. The 10.1.0 changelog is roughly 25 PRs, the large majority dependency bumps, which indicates active but churn-heavy maintenance.

Key questions.

  1. Is there a Magento 2 footprint in the estate at all, today or on the roadmap? If no, stop here.
  2. What is the actual, verified license?
  3. Who owns the pinned version, checksum, and upgrade cadence internally?
  4. Does the extension module API cover our bespoke needs, or do we fork?
  5. Which commands are permitted against shared/production environments, and what approval gate applies?
  6. What PHP version matrix must be supported across the Magento fleet?
  7. New: Will MCP be enabled at all? If so, which commands are exposed over MCP, and is the wildcard disable-list applied to the MCP surface specifically (not just the interactive CLI)?
  8. New: Are production hosts permitted outbound egress to fetch the DI compiler binary, or must it be pre-baked and checksum-verified in the image?

Integration Approach

Stack fit. Treat magerun2 as infrastructure tooling, not application code. It belongs in the same category as wp-cli, artisan, or composer — invoked by pipelines and humans, never imported by the application. Placing it in a tools/ or docker/ layer keeps it out of the Composer dependency graph and avoids coupling release cadence to the app. The new MCP surface does not change this: it is still an out-of-process tool, just one with an additional programmatic caller.

Migration path. Two distinct cases:

  • Laravel-only estate: reject. There is no migration path because there is no target. If the intent was to use this as part of a Magento → Laravel replatform, it is the tooling for the system being retired. 10.1.0 improves this case modestly: the new db:compatibility command assesses database and upgrade options, which is directly useful for scoping data extraction and choosing a cutover-compatible Magento DB version during replatform planning.
  • Existing Magento 2 estate: adopt incrementally as a supplementary ops tool. Do not rip out existing scripts; layer magerun2 over the highest-toil manual runbooks first (cache flush, indexer status, DB dump, module list) and retire bespoke shell scripts as coverage is proven.

Compatibility. Three axes must be pinned and tested together: magerun2 release (10.1.0 baseline), Magento 2 version, and PHP minor version. The module API is stable but not frozen; custom commands should be treated as code with tests, not throwaway scripts. Validate against the oldest and newest Magento/PHP pairs in the fleet. Note the DI compiler binary is a fourth artifact with its own version and compatibility window.

Sequencing.

  1. Verify license and record the determination
  2. Pin a specific release + SHA256 checksum in the container spec (10.1.0 or later)
  3. Pre-bake the fast DI compiler binary into the image and verify its checksum; do not allow runtime download in staging or production
  4. Containerize alongside the Magento runtime image; no host-level installs
  5. Define the wildcard command disable-list (now natively supported) and commit it to version control as the canonical policy
  6. Add a single read-only CI job (cache:status, sys:info, module:list, db:compatibility) to prove the pipeline path
  7. Enable write commands in staging only; expand the allow-list as coverage is proven
  8. Decide MCP explicitly: default to disabled in production; if enabled, scope it to read-only commands and run it behind the same mutex as CI writes
  9. Ship bespoke commands via the module API rather than wrapper scripts
  10. Publish the allow-list, deny-list, and MCP scope to the runbook

Compatibility note on upgrade from prior pins. This is a feature release on a 10.x line; nothing in the changelog is flagged as breaking. The dependency churn (phpstan, php-cs-fixer, twig 3.28→3.30, npm groups, mcp/sdk) is build- and docs-facing, not runtime-contract-facing for the commands teams typically wrap. Treat the upgrade as low-risk but re-run the read-only CI smoke job before promoting.

Operational Impact

Maintenance. Low code maintenance, moderate version maintenance. Two cost centres: the Magento/PHP compatibility matrix (each Magento or PHP bump requires re-validating the pinned phar — roughly one engineer-day per upgrade cycle), and a now-noticeably high upstream release cadence. 10.1.0 alone carries ~25 merged PRs, dominated by Dependabot bumps. Do not chase every patch release; pin deliberately on a quarterly cadence or when a specific feature (e.g. wildcard command disabling) is needed, and read changelogs before each re-pin. The extension module API remains the main long-term liability — custom commands are internal code that inherits the upstream API's change surface.

Support. Community-driven, no vendor, no SLA. Support burden falls entirely on the internal adopter. Mitigation: a named owner, an internal runbook, and a documented fallback path (raw bin/magento equivalents) for every wrapped command. Do not let magerun2 become a single point of failure for deploy. The new binary-download behaviour adds a support vector: failures will look like network or proxy errors rather than tool errors.

Scaling. Effectively a single-node, single-invocation tool — it does not scale horizontally and does not need to. The scaling concern is concurrency: multiple operators, pipeline jobs, or now MCP agents running cache/index/db commands against the same environment can corrupt state or deadlock. Serialize write operations with a CI mutex, restrict production to read-only commands, and apply the wildcard disable-list to every entry point rather than only the interactive shell.

Failure modes.

  • Phar corruption or a tampered artifact — mitigated by checksum pinning and private mirror
  • DI compiler binary fetch failure or tampering — new; surfaces in egress-restricted or air-gapped environments and adds a second artifact to trust; mitigate by pre-baking and checksumming
  • PHP version mismatch causing bootstrap failure — surfaces as a confusing Magento DI error, not a clear tool error
  • Magento bootstrap failure on partially-deployed instances — will mask real deploy problems if pipelines depend on it
  • Destructive command run against the wrong environment — still the highest-severity mode; now materially easier to prevent via environment-scoped wildcard disable-lists, which should be the first control implemented
  • Non-idempotent MCP execution — the 10.1.0 changelog's own "repeated execution regressions" fix is evidence that agent callers can double-apply writes; keep writes off the MCP surface
  • Silent behavioral drift across versions on commands teams depend on — pin and read changelogs

Ramp-up. For engineers with Magento 2 experience: near-zero, it is a well-known tool with self-documenting list/help output. For a Laravel-only team: do not ramp up at all — the tool teaches Magento internals, not Laravel ones, and the cognitive cost has no payoff in a Laravel codebase. If the decision is reversed and Magento 2 enters the estate, budget 2–3 days for one engineer to become the internal owner, plus roughly half a day on the MCP and command-policy surface introduced in 10.1.0.

Recommendation. Reject as a Laravel/PHP application dependency. The opportunity score (7.42) and star count reflect genuine value within the Magento ecosystem, not transferability to Laravel. Conditional approve as ops tooling only if a Magento 2 footprint exists and the license is verified — with the pinning, containerization, pre-baked DI binary, wildcard command allow/deny-list, and explicit MCP scoping decisions above as adoption preconditions. 10.1.0 does not change the verdict, but it does move two items in the adopter's favour (declarative command disabling, db:compatibility for replatform scoping) and one against (a runtime binary downloader in the supply chain).

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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo