Skip to content

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.

bash
magebox -v start      # Basic - shows commands being run
magebox -vv start     # Detailed - shows command output
magebox -vvv start    # Debug - full debug info

Verbosity 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.

bash
magebox init mystore

Creates 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.

bash
magebox start
magebox start --all    # Start all discovered projects

This command:

  1. Generates PHP-FPM pool configuration
  2. Generates Nginx vhost configuration
  3. Starts required Docker services
  4. Updates DNS (if hosts mode)
  5. Generates SSL certificates (if needed)
  6. Reloads Nginx
  7. Prompts to start custom Docker containers (if compose_file is configured)

Options:

  • --all - Start all discovered MageBox projects at once

magebox stop ​

Stop the project environment.

bash
magebox stop
magebox stop --all      # Stop all running projects
magebox stop --dry-run  # Preview what would happen

Stops 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.

bash
magebox restart
magebox restart --all   # Restart all projects

Equivalent to stop followed by start.

Options:

  • --all - Restart all MageBox projects at once

magebox status ​

Show project status.

bash
magebox status

Displays:

  • PHP version and pool status
  • Nginx vhost status
  • Service connectivity
  • Domain information

magebox new [directory] ​

Create a new Magento/MageOS installation.

bash
magebox new mystore
magebox new mystore --quick
magebox new mystore --quick --hyva

Interactive 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.

bash
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>:

bash
magebox open b2b-case

MageBox 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 project name — e.g. mystore becomes mystore.b2b-case, so the worktree runs as a separate MageBox project.
  • .<worktree> is inserted before the TLD of every domain host — e.g. mystore.localhost becomes mystore.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.

bash
# Show current version
magebox php

# Switch to PHP 8.3
magebox php 8.3

Switching 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.

bash
magebox shell

Opens 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.

bash
magebox php ini set memory_limit 512M
magebox php ini set max_execution_time 300
magebox php ini set display_errors On

Settings 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.

bash
magebox php ini get memory_limit

Shows the effective value from pool configuration.


magebox php ini list ​

List all PHP INI settings for the project.

bash
magebox php ini list

Shows both default values and custom overrides.


magebox php ini unset <key> ​

Remove a custom PHP INI override.

bash
magebox php ini unset memory_limit

Reverts the setting to its default value.


magebox php opcache status ​

Show OPcache status for the project.

bash
magebox php opcache status

Displays current OPcache configuration (enabled/disabled).


magebox php opcache enable ​

Enable OPcache for the project.

bash
magebox php opcache enable

Sets opcache.enable=1 in the project's PHP configuration.


magebox php opcache disable ​

Disable OPcache for the project.

bash
magebox php opcache disable

Sets opcache.enable=0 - useful during development for immediate code changes.


magebox php opcache clear ​

Clear OPcache by reloading PHP-FPM.

bash
magebox php opcache clear

Forces PHP-FPM to reload, clearing the OPcache.


magebox php system ​

View PHP system-level settings (PHP_INI_SYSTEM) and their activation status.

bash
magebox php system

Shows 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.

bash
magebox php system enable

Creates 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.

bash
magebox php system disable

magebox php system list ​

List all PHP_INI_SYSTEM setting names.

bash
magebox php system list

Shows 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.

bash
# 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.php

Options:

  • --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.

bash
magebox php isolate status

Displays:

  • 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.

bash
magebox php isolate disable

magebox php isolate list ​

List all projects with isolated PHP-FPM masters.

bash
magebox php isolate list

magebox php isolate restart ​

Restart the isolated PHP-FPM master for the current project.

bash
magebox php isolate restart

When 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:

bash
# Using the shell (recommended)
magebox shell
php bin/magento cache:flush

# Or directly with the wrapper
~/.magebox/bin/php bin/magento cache:flush

The 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.

bash
magebox ext list

magebox ext install <extension> [extension...] ​

Install one or more PHP extensions.

bash
# 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-spx

Prompts 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.

bash
magebox ext remove redis
magebox ext remove noisebynorthwest/php-spx

Prompts to select which PHP version(s) to remove from.


magebox ext search <query> ​

Search for available PHP extension packages.

bash
magebox ext search redis
magebox ext search mongo

Shows 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.

bash
magebox ext pie

PIE 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.

bash
magebox run deploy
magebox run reindex
magebox run          # Interactive selector when no name given

Runs commands defined in .magebox.yaml:

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.

bash
magerun2 cache:flush
magerun2 setup:upgrade
magerun2 sys:info

Any command not recognized by MageBox is also automatically forwarded to magerun2:

bash
magebox cache:flush          # → magerun2 cache:flush
magebox setup:upgrade        # → magerun2 setup:upgrade
magebox sys:info             # → magerun2 sys:info

MageBox 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 versionn98-magerun2
2.4.0 – 2.4.47.5.0
2.4.5 and upLatest

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.

bash
magebox db shell

Connects to the project's database with correct credentials.


magebox db import [file] ​

Import SQL dump with progress tracking.

bash
magebox db import dump.sql
magebox db import dump.sql.gz

Arguments:

  • 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.gz files

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: 6s

magebox db export [file] ​

Export database.

bash
magebox db export backup.sql
magebox db export backup.sql.gz
magebox db export - > backup.sql

Arguments:

  • file - Output file (use - for stdout)

magebox db create ​

Create the project database.

bash
magebox db create

Creates the database defined in .magebox.yaml if it doesn't exist.


magebox db drop ​

Drop the project database.

bash
magebox db drop

DANGER

This permanently deletes all data. Requires confirmation.


magebox db reset ​

Drop and recreate the project database.

bash
magebox db reset

Equivalent to db drop followed by db create. Requires confirmation.


magebox db top ​

Monitor database processes in real time.

bash
magebox db top

Uses 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.

bash
magebox db snapshot create              # Auto-named with timestamp
magebox db snapshot create mybackup     # Named snapshot

Arguments:

  • 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.

bash
magebox db snapshot restore mybackup

Arguments:

  • 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.

bash
magebox db snapshot list

Shows snapshot name, size, and creation date.


magebox db snapshot delete <name> ​

Delete a snapshot.

bash
magebox db snapshot delete mybackup

Arguments:

  • name - Snapshot name to delete (required)

Purge Command ​

magebox purge ​

Remove all generated files, caches, and preprocessed views.

bash
magebox purge

Clears:

  • generated/metadata/* and generated/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.

bash
magebox redis shell

magebox redis flush ​

Clear all Redis/Valkey data.

bash
magebox redis flush

magebox redis info ​

Show Redis/Valkey statistics.

bash
magebox redis info

Watch Command ​

magebox watch ​

Watch for file changes and selectively clear affected Magento cache types.

bash
magebox watch

Runs 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.

bash
magebox logs

Opens system.log and exception.log side-by-side:

  • Left column: var/log/system.log
  • Right column: var/log/exception.log

Keyboard controls:

  • q - Quit
  • b - 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.

bash
magebox logs php        # View in multitail or tail
magebox logs php -f     # Follow mode (tail -f)
magebox logs php -n 50  # Show last 50 lines

Finds 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.

bash
magebox logs nginx        # View in multitail split-screen
magebox logs nginx -f     # Follow mode

Shows 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.

bash
magebox logs mysql          # Stream logs (Ctrl+C to stop)
magebox logs mysql -n 200   # Show last 200 lines

Auto-detects whether the project uses MySQL or MariaDB.


magebox logs redis ​

Stream Redis (or Valkey) Docker container logs.

bash
magebox logs redis          # Stream logs (Ctrl+C to stop)
magebox logs redis -n 200   # Show last 200 lines

Requires Redis or Valkey to be configured in .magebox.yaml.


magebox logs varnish ​

Stream Varnish logs from the container.

bash
magebox logs varnish    # Stream varnishlog output (Ctrl+C to stop)

Equivalent to magebox varnish logs.


Varnish Commands ​

magebox varnish status ​

Show Varnish cache statistics.

bash
magebox varnish status

magebox varnish purge [url] ​

Purge specific URL from cache.

bash
magebox varnish purge /category/page.html

magebox varnish flush ​

Clear all Varnish cache.

bash
magebox varnish flush

magebox varnish enable ​

Enable Varnish for the current project.

bash
magebox varnish enable

This command:

  1. Updates .magebox.yaml to enable Varnish
  2. Regenerates Nginx vhost to proxy through Varnish
  3. Starts the Varnish Docker container
  4. Reloads Nginx

magebox varnish disable ​

Disable Varnish for the current project.

bash
magebox varnish disable

Restores direct Nginx → PHP-FPM routing.


magebox varnish vcl-import <file> ​

Import a custom VCL file.

bash
magebox varnish vcl-import /path/to/custom.vcl

Replaces 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.

bash
magebox varnish vcl-reset

Regenerates the default VCL from project configuration, removing any custom VCL. Varnish is reloaded automatically if running.


magebox varnish logs ​

Stream Varnish logs.

bash
magebox varnish logs

Streams 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.

bash
magebox varnish hist

Runs varnishhist inside the Varnish container. Press Ctrl+C to stop.

Also available as magebox varnish history.


magebox varnish admin [command] ​

Run varnishadm commands.

bash
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 URLs

Without 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.

bash
magebox elasticvue enable

Starts 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.

bash
magebox elasticvue disable

Stops the Elasticvue container and removes it from docker-compose.


magebox elasticvue status ​

Show Elasticvue status.

bash
magebox elasticvue status

Shows 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.

bash
magebox elasticvue open

Requires 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.

bash
magebox mailpit open

Reads 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.

bash
magebox mailpit status

Displays 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.

bash
magebox phpmyadmin enable

Sets 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.

bash
magebox phpmyadmin disable

Stops and removes the container, sets phpmyadmin: false in global config.


magebox phpmyadmin status ​

Show phpMyAdmin status.

bash
magebox phpmyadmin status

Shows 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.

bash
magebox phpmyadmin open

Requires 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.

bash
magebox expose                    # Expose first configured domain
magebox expose store.mystore.test # Expose a specific domain

Creates a temporary *.trycloudflare.com URL that forwards traffic to your local project. No Cloudflare account required.

This command:

  1. Backs up current base URLs from core_config_data and env.php
  2. Starts a Cloudflare quick tunnel
  3. Adds the tunnel hostname to .magebox.yaml and regenerates nginx vhosts
  4. Updates all Magento base URLs (base, media, static) across all scopes in the database and env.php
  5. Runs app:config:import and flushes cache
  6. On Ctrl+C: reverts everything (database, env.php, .magebox.yaml, nginx)

Arguments:

  • domain - Specific domain to expose (optional, defaults to first domain)

Requirements:

  • cloudflared must be installed (brew install cloudflared)

See the Expose / Share guide for details.


magebox expose stop ​

Stop the running tunnel and revert all changes.

bash
magebox expose stop

Reverts 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.

bash
magebox expose status

Docker Commands (macOS) ​

Commands for managing Docker providers on macOS. On Linux, the default Docker installation is used.

magebox docker ​

Show Docker provider status.

bash
magebox docker

Displays:

  • 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.

bash
magebox docker use colima
magebox docker use orbstack
magebox docker use desktop

Arguments:

  • provider - Docker provider to use

Available providers:

  • desktop - Docker Desktop
  • colima - Colima
  • orbstack - OrbStack
  • rancher - Rancher Desktop
  • lima - 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.

bash
magebox bootstrap

Performs:

  • 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.

bash
magebox global start

Starts 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.

bash
magebox global stop

Stops 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.

bash
magebox global status

On 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.

bash
magebox list

Shows projects found from Nginx vhost configurations.


magebox uninstall ​

Clean uninstall of MageBox components.

bash
magebox uninstall                    # Interactive uninstall
magebox uninstall --force            # Skip confirmation
magebox uninstall --dry-run          # Preview what would happen
magebox uninstall --keep-vhosts      # Keep nginx configurations

This command:

  1. Stops all running MageBox projects
  2. Removes CLI wrappers (php, composer, blackfire) from ~/.magebox/bin/
  3. Removes nginx vhost configurations
  4. 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.

bash
magebox ssl trust

Installs mkcert CA in system trust store.


magebox ssl generate ​

Regenerate SSL certificates.

bash
magebox ssl generate

Generates certificates for all configured domains.

DNS Commands ​

magebox dns setup ​

Configure DNS resolution.

bash
magebox dns setup

Sets up hosts file or dnsmasq based on configuration.


magebox dns status ​

Show DNS configuration.

bash
magebox dns status

Domain Commands ​

magebox domain add <host> ​

Add a domain to the project.

bash
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=false

Options:

  • --store-code - Magento store or website code (sets MAGE_RUN_CODE for this host)
  • --store-type - What the code refers to: store (default) or website (sets MAGE_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.

bash
magebox domain remove old.store.test

Removes the nginx vhost and updates configuration.


magebox domain list ​

List all configured domains.

bash
magebox domain list

Shows 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:

bash
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.

bash
magebox config show

magebox config init ​

Initialize configuration with defaults.

bash
magebox config init

Creates ~/.magebox/config.yaml.


magebox config set <key> <value> ​

Set configuration value.

bash
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 true

Available keys:

  • dns_mode - DNS resolution mode (hosts/dnsmasq)
  • default_php - Default PHP version
  • tld - Top-level domain (default: test)
  • portainer - Enable Portainer UI (true/false)
  • elasticvue - Enable Elasticvue search UI (true/false)
  • editor - Preferred editor
  • auto_start - Auto-start services (true/false)

Library Commands ​

Commands for managing the MageBox configuration library.

magebox lib status ​

Show library status.

bash
magebox lib status

Displays:

  • Current library version
  • Git branch and commit
  • Local modifications
  • Available updates
  • Custom path (if configured)

magebox lib update ​

Update the configuration library.

bash
magebox lib update

Pulls the latest configuration files from the magebox-lib repository.


magebox lib path ​

Show library path.

bash
magebox lib path

Displays the filesystem path to the configuration library.


magebox lib list ​

List available installers.

bash
magebox lib list

Shows all available platform installer configurations.


magebox lib templates ​

List available templates.

bash
magebox lib templates

Lists all configuration templates organized by category (nginx, php, varnish, etc.).


magebox lib show [platform] ​

Show installer configuration details.

bash
magebox lib show           # Auto-detect platform
magebox lib show fedora    # Show specific platform

Displays the installer configuration with variable expansion.


magebox lib set <path> ​

Set a custom library path.

bash
magebox lib set ~/my-magebox-configs
magebox lib set /path/to/custom/lib

Use your own templates and installer configurations. The path should contain:

  • templates/ - Template files organized by category
  • installers/ - Platform-specific YAML configuration files

magebox lib unset ​

Remove custom library path.

bash
magebox lib unset

Reverts to using the default ~/.magebox/yaml directory.


magebox lib reset ​

Reset library to upstream.

bash
magebox lib reset

Discards 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.

bash
magebox self-update

Downloads and installs the latest release from GitHub.


magebox self-update check ​

Check for updates.

bash
magebox self-update check

Shows available updates without installing.

Xdebug Commands ​

magebox xdebug on ​

Enable Xdebug for the project's PHP version.

bash
magebox xdebug on

magebox xdebug off ​

Disable Xdebug.

bash
magebox xdebug off

magebox xdebug status ​

Show Xdebug installation and configuration status.

bash
magebox xdebug status

Blackfire Commands ​

magebox blackfire on ​

Enable Blackfire profiler.

bash
magebox blackfire on

magebox blackfire off ​

Disable Blackfire profiler.

bash
magebox blackfire off

magebox blackfire status ​

Show Blackfire status.

bash
magebox blackfire status

magebox blackfire install ​

Install Blackfire agent and PHP extension.

bash
magebox blackfire install

magebox blackfire config ​

Configure Blackfire credentials.

bash
# 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-token

Options:

  • --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.

bash
magebox tideways on

magebox tideways off ​

Disable Tideways profiler.

bash
magebox tideways off

magebox tideways status ​

Show Tideways status.

bash
magebox tideways status

magebox tideways install ​

Install Tideways daemon and PHP extension.

bash
magebox tideways install

magebox 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).

bash
# 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-key

Options:

  • --access-token - Tideways CLI access token (global, tideways command)
  • --environment - Tideways environment label (global, defaults to local_<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.

bash
magebox stop-protocol enable

Writes the following keys to .magebox.local.yaml under php_ini and restarts PHP-FPM:

  • opcache.enable = 1
  • opcache.preload = <project>/app/preload.php
  • opcache.preload_user = <current OS user>
  • opcache.memory_consumption = 512
  • opcache.jit = tracing
  • opcache.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.

bash
magebox stop-protocol disable

Sets 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.

bash
magebox stop-protocol status

Reports 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.

bash
magebox team list

magebox team add <name> ​

Add a new team configuration.

bash
# 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 deploy

Options:

  • --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.

bash
magebox team remove myteam

magebox team <name> show ​

Show team configuration details.

bash
magebox team myteam show

magebox team <name> repos ​

Browse repositories in the team's namespace.

bash
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.

bash
magebox team myteam project list

magebox team <name> project add <project> ​

Add a project to a team.

bash
magebox team myteam project add shop \
  --repo myorg/shop \
  --branch main \
  --db shop/latest.sql.gz \
  --media shop/media.tar.gz

Options:

  • --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.

bash
magebox team myteam project remove shop

magebox clone <project> ​

Clone a team project repository.

bash
magebox clone myteam/myproject
magebox clone myproject              # If only one team

Options:

  • --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:

  1. Clones the repository from the configured provider
  2. Creates .magebox.yaml if not present
  3. Runs composer install

magebox fetch ​

Download database and media from team asset storage for the current project.

bash
cd myproject
magebox fetch                        # Download & import database
magebox fetch --media                # Also download & extract media

Options:

  • --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.

bash
magebox sync
magebox sync --db
magebox sync --media

Options:

  • --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.

bash
magebox server init

Generates 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.

bash
magebox server start

magebox server stop ​

Stop the team server.

bash
magebox server stop

magebox server status ​

Check team server status.

bash
magebox server status

TIP

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.

bash
magebox env

magebox env add <name> ​

Add a new remote environment.

bash
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.

bash
magebox env remove staging

magebox env ssh <name> ​

SSH into a configured remote environment.

bash
magebox env ssh staging
magebox env ssh production

magebox env show <name> ​

Show connection details for an environment.

bash
magebox env show staging

magebox env sync ​

Sync the list of accessible environments from the team server.

bash
magebox env sync

Fetches 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.

bash
magebox ssh myproject/staging
magebox ssh myproject/production

Environments 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.

bash
# Renew certificate if prompted
magebox cert renew

Certificate Commands ​

Commands for managing SSH certificates issued by the team server CA.

magebox cert renew ​

Renew your SSH certificate from the team server.

bash
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.

bash
magebox cert show

Displays 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.

bash
magebox cert expiry

Shows 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.

bash
magebox test setup

Installs PHPUnit, PHPStan, PHPCS, and PHPMD based on your selections.


magebox test unit ​

Run PHPUnit unit tests.

bash
magebox test unit
magebox test unit --filter=ProductTest
magebox test unit --testsuite=unit

Options:

  • --filter - Filter tests by name
  • --testsuite - Run specific test suite

magebox test integration ​

Run Magento integration tests with optional RAM-based MySQL.

bash
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 runs

Options:

  • --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.

bash
magebox test phpstan
magebox test phpstan --level=5

Options:

  • --level - Analysis level 0-9 (default from config or 1)

magebox test phpcs ​

Run PHP_CodeSniffer.

bash
magebox test phpcs
magebox test phpcs --standard=PSR12

Options:

  • --standard - Coding standard (Magento2/PSR12)

magebox test phpmd ​

Run PHP Mess Detector.

bash
magebox test phpmd
magebox test phpmd --ruleset=cleancode,design

Options:

  • --ruleset - Rulesets to apply (comma-separated)

magebox test all ​

Run all tests except integration.

bash
magebox test all

Runs unit tests, PHPStan, PHPCS, and PHPMD in sequence. Ideal for CI/CD pipelines.


magebox test status ​

Show installed testing tools and their configuration.

bash
magebox test status

TIP

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.

bash
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 it

Aliases: 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):

yaml
sandbox:
  default_tool: claude
  extra_ro_binds:
    - /opt/shared/config
  extra_binds:
    - /path/to/extra/data
  tool_profiles:
    claude:
      command: claude
      args: []
      config_dirs:
        - ~/.claude

Service 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.

bash
magebox service install

On 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.

bash
magebox service uninstall

Unloads 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.

bash
magebox service status

Utility Commands ​

magebox check ​

Check project health and dependencies.

bash
magebox check

Verifies:

  • 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.

bash
magebox install

Verifies required software and provides installation guidance.


magebox --version ​

Show MageBox version.

bash
magebox --version

magebox --help ​

Show help information.

bash
magebox --help
magebox start --help

Released under the MIT License.