Skip to main content

dev:keep-calm

Keep Calm and Run All the Things ๐Ÿ› ๏ธ๐Ÿ˜Žโ€‹

info

Don't panic! Run all the magic commands to (maybe) fix your broken shop and restore your sanity!

warning

Command is experimental and not intended for production use. Use with caution!

The dev:keep-calm command runs a sequence of common Magento 2 maintenance and development commands in a single step. This helps you quickly restore your development environment after code changes or when things go wrong.

What It Doesโ€‹

Run the following commands in order (unless skipped or not needed):

  • hyva:config:generate (only if app/etc/hyva-themes.json does not exist)
  • setup:upgrade (also clears cache)
  • db:add-default-authorization-entries
  • generation:flush (clears generated code)
  • setup:di:compile (compiles dependency injection)
  • dev:theme:build-hyva (builds the CSS for all installed Hyvรค themes)
  • setup:static-content:deploy (skipped in non-production mode unless --force-static-content-deploy is used)
  • indexer:reset
  • indexer:reindex
  • maintenance:disable

Each command can be skipped with a --skip-<command> option, e.g. --skip-setup-upgrade.

At the end, a summary checklist is printed showing which commands were executed, skipped, or failed.

Usageโ€‹

n98-magerun2.phar dev:keep-calm [--force-static-content-deploy] [--skip-setup-upgrade] [--skip-indexer-reindex] ...

Optionsโ€‹

  • --force-static-content-deploy โ€“ Forces static content deploy even in non-production mode.
  • --skip-<command> โ€“ Skips the specified command (replace <command> with the command name, e.g. setup-upgrade).

Example if you want to skip the indexer:reset and indexer:reindex commands:

n98-magerun2.phar dev:keep-calm --skip-indexer-reset --skip-indexer-reindex

Example Outputโ€‹

1. ๐Ÿš€  Running command: hyva:config:generate
๐Ÿ˜Š Skipping command: hyva:config:generate (app/etc/hyva-themes.json exists)
2. ๐Ÿš€ Running command: setup:upgrade
... (output of each command)

Command Execution Summary:
1. โญ๏ธ hyva:config:generate - Generate Hyvรค theme configuration files if they are missing. (app/etc/hyva-themes.json exists)
2. โœ… setup:upgrade - Run setup upgrade and database schema/data updates. Clears also the cache.
...

Notesโ€‹

  • The command is intended for development environments only.
  • The summary at the end helps you quickly see what was done and what was skipped.

See Alsoโ€‹