Skip to content

Add auto-managed magerun2 wrapper#101

Merged
peterjaap merged 1 commit into
qoliber:mainfrom
Aquive:feature/auto-managed-magerun2-wrapper
May 12, 2026
Merged

Add auto-managed magerun2 wrapper#101
peterjaap merged 1 commit into
qoliber:mainfrom
Aquive:feature/auto-managed-magerun2-wrapper

Conversation

@Aquive
Copy link
Copy Markdown
Contributor

@Aquive Aquive commented Apr 25, 2026

Closes #85

Summary

  • Installs ~/.magebox/bin/magerun2 wrapper during bootstrap — no manual version management required
  • Detects Magento version from composer.lock and maps to the correct n98-magerun2 version: 7.5.0 for Magento < 2.4.5, latest GitHub release for 2.4.5+
  • GitHub API is called at most once — on first use when no phar is installed. All subsequent invocations are fully offline
  • SHA256 checksum verification on download (gracefully skipped if not available)
  • Integrates with magebox check to show wrapper and phar status
  • Documentation updated: php-wrapper.md, bootstrap.md, commands.md

How it works

magerun2 cache:flush
  → ~/.magebox/bin/magerun2 (shell wrapper)
    → magebox magerun-resolve [--project-dir=...]
      → detects Magento version from composer.lock
      → returns path to correct phar (downloads once if needed)
    → ~/.magebox/bin/php <phar> cache:flush

Version selection

Magento version n98-magerun2
2.4.0 – 2.4.4 7.5.0 (legacy series)
2.4.5 and up Latest release from GitHub

Tested

Confirmed working for:

  • Magento 2.4.3
  • Magento 2.4.6
  • Magento 2.4.7

Installs ~/.magebox/bin/magerun2 during bootstrap — no manual version
management required. Detects Magento version from composer.lock, maps
to the correct n98-magerun2 version (7.5.0 for Magento < 2.4.5, latest
GitHub release for 2.4.5+), and downloads the phar once. Subsequent
invocations are fully offline. SHA256 checksum verification included.

Integrates with `magebox check` to show wrapper and phar status.
@jakwinkler
Copy link
Copy Markdown
Contributor

Does it ruin as magerun ?
I'm all forward for it, maybe we can add mrun as an alias? ;-)
PR looks good, but I don't have time to test this one locally, @peterjaap up for grabs :-)

@Aquive
Copy link
Copy Markdown
Contributor Author

Aquive commented Apr 30, 2026

@jakwinkler it runs with magerun2. Any alias is possible. Should this be included or should one do it in their own aliases?

I tested it it works great on my end :) Looking forward to have this in the next release.

@jakwinkler
Copy link
Copy Markdown
Contributor

jakwinkler commented Apr 30, 2026

It is fine, but I don't work with a lot of projects lately so I leave it to you and @peterjaap to merge this ;-)

@peterjaap peterjaap merged commit 3d14f18 into qoliber:main May 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: automagic Magerun2 management by Magebox

3 participants