Scaffolding¶
MageObsidian ships bin/magento generators that scaffold modules, themes, and Vue components already wired for the frontend β so the resolver picks them up with no manual setup. They live in the mage-obsidian/module-modern-frontend-cli package.
| Command | What it creates |
|---|---|
mage-obsidian:generate:module |
A new module under app/code, opted in for the frontend. |
mage-obsidian:generate:theme |
A new frontend theme under app/design, pre-wired. |
mage-obsidian:generate:component |
A Vue single-file component inside a module or theme. |
Generate a Module¶
The name must be in Vendor_Module form. It creates, under app/code/Acme/Catalog/:
registration.phpetc/module.xml(sequenced after the core)etc/mage_obsidian_compatibility.xml(the frontend opt-in)view/frontend/web/module.config.ts
A module is invisible to the frontend stack until it ships the compatibility file, so it is generated by default. Follow the printed next steps to activate it:
| Option | Description |
|---|---|
--force, -f |
Overwrite files if they already exist. |
Generate a Theme¶
The code must be in Vendor/theme form. It creates, under app/design/frontend/Acme/aurora/:
registration.phptheme.xml(with the<parent>if--parentis given)etc/mage_obsidian_compatibility.xmlweb/theme.config.jsweb/css/theme.source.css(a Tailwind 4 source).gitignore
| Option | Description |
|---|---|
--parent |
Parent theme, e.g. Magento/blank. |
--title |
Human-readable theme title (defaults to the code). |
--force, -f |
Overwrite existing files. |
Then activate it in Content β Design β Configuration (or via config) and regenerate the contract:
Generate a Component¶
Target exactly one of a module or a theme:
The target must be an enabled, frontend-compatible module/theme; otherwise the command tells you to ship the compatibility file and run mage-obsidian:frontend:config --generate.
The component is written to the framework's convention so the resolver finds it with no registration:
- module β
view/frontend/web/components/<name>.vue - theme β
web/components/<name>.vue
Nested paths work (elements/Button), and a leading components/ or trailing .vue in the name is normalized away. The command then prints how to render it:
(For a theme target the reference uses the Theme:: namespace, e.g. Theme::ProductCard.)
| Option | Description |
|---|---|
--module |
Target module (Vendor_Module). |
--theme |
Target theme (Vendor/theme). |
--wire |
Also generate a .phtml stub that renders the component. |
--force, -f |
Overwrite existing files. |
Wiring a phtml stub¶
With --wire, the command also writes a .phtml that renders the new component and prints a layout block snippet to drop it onto a handle:
- module β
view/frontend/templates/<name>.phtml - theme β
Magento_Theme/templates/<name>.phtml
End-to-End Example¶
The component renders as a lazy-hydrated Vue island. Edit the generated .vue and the dev watcher keeps resolution and editor autocomplete in sync.