CLI Commands
Complete reference for all MageBox commands.
Global Flags
These flags work with any command:
-v, -vv, -vvv
Enable verbose logging for debugging and troubleshooting.
magebox -v start # Basic - shows commands being run
magebox -vv start # Detailed - shows command output
magebox -vvv start # Debug - full debug infoVerbosity levels:
-v(basic) - Shows commands being executed-vv(detailed) - Shows command output and results-vvv(debug) - Full debug information including platform detection
Output is color-coded: [verbose] (cyan), [debug] (yellow), [trace] (magenta)
Project Commands
magebox init [name]
Initialize a new MageBox project.
magebox init mystoreCreates a .magebox.yaml configuration file in the current directory.
Interactively prompts for the PHP version. The default is derived from the project's composer.json — preferring config.platform.php, then falling back to require.php — and from the global default when no supported version is declared.
Arguments:
name- Project name (optional, defaults to directory name)
magebox start
Start the project environment.
magebox start
magebox start --all # Start all discovered projectsThis command:
- Generates PHP-FPM pool configuration
- Generates Nginx vhost configuration
- Starts required Docker services
- Updates DNS (if hosts mode)
- Generates SSL certificates (if needed)
- Reloads Nginx
- Prompts to start custom Docker containers (if
compose_fileis configured)
Options:
--all- Start all discovered MageBox projects at once
magebox stop
Stop the project environment.
magebox stop
magebox stop --all # Stop all running projects
magebox stop --dry-run # Preview what would happenStops PHP-FPM pool and removes Nginx configuration. If compose_file is configured, prompts to stop custom Docker containers first.
Options:
--all- Stop all running MageBox projects at once--dry-run- Preview what would happen without making changes
magebox restart
Restart the project environment.
magebox restart
magebox restart --all # Restart all projectsEquivalent to stop followed by start.
Options:
--all- Restart all MageBox projects at once
magebox status
Show project status.
magebox statusDisplays:
- PHP version and pool status
- Nginx vhost status
- Service connectivity
- Domain information
magebox new [directory]
Create a new Magento/MageOS installation.
magebox new mystore
magebox new mystore --quick
magebox new mystore --quick --hyvaInteractive wizard that guides through:
- Distribution selection (Magento/MageOS)
- Version selection
- PHP version
- Composer authentication
- Database configuration
- Search engine selection
- Service configuration
- Sample data installation
Options:
--quick,-q- Quick install with sensible defaults (MageOS, PHP 8.3, MySQL 8.0, OpenSearch)--with-sample- Include sample data (used with--quick)--hyva- Install and activate the Hyvä theme. Prompts for Hyvä Composer credentials if not already configured.
TIP
Combine --quick --hyva for the fastest way to get a Hyvä-powered store running.
magebox open
Open the project in the default browser.
magebox open [worktree]Opens the first domain from .magebox.yaml using https:// when SSL is enabled, otherwise http://. If the project is not fully running, magebox open starts it first (skipping optional Xdebug and Blackfire). If everything is already up, the browser opens immediately.
Opening a worktree
Pass a single argument to target a git worktree under .claude/worktrees/<worktree>:
magebox open b2b-caseMageBox derives a .magebox.local.yaml inside that worktree from its .magebox.yaml, then starts and opens the worktree as its own isolated project:
.<worktree>is appended to the projectname— e.g.mystorebecomesmystore.b2b-case, so the worktree runs as a separate MageBox project..<worktree>is inserted before the TLD of every domainhost— e.g.mystore.localhostbecomesmystore.b2b-case.localhost.
Comments and layout from .magebox.yaml are preserved, and the override is rewritten on every run, so the command is safe to repeat.
PHP Commands
magebox php [version]
Show or switch PHP version.
# Show current version
magebox php
# Switch to PHP 8.3
magebox php 8.3Switching creates/updates .magebox.local.yaml with the new version.
Available versions: 8.1, 8.2, 8.3, 8.4
magebox shell
Open a shell with the correct PHP in PATH.
magebox shellOpens a new shell where:
- PHP points to project's configured version
- Environment variables are set
- Working directory is project root
magebox php ini set <key> <value>
Set a PHP INI value for the current project.
magebox php ini set memory_limit 512M
magebox php ini set max_execution_time 300
magebox php ini set display_errors OnSettings are stored in .magebox.yaml and applied to the project's PHP-FPM pool.
magebox php ini get <key>
Get the current value of a PHP INI setting.
magebox php ini get memory_limitShows the effective value from pool configuration.
magebox php ini list
List all PHP INI settings for the project.
magebox php ini listShows both default values and custom overrides.
magebox php ini unset <key>
Remove a custom PHP INI override.
magebox php ini unset memory_limitReverts the setting to its default value.
magebox php opcache status
Show OPcache status for the project.
magebox php opcache statusDisplays current OPcache configuration (enabled/disabled).
magebox php opcache enable
Enable OPcache for the project.
magebox php opcache enableSets opcache.enable=1 in the project's PHP configuration.
magebox php opcache disable
Disable OPcache for the project.
magebox php opcache disableSets opcache.enable=0 - useful during development for immediate code changes.
magebox php opcache clear
Clear OPcache by reloading PHP-FPM.
magebox php opcache clearForces PHP-FPM to reload, clearing the OPcache.
magebox php system
View PHP system-level settings (PHP_INI_SYSTEM) and their activation status.
magebox php systemShows which project owns the system settings, their values, and whether they're active.
PHP_INI_SYSTEM Settings
Some PHP settings like opcache.preload, opcache.jit, and opcache.memory_consumption can only be set in php.ini (not per-pool). These settings apply to ALL projects using the same PHP version.
magebox php system enable
Enable PHP system settings by creating a symlink.
magebox php system enableCreates a symlink from your MageBox system INI to the PHP scan directory. Requires sudo.
magebox php system disable
Disable PHP system settings by removing the symlink.
magebox php system disablemagebox php system list
List all PHP_INI_SYSTEM setting names.
magebox php system listShows all PHP settings that can only be set globally (opcache.preload, opcache.jit, etc.).
PHP Isolation Commands
Isolated PHP-FPM masters allow you to configure PHP_INI_SYSTEM settings (like opcache.memory_consumption, opcache.jit, opcache.preload) independently for each project.
magebox php isolate
Enable a dedicated PHP-FPM master process for the current project.
# Enable isolation with opcache disabled (default for development)
magebox php isolate
# Enable with custom opcache settings
magebox php isolate --opcache-memory=512 --jit=tracing
# Enable with preload script
magebox php isolate --preload=/path/to/preload.phpOptions:
--opcache-memory: OPcache memory consumption in MB (e.g., 512)--jit: OPcache JIT mode (off, tracing, function)--preload: Path to preload script
magebox php isolate status
Show isolation status for the current project.
magebox php isolate statusDisplays:
- Whether project is using isolated or shared PHP-FPM
- Socket path, PID file, and config path
- PHP_INI_SYSTEM settings configured
- Running status
magebox php isolate disable
Disable isolation and return to shared PHP-FPM pool.
magebox php isolate disablemagebox php isolate list
List all projects with isolated PHP-FPM masters.
magebox php isolate listmagebox php isolate restart
Restart the isolated PHP-FPM master for the current project.
magebox php isolate restartWhen to Use Isolation
Use php isolate when you need:
- Different opcache memory per project
- JIT compilation for specific projects only
- Preload scripts that are project-specific
- Complete PHP setting isolation from other projects
For simple settings like memory_limit or max_execution_time, use php ini instead - those work at the pool level without isolation.
Running Magento CLI
Use the MageBox PHP wrapper or project shell to run Magento commands:
# Using the shell (recommended)
magebox shell
php bin/magento cache:flush
# Or directly with the wrapper
~/.magebox/bin/php bin/magento cache:flushThe PHP wrapper automatically uses the correct PHP version for your project.
TIP
See CLI Wrappers for more details on using php, composer, and other CLI tools.
Extension Commands
magebox ext list
List all loaded PHP extensions for the current project's PHP version.
magebox ext listmagebox ext install <extension> [extension...]
Install one or more PHP extensions.
# System packages (apt/dnf/pacman/pecl)
magebox ext install redis apcu
magebox ext install pgsql
# Custom extensions via PIE (vendor/package format)
magebox ext install noisebynorthwest/php-spxPrompts to select which installed PHP version(s) to install for, with "All installed" as the default.
For standard extension names (e.g., redis), uses the system package manager. For vendor/package format, uses PIE (PHP Installer for Extensions) and automatically installs PIE and the PHP dev tools if needed.
magebox ext remove <extension> [extension...]
Remove one or more PHP extensions.
magebox ext remove redis
magebox ext remove noisebynorthwest/php-spxPrompts to select which PHP version(s) to remove from.
magebox ext search <query>
Search for available PHP extension packages.
magebox ext search redis
magebox ext search mongoShows matching packages from the system package manager with installed/not-installed status.
magebox ext pie
Install PIE (PHP Installer for Extensions), the official PECL replacement.
magebox ext piePIE is required to install custom extensions using the vendor/package format from Packagist. It is installed automatically when you first run magebox ext install vendor/package.
Custom Commands
magebox run <name>
Execute a custom command.
magebox run deploy
magebox run reindex
magebox run # Interactive selector when no name givenRuns commands defined in .magebox.yaml:
commands:
deploy: "php bin/magento deploy:mode:set production"When called without a command name, an interactive TUI menu is shown listing all available custom commands. Use arrow keys to select, Enter to run.
Options:
--list,-l- Print available commands as plain text (no interactive UI)
Magerun2
MageBox automatically manages n98-magerun2 — no manual installation required. The correct version is downloaded on first use based on your Magento version, then installed permanently.
magerun2 cache:flush
magerun2 setup:upgrade
magerun2 sys:infoAny command not recognized by MageBox is also automatically forwarded to magerun2:
magebox cache:flush # → magerun2 cache:flush
magebox setup:upgrade # → magerun2 setup:upgrade
magebox sys:info # → magerun2 sys:infoMageBox verifies the command exists in magerun2 before forwarding. The project's configured PHP version is automatically used. Custom commands defined in .magebox.yaml take priority over magerun2 commands.
Version selection is based on the Magento version detected from composer.lock:
| Magento version | n98-magerun2 |
|---|---|
| 2.4.0 – 2.4.4 | 7.5.0 |
| 2.4.5 and up | Latest |
The phar is installed in ~/.magebox/magerun/ and never re-downloaded automatically. To update: rm ~/.magebox/magerun/n98-magerun2-*.phar.
Database Commands
magebox db shell
Open MySQL/MariaDB shell.
magebox db shellConnects to the project's database with correct credentials.
magebox db import [file]
Import SQL dump with progress tracking.
magebox db import dump.sql
magebox db import dump.sql.gzArguments:
file- SQL file to import
Features:
- Real-time progress bar showing percentage, speed, and ETA
- Supports both plain SQL and gzipped files
- Tracks compressed file size for accurate progress on
.sql.gzfiles
Example output:
Importing dump.sql.gz into database 'mystore' (magebox-mysql-8.0)
Importing: ████████████████████░░░░░░░░░░░░░░░░░░░░ 52.3% (156.2 MB/298.5 MB) 24.5 MB/s ETA: 6smagebox db export [file]
Export database.
magebox db export backup.sql
magebox db export backup.sql.gz
magebox db export - > backup.sqlArguments:
file- Output file (use-for stdout)
magebox db create
Create the project database.
magebox db createCreates the database defined in .magebox.yaml if it doesn't exist.
magebox db drop
Drop the project database.
magebox db dropDANGER
This permanently deletes all data. Requires confirmation.
magebox db reset
Drop and recreate the project database.
magebox db resetEquivalent to db drop followed by db create. Requires confirmation.
magebox db top
Monitor database processes in real time.
magebox db topUses innotop when installed for a full-featured TUI, falling back to mysqladmin processlist otherwise. Connects to the project's database container automatically.
Press Ctrl+C to stop.
magebox db snapshot create [name]
Create a database snapshot for quick backup.
magebox db snapshot create # Auto-named with timestamp
magebox db snapshot create mybackup # Named snapshotArguments:
name- Snapshot name (optional, defaults to timestamp)
Snapshots are compressed with gzip and stored in ~/.magebox/snapshots/{project}/.
magebox db snapshot restore <name>
Restore database from a snapshot.
magebox db snapshot restore mybackupArguments:
name- Snapshot name to restore (required)
WARNING
This replaces the current database. The existing data will be lost.
magebox db snapshot list
List all snapshots for the current project.
magebox db snapshot listShows snapshot name, size, and creation date.
magebox db snapshot delete <name>
Delete a snapshot.
magebox db snapshot delete mybackupArguments:
name- Snapshot name to delete (required)
Purge Command
magebox purge
Remove all generated files, caches, and preprocessed views.
magebox purgeClears:
generated/metadata/*andgenerated/code/*pub/static/*var/cache/*,var/page_cache/*,var/view_preprocessed/*var/composer_home/*- Redis/Valkey (if configured)
- Varnish (if configured)
Redis Commands
These commands work with both Redis and Valkey.
magebox redis shell
Open Redis CLI.
magebox redis shellmagebox redis flush
Clear all Redis/Valkey data.
magebox redis flushmagebox redis info
Show Redis/Valkey statistics.
magebox redis infoWatch Command
magebox watch
Watch for file changes and selectively clear affected Magento cache types.
magebox watchRuns mage-os/magento-cache-clean in the foreground, watching the project directory and clearing only the cache types affected by each file change.
Hyvä detection: If a Hyvä Tailwind theme is found in app/design/frontend/, MageBox launches a split tmux session — left pane runs npm run watch for the Tailwind build, right pane runs the cache watcher.
Auto-install: If cache-clean.js is not found, MageBox offers to install it via composer global require mage-os/magento-cache-clean.
TIP
Requires tmux when a Hyvä theme is detected. Run magebox bootstrap to install it.
Log Commands
magebox logs
View Magento logs in split-screen using multitail.
magebox logsOpens system.log and exception.log side-by-side:
- Left column:
var/log/system.log - Right column:
var/log/exception.log
Keyboard controls:
q- Quitb- Scroll back in history↑/↓- Scroll in current window
TIP
Requires multitail. Run magebox bootstrap to install it.
magebox logs php
View PHP-FPM error logs for the current project.
magebox logs php # View in multitail or tail
magebox logs php -f # Follow mode (tail -f)
magebox logs php -n 50 # Show last 50 linesFinds log files matching the project name in ~/.magebox/logs/php-fpm/. Uses multitail when available, falls back to tail.
magebox logs nginx
View Nginx access and error logs for the current project.
magebox logs nginx # View in multitail split-screen
magebox logs nginx -f # Follow modeShows per-domain access and error logs from ~/.magebox/logs/nginx/. With multiple domains, multitail displays them in a split-screen layout.
magebox logs mysql
Stream MySQL/MariaDB Docker container logs.
magebox logs mysql # Stream logs (Ctrl+C to stop)
magebox logs mysql -n 200 # Show last 200 linesAuto-detects whether the project uses MySQL or MariaDB.
magebox logs redis
Stream Redis (or Valkey) Docker container logs.
magebox logs redis # Stream logs (Ctrl+C to stop)
magebox logs redis -n 200 # Show last 200 linesRequires Redis or Valkey to be configured in .magebox.yaml.
magebox logs varnish
Stream Varnish logs from the container.
magebox logs varnish # Stream varnishlog output (Ctrl+C to stop)Equivalent to magebox varnish logs.
Varnish Commands
magebox varnish status
Show Varnish cache statistics.
magebox varnish statusmagebox varnish purge [url]
Purge specific URL from cache.
magebox varnish purge /category/page.htmlmagebox varnish flush
Clear all Varnish cache.
magebox varnish flushmagebox varnish enable
Enable Varnish for the current project.
magebox varnish enableThis command:
- Updates
.magebox.yamlto enable Varnish - Regenerates Nginx vhost to proxy through Varnish
- Starts the Varnish Docker container
- Reloads Nginx
magebox varnish disable
Disable Varnish for the current project.
magebox varnish disableRestores direct Nginx → PHP-FPM routing.
magebox varnish vcl-import <file>
Import a custom VCL file.
magebox varnish vcl-import /path/to/custom.vclReplaces the auto-generated VCL with your custom file. The existing VCL is backed up as default.vcl.bak. Varnish is reloaded automatically if running.
magebox varnish vcl-reset
Reset VCL to the auto-generated default.
magebox varnish vcl-resetRegenerates the default VCL from project configuration, removing any custom VCL. Varnish is reloaded automatically if running.
magebox varnish logs
Stream Varnish logs.
magebox varnish logsStreams varnishlog output from the Varnish container. Press Ctrl+C to stop.
Also available as magebox logs varnish.
magebox varnish hist
Show a live histogram of request processing times.
magebox varnish histRuns varnishhist inside the Varnish container. Press Ctrl+C to stop.
Also available as magebox varnish history.
magebox varnish admin [command]
Run varnishadm commands.
magebox varnish admin # Interactive session
magebox varnish admin backend.list # List backends
magebox varnish admin vcl.list # List loaded VCLs
magebox varnish admin param.show # Show parameters
magebox varnish admin ban req.url ~ / # Ban all URLsWithout arguments, opens an interactive varnishadm session. With arguments, runs the command and exits.
Elasticvue Commands
magebox elasticvue enable
Enable the Elasticvue web UI for OpenSearch/Elasticsearch.
magebox elasticvue enableStarts the Elasticvue container on port 8090. Access at http://localhost:8090.
This command is idempotent and self-healing: if Elasticvue is already enabled but its container is stopped (for example after a Docker or machine restart), it starts the container again instead of doing nothing.
magebox elasticvue disable
Disable Elasticvue.
magebox elasticvue disableStops the Elasticvue container and removes it from docker-compose.
magebox elasticvue status
Show Elasticvue status.
magebox elasticvue statusShows whether Elasticvue is enabled, running, and the web UI URL. When enabled but stopped, it points you to magebox elasticvue open, which starts it for you.
magebox elasticvue open
Open Elasticvue in the default browser.
magebox elasticvue openRequires Elasticvue to be enabled (otherwise it tells you to run magebox elasticvue enable). If it is enabled but the container is stopped, it starts the container first and then opens the browser. Returns a clear message if Docker itself is not running.
Mailpit Commands
magebox mailpit open
Open the Mailpit email testing UI in the default browser.
magebox mailpit openReads the actual port from the running container via docker port. Falls back to port 8025 if the container is not running. If the Mailpit container is stopped, it is started automatically before the browser opens (Mailpit is always enabled). Returns a clear message if Docker itself is not running.
magebox mailpit status
Show Mailpit status and connection details.
magebox mailpit statusDisplays whether Mailpit is running, the web UI URL, and the SMTP address (localhost:1025). Mailpit is always enabled and starts automatically with global services.
TIP
See Mailpit for configuration and usage details.
phpMyAdmin Commands
magebox phpmyadmin enable
Enable the phpMyAdmin web UI.
magebox phpmyadmin enableSets phpmyadmin: true in the global config, starts the container, and prints the URL (default port 8036). Every MySQL and MariaDB container is listed as a server, and arbitrary server mode stays on to connect to anything else by name (e.g. magebox-mysql-8.0).
This command is idempotent and self-healing: if phpMyAdmin is already enabled but its container is stopped (for example after a Docker or machine restart), it starts the container again instead of doing nothing.
magebox phpmyadmin disable
Disable phpMyAdmin.
magebox phpmyadmin disableStops and removes the container, sets phpmyadmin: false in global config.
magebox phpmyadmin status
Show phpMyAdmin status.
magebox phpmyadmin statusShows whether phpMyAdmin is enabled, running, and the web UI URL. When enabled but stopped, it points you to magebox phpmyadmin open, which starts it for you.
magebox phpmyadmin open
Open phpMyAdmin in the default browser.
magebox phpmyadmin openRequires phpMyAdmin to be enabled (otherwise it tells you to run magebox phpmyadmin enable). If it is enabled but the container is stopped, it starts the container first and then opens the browser. Returns a clear message if Docker itself is not running.
Run inside a project, it opens that project's database on the server that matches the project's MySQL or MariaDB version. If the phpMyAdmin container does not know that database server yet, for example because it was created before the project was started, it is recreated first. Outside a project it opens the start page.
Expose Commands
magebox expose [domain]
Expose your local project via a public Cloudflare Tunnel URL.
magebox expose # Expose first configured domain
magebox expose store.mystore.test # Expose a specific domainCreates a temporary *.trycloudflare.com URL that forwards traffic to your local project. No Cloudflare account required.
This command:
- Backs up current base URLs from
core_config_dataandenv.php - Starts a Cloudflare quick tunnel
- Adds the tunnel hostname to
.magebox.yamland regenerates nginx vhosts - Updates all Magento base URLs (base, media, static) across all scopes in the database and
env.php - Runs
app:config:importand flushes cache - On Ctrl+C: reverts everything (database,
env.php,.magebox.yaml, nginx)
Arguments:
domain- Specific domain to expose (optional, defaults to first domain)
Requirements:
cloudflaredmust be installed (brew install cloudflared)
See the Expose / Share guide for details.
magebox expose stop
Stop the running tunnel and revert all changes.
magebox expose stopReverts Magento base URLs in both the database and env.php, removes the tunnel domain from .magebox.yaml, regenerates nginx vhosts, and flushes cache.
magebox expose status
Show tunnel status and public URL.
magebox expose statusDocker Commands (macOS)
Commands for managing Docker providers on macOS. On Linux, the default Docker installation is used.
magebox docker
Show Docker provider status.
magebox dockerDisplays:
- Current active Docker provider
- Docker socket path
- Available providers (Docker Desktop, Colima, OrbStack, etc.)
- Running status for each provider
magebox docker use <provider>
Switch to a different Docker provider.
magebox docker use colima
magebox docker use orbstack
magebox docker use desktopArguments:
provider- Docker provider to use
Available providers:
desktop- Docker Desktopcolima- Colimaorbstack- OrbStackrancher- Rancher Desktoplima- Lima
After switching, you'll need to set DOCKER_HOST in your shell profile.
TIP
OrbStack and Colima are lightweight alternatives to Docker Desktop with better performance on Apple Silicon.
Global Commands
magebox bootstrap
First-time environment setup.
magebox bootstrapPerforms:
- Dependency checking (Docker, Nginx, mkcert, mysql-client)
- Global configuration creation
- SSL CA setup
- Nginx configuration
- Docker service startup
- DNS configuration
magebox global start
Start global services.
magebox global startStarts Nginx and Docker services.
On macOS it also loads the port forwarding LaunchDaemon again, so ports 80 and 443 are forwarded to Nginx (8080/8443) after a previous magebox global stop. Loading the daemon requires sudo, so you may be prompted for your password.
magebox global stop
Stop all MageBox services.
magebox global stopStops all Docker containers and Nginx.
On macOS it additionally unloads the port forwarding LaunchDaemon (com.magebox.portforward), releasing ports 80 and 443 so other local tools can bind them. The daemon itself stays installed — magebox global start (or a reboot) brings forwarding back without running magebox bootstrap again. Unloading requires sudo, so you may be prompted for your password. If another local service has already taken port 80 by the time the daemon is gone, that is reported as success: the ports were handed back.
magebox global status
Show all projects and services.
magebox global statusOn macOS the output includes a Port forwarding row, showing whether ports 80 and 443 are currently being forwarded to Nginx.
magebox list
List all discovered projects.
magebox listShows projects found from Nginx vhost configurations.
magebox uninstall
Clean uninstall of MageBox components.
magebox uninstall # Interactive uninstall
magebox uninstall --force # Skip confirmation
magebox uninstall --dry-run # Preview what would happen
magebox uninstall --keep-vhosts # Keep nginx configurationsThis command:
- Stops all running MageBox projects
- Removes CLI wrappers (php, composer, blackfire) from
~/.magebox/bin/ - Removes nginx vhost configurations
- Cleans up MageBox configuration
Options:
--force- Skip confirmation prompt--dry-run- Preview what would be removed without making changes--keep-vhosts- Preserve nginx vhost configurations--purge-packages- Also remove system packages (PHP, nginx, dnsmasq) installed by MageBox
WARNING
This does not uninstall MageBox itself (the binary), only the components it manages.
SSL Commands
magebox ssl trust
Trust the local certificate authority.
magebox ssl trustInstalls mkcert CA in system trust store.
magebox ssl generate
Regenerate SSL certificates.
magebox ssl generateGenerates certificates for all configured domains.
DNS Commands
magebox dns setup
Configure DNS resolution.
magebox dns setupSets up hosts file or dnsmasq based on configuration.
magebox dns status
Show DNS configuration.
magebox dns statusDomain Commands
magebox domain add <host>
Add a domain to the project.
magebox domain add store.test
magebox domain add de.store.test --store-code=german
magebox domain add fr.store.test --store-code=french --store-type=website
magebox domain add api.store.test --root=pub --ssl=falseOptions:
--store-code- Magento store or website code (setsMAGE_RUN_CODEfor this host)--store-type- What the code refers to:store(default) orwebsite(setsMAGE_RUN_TYPE)--root- Document root relative to project (default:pub)--ssl- Enable SSL for the domain (default:true)
Automatically generates SSL certificate, creates nginx vhost, and reloads nginx.
magebox domain remove <host>
Remove a domain from the project.
magebox domain remove old.store.testRemoves the nginx vhost and updates configuration.
magebox domain list
List all configured domains.
magebox domain listShows URL, root, store code, and SSL status for each domain.
Configuration Commands
magebox config --json
Print the current project's merged configuration and derived values as JSON:
magebox config --json | jq '.derived.database'config contains the merged project configuration, including local overrides and included files, using the project configuration's field names. It may contain sensitive values such as environment variables; treat the output as you would the configuration files.
derived contains database_name, database, cache, search, and domains. Each enabled service endpoint has service, host, port, and, when configured, version; absent services are null. Domains include the resolved root, ssl, store_code, and store_type. The database, cache, and search selections follow MageBox's usual service precedence. Ports are the host ports used by MageBox's shared services, not a check that a service is running. A custom Compose file or an already configured Magento installation may use different endpoints.
The command reads the current directory and exits with an error if its project configuration cannot be loaded. It writes JSON only to standard output.
magebox config show
Display global configuration.
magebox config showmagebox config init
Initialize configuration with defaults.
magebox config initCreates ~/.magebox/config.yaml.
magebox config set <key> <value>
Set configuration value.
magebox config set dns_mode dnsmasq
magebox config set default_php 8.3
magebox config set tld local
magebox config set portainer true
magebox config set elasticvue trueAvailable keys:
dns_mode- DNS resolution mode (hosts/dnsmasq)default_php- Default PHP versiontld- Top-level domain (default: test)portainer- Enable Portainer UI (true/false)elasticvue- Enable Elasticvue search UI (true/false)editor- Preferred editorauto_start- Auto-start services (true/false)
Library Commands
Commands for managing the MageBox configuration library.
magebox lib status
Show library status.
magebox lib statusDisplays:
- Current library version
- Git branch and commit
- Local modifications
- Available updates
- Custom path (if configured)
magebox lib update
Update the configuration library.
magebox lib updatePulls the latest configuration files from the magebox-lib repository.
magebox lib path
Show library path.
magebox lib pathDisplays the filesystem path to the configuration library.
magebox lib list
List available installers.
magebox lib listShows all available platform installer configurations.
magebox lib templates
List available templates.
magebox lib templatesLists all configuration templates organized by category (nginx, php, varnish, etc.).
magebox lib show [platform]
Show installer configuration details.
magebox lib show # Auto-detect platform
magebox lib show fedora # Show specific platformDisplays the installer configuration with variable expansion.
magebox lib set <path>
Set a custom library path.
magebox lib set ~/my-magebox-configs
magebox lib set /path/to/custom/libUse your own templates and installer configurations. The path should contain:
templates/- Template files organized by categoryinstallers/- Platform-specific YAML configuration files
magebox lib unset
Remove custom library path.
magebox lib unsetReverts to using the default ~/.magebox/yaml directory.
magebox lib reset
Reset library to upstream.
magebox lib resetDiscards all local changes and resets to the upstream version.
TIP
See the Configuration Library guide for detailed information about customizing templates and installers.
Update Commands
magebox self-update
Update MageBox to latest version.
magebox self-updateDownloads and installs the latest release from GitHub.
magebox self-update check
Check for updates.
magebox self-update checkShows available updates without installing.
Xdebug Commands
magebox xdebug on
Enable Xdebug for the project's PHP version.
magebox xdebug onmagebox xdebug off
Disable Xdebug.
magebox xdebug offmagebox xdebug status
Show Xdebug installation and configuration status.
magebox xdebug statusBlackfire Commands
magebox blackfire on
Enable Blackfire profiler.
magebox blackfire onmagebox blackfire off
Disable Blackfire profiler.
magebox blackfire offmagebox blackfire status
Show Blackfire status.
magebox blackfire statusmagebox blackfire install
Install Blackfire agent and PHP extension.
magebox blackfire installmagebox blackfire config
Configure Blackfire credentials.
# Interactive mode
magebox blackfire config
# Non-interactive with flags
magebox blackfire config \
--server-id=your-server-id \
--server-token=your-server-token \
--client-id=your-client-id \
--client-token=your-client-tokenOptions:
--server-id- Blackfire Server ID--server-token- Blackfire Server Token--client-id- Blackfire Client ID--client-token- Blackfire Client Token
Get credentials from your Blackfire account. When flags are omitted, prompts interactively.
Tideways Commands
magebox tideways on
Enable Tideways profiler.
magebox tideways onmagebox tideways off
Disable Tideways profiler.
magebox tideways offmagebox tideways status
Show Tideways status.
magebox tideways statusmagebox tideways install
Install Tideways daemon and PHP extension.
magebox tideways installmagebox tideways config
Configure Tideways credentials. The API key is per-project (stored in .magebox.local.yaml); the access token and environment label are global (stored in ~/.magebox/config.yaml).
# Interactive mode — prompts for global settings, plus the project API key
# when run from inside a project that doesn't have one set yet.
magebox tideways config
# Non-interactive: global access token and environment label
magebox tideways config --access-token=your-cli-token --environment=local_alice
# Non-interactive: per-project API key (must be run from inside a project)
magebox tideways config --project-api-key=your-project-keyOptions:
--access-token- Tideways CLI access token (global,tidewayscommand)--environment- Tideways environment label (global, defaults tolocal_<username>)--project-api-key- Tideways API key for the current project (written to.magebox.local.yaml)
The per-project API key is found on each project's Installation page in the Tideways dashboard. The access token is generated at app.tideways.io/user/cli-import-settings. See Tideways for details.
STOP Protocol Commands
STOP (Static Precompilation & OPcache Protocol) enables OPcache and configures app/preload.php as the preload script for the current project. See the STOP guide for the full picture.
magebox stop-protocol enable
Enable STOP for the current project.
magebox stop-protocol enableWrites the following keys to .magebox.local.yaml under php_ini and restarts PHP-FPM:
opcache.enable = 1opcache.preload = <project>/app/preload.phpopcache.preload_user = <current OS user>opcache.memory_consumption = 512opcache.jit = tracingopcache.jit_buffer_size = 100M
A full PHP-FPM restart (not a reload) is performed, because opcache.preload is only evaluated at master start. If app/preload.php is missing, the command warns and continues — OPcache will skip preloading until the file exists.
magebox stop-protocol disable
Disable STOP.
magebox stop-protocol disableSets opcache.enable = 0 in .magebox.local.yaml, removes the other STOP-managed keys, and restarts PHP-FPM.
magebox stop-protocol status
Show whether STOP is currently active.
magebox stop-protocol statusReports the merged opcache.enable, opcache.preload, and opcache.preload_user values, and warns if the preload script doesn't exist on disk. Running magebox stop-protocol with no subcommand is equivalent to status.
Team Commands
magebox team list
List all configured teams.
magebox team listmagebox team add <name>
Add a new team configuration.
# Interactive mode
magebox team add myteam
# Non-interactive with flags
magebox team add myteam \
--provider github \
--org myorganization \
--auth ssh
# Self-hosted GitLab
magebox team add myteam \
--provider gitlab \
--org mygroup \
--url https://gitlab.mycompany.com \
--auth ssh
# Self-hosted Bitbucket Server
magebox team add myteam \
--provider bitbucket \
--org MYPROJECT \
--url https://bitbucket.mycompany.com \
--auth ssh
# With asset storage
magebox team add myteam \
--provider github \
--org myorg \
--auth https \
--asset-provider sftp \
--asset-host backup.example.com \
--asset-port 22 \
--asset-path /backups \
--asset-username deployOptions:
--provider- Repository provider (github/gitlab/bitbucket)--org- Organization/namespace name--url- Custom URL for self-hosted instances (GitLab CE/EE, Bitbucket Server)--auth- Authentication method (https/ssh, default: https)--asset-provider- Asset storage provider (sftp/ftp)--asset-host- Asset storage hostname--asset-port- Asset storage port--asset-path- Base path on asset storage--asset-username- Asset storage username
When flags are omitted, an interactive wizard prompts for the values.
TIP
Use --auth=https for public repositories (no SSH key needed). Use --auth=ssh for private repositories.
magebox team remove <name>
Remove a team configuration.
magebox team remove myteammagebox team <name> show
Show team configuration details.
magebox team myteam showmagebox team <name> repos
Browse repositories in the team's namespace.
magebox team myteam repos
magebox team myteam repos --filter "magento*"Options:
--filter- Glob pattern to filter repositories
magebox team <name> project list
List all projects in a team.
magebox team myteam project listmagebox team <name> project add <project>
Add a project to a team.
magebox team myteam project add shop \
--repo myorg/shop \
--branch main \
--db shop/latest.sql.gz \
--media shop/media.tar.gzOptions:
--repo- Repository path (org/repo)--branch- Default branch (default: main)--db- Path to database dump on asset storage--media- Path to media archive on asset storage
magebox team <name> project remove <project>
Remove a project from a team.
magebox team myteam project remove shopmagebox clone <project>
Clone a team project repository.
magebox clone myteam/myproject
magebox clone myproject # If only one teamOptions:
--branch- Specific branch to checkout--fetch- Also fetch database and media after cloning--to- Custom destination directory--dry-run- Show what would happen
What it does:
- Clones the repository from the configured provider
- Creates
.magebox.yamlif not present - Runs
composer install
magebox fetch
Download database and media from team asset storage for the current project.
cd myproject
magebox fetch # Download & import database
magebox fetch --media # Also download & extract mediaOptions:
--media- Also download and extract media files--backup- Backup current database before importing--team- Specify team explicitly (if project in multiple teams)--dry-run- Show what would happen
TIP
Run from within a project directory. Reads project name from .magebox.yaml and searches team asset storage for matching files.
magebox sync
Sync database and media for existing project with progress tracking.
magebox sync
magebox sync --db
magebox sync --mediaOptions:
--db- Only sync database--media- Only sync media--backup- Backup current database before import--dry-run- Show what would happen
Features:
- Progress bar for database import (see
db import) - Progress bar for media extraction showing percentage, speed, and ETA
TIP
Run from within a project directory. Auto-detects team from git remote.
Server Commands
Commands for managing the MageBox team server process on the machine where it is hosted. These are server-side commands, not client commands.
magebox server init
Initialize the team server configuration.
magebox server initGenerates the master key, admin token, SSH CA key pair, and initial configuration. Run this once on the machine that will host the team server.
magebox server start
Start the team server.
magebox server startmagebox server stop
Stop the team server.
magebox server stopmagebox server status
Check team server status.
magebox server statusTIP
See the Team Server guide for full setup and administration details.
Environment Commands
Manage remote SSH environments. Environments are stored globally and can be used to quickly SSH into remote servers.
magebox env
List all configured remote environments.
magebox envmagebox env add <name>
Add a new remote environment.
magebox env add staging --user deploy --host staging.example.com
magebox env add production --user deploy --host prod.example.com --port 2222
magebox env add cloud --user magento --host 10.0.0.1 --key ~/.ssh/cloud_key
magebox env add tunnel --ssh-command "ssh -J [email protected] [email protected]"Options:
--user,-u- SSH username (required for standard connections)--host,-H- SSH host or IP (required for standard connections)--port,-p- SSH port (default: 22)--key,-k- Path to SSH private key--ssh-command- Full custom SSH command (for jump hosts/tunnels, overrides user/host/port)
magebox env remove <name>
Remove a remote environment. Aliases: rm, delete.
magebox env remove stagingmagebox env ssh <name>
SSH into a configured remote environment.
magebox env ssh staging
magebox env ssh productionmagebox env show <name>
Show connection details for an environment.
magebox env show stagingmagebox env sync
Sync the list of accessible environments from the team server.
magebox env syncFetches environments you have access to from the connected team server and updates the local cache. Run this after your access has been updated on the server.
SSH Commands
magebox ssh <environment>
SSH into a team server environment using your SSH certificate.
magebox ssh myproject/staging
magebox ssh myproject/productionEnvironments are in the format project/environment. Uses the SSH key generated when joining the team server. If a certificate is configured, it is used automatically. Warns if the certificate is expired or missing.
# Renew certificate if prompted
magebox cert renewCertificate Commands
Commands for managing SSH certificates issued by the team server CA.
magebox cert renew
Renew your SSH certificate from the team server.
magebox cert renew
magebox cert renew --quiet # Suppress output (for cron/scripts)Certificates are valid for 24 hours. The renewed certificate is saved to ~/.magebox/keys/<server>-cert.pub.
Options:
--quiet- Suppress output
magebox cert show
Show information about your current SSH certificate.
magebox cert showDisplays the certificate file path, size, modification time, and type. Run ssh-keygen -L -f <cert-file> for full certificate details.
magebox cert expiry
Check when your SSH certificate expires.
magebox cert expiryShows whether the certificate is valid, when it expires, and how much time remains.
Test Commands
Commands for running tests and code quality checks.
magebox test setup
Interactive wizard to install testing tools.
magebox test setupInstalls PHPUnit, PHPStan, PHPCS, and PHPMD based on your selections.
magebox test unit
Run PHPUnit unit tests.
magebox test unit
magebox test unit --filter=ProductTest
magebox test unit --testsuite=unitOptions:
--filter- Filter tests by name--testsuite- Run specific test suite
magebox test integration
Run Magento integration tests with optional RAM-based MySQL.
magebox test integration
magebox test integration --tmpfs # Use RAM-based MySQL (10-100x faster)
magebox test integration --tmpfs --tmpfs-size=2g
magebox test integration --tmpfs --keep-alive # Keep container for repeated runsOptions:
--tmpfs- Use RAM-based MySQL container--tmpfs-size- RAM allocation (default: 1g)--mysql-version- MySQL version (default: 8.0)--keep-alive- Keep container running after tests
magebox test phpstan
Run PHPStan static analysis.
magebox test phpstan
magebox test phpstan --level=5Options:
--level- Analysis level 0-9 (default from config or 1)
magebox test phpcs
Run PHP_CodeSniffer.
magebox test phpcs
magebox test phpcs --standard=PSR12Options:
--standard- Coding standard (Magento2/PSR12)
magebox test phpmd
Run PHP Mess Detector.
magebox test phpmd
magebox test phpmd --ruleset=cleancode,designOptions:
--ruleset- Rulesets to apply (comma-separated)
magebox test all
Run all tests except integration.
magebox test allRuns unit tests, PHPStan, PHPCS, and PHPMD in sequence. Ideal for CI/CD pipelines.
magebox test status
Show installed testing tools and their configuration.
magebox test statusTIP
See the Testing & Code Quality guide for detailed configuration options.
Sandbox Commands
magebox sandbox [tool] [-- tool-args...]
Run an AI coding agent inside a bubblewrap (bwrap) sandbox with restricted filesystem access.
magebox sandbox # Launch claude (default)
magebox sandbox claude # Explicit tool selection
magebox sandbox codex # Launch codex in sandbox
magebox sandbox claude --resume # Pass extra args to the tool
magebox sandbox --dry-run # Print the bwrap command without running itAliases: sb
The sandbox restricts filesystem access to:
- Read-only: system binaries, libraries, and SSL certificates
- Read-write: current project directory and tool config directories
Linux Only
Requires bubblewrap to be installed. This command is not available on macOS.
Flags:
--dry-run- Print the bwrap command without executing it
Configuration (in .magebox.yaml or global config):
sandbox:
default_tool: claude
extra_ro_binds:
- /opt/shared/config
extra_binds:
- /path/to/extra/data
tool_profiles:
claude:
command: claude
args: []
config_dirs:
- ~/.claudeService Commands
Commands for managing the MageBox autostart service, which starts global Docker services and all projects automatically at login.
magebox service install
Install the MageBox autostart service.
magebox service installOn macOS: installs a LaunchAgent (~/Library/LaunchAgents/com.qoliber.magebox.plist) that runs magebox global start at login.
On Linux: installs a systemd user service (~/.config/systemd/user/magebox.service) and enables it with systemctl --user enable.
After installation, all global services and running projects start automatically when you log in — no manual magebox global start needed.
magebox service uninstall
Remove the MageBox autostart service.
magebox service uninstallUnloads and removes the LaunchAgent (macOS) or disables and removes the systemd unit (Linux).
magebox service status
Show whether the autostart service is installed and active.
magebox service statusUtility Commands
magebox check
Check project health and dependencies.
magebox checkVerifies:
- PHP version and extensions
- Required services (MySQL, Redis, etc.)
- SSL certificates
- Nginx vhost configuration
- File permissions
- magerun2 wrapper and mysql-client availability
magebox install
Check and install dependencies.
magebox installVerifies required software and provides installation guidance.
magebox --version
Show MageBox version.
magebox --versionmagebox --help
Show help information.
magebox --help
magebox start --help