---
name: magerun2
description: Use structured n98-magerun2 commands for Magento operations that MerchantDuo does not model as a workflow.
---

# Universal magerun2

MerchantDuo discovers magerun2 once for the selected environment. Local uses a project binary, PATH binary, or a verified official PHAR cache; Warden uses its PHP service; SSH uses its remote binary. The capability and diagnostic appear in `magento_workflow` status.

Use `magento_workflow` for its supported cache, deployment, indexing, and test operations. Use `magerun2` only for a command that the workflow does not model. Pass exact structured arguments, never a shell command string. For example:

```json
{"args":["list"]}
```

```json
{"args":["help","sys:cron:list"]}
```

Without `execute: true`, the tool returns an exact quoted preview. Set `execute: true` only after the user directly asks to run the command; MerchantDuo then provides its one confirmation dialog. `stdin` is optional for subcommands that require it.

Do not call `dev:console` through this tool. Use `magento_php_repl` with its typed `snippet` and optional `area`. Generic magerun2 is refused on read-only SSH because arbitrary subcommands cannot be safely classified.
