magento-cli-command

Scaffold Magento 2 CLI commands with dependency injection and exit codes.

32|3|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/furan917/magento-ai-toolkit --skill magento-cli-command
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: magento-cli-command
Source: https://github.com/furan917/magento-ai-toolkit/tree/main/skills/magento-cli-command
Command: npx skills add https://github.com/furan917/magento-ai-toolkit --skill magento-cli-command

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Magento 2 CLI development often requires boilerplate scaffolding, DI wiring, and consistent command patterns. This Skill automates and standardizes the creation of Symfony Console commands registered via Magento's DI system, reducing boilerplate and errors.

Core Features & Use Cases

  • Scaffolds full Magento 2 CLI commands with proper constructor injection, area awareness, and consistent exit codes.
  • Demonstrates a single-service delegation pattern to keep commands lightweight and testable.
  • Provides templates and guidance for registration in di.xml and common command options.

Quick Start

Paste this file as a system prompt, then describe the CLI command you need to create.

Frequently Asked Questions about magento-cli-command

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a Magento 2 CLI command with proper dependency injection?

To scaffold a Magento 2 CLI command with proper dependency injection, this Skill generates Symfony Console commands registered via Magento's DI system, automating constructor injection and di.xml configuration to reduce boilerplate.

What is the single-service delegation pattern in Magento 2 CLI commands?

The single-service delegation pattern in Magento 2 CLI commands delegates execution logic to a separate service, keeping command classes lightweight. This Skill enforces this rule to ensure commands remain testable and maintainable.

How do you handle area context awareness when creating Magento 2 CLI commands?

Handling area context awareness in Magento 2 CLI commands requires setting the correct area code before execution. This Skill provides templates and guidance for proper area context handling to ensure consistent behavior across store contexts.

Can I use this scaffolding tool for existing Magento 2 modules or only new ones?

You can use this scaffolding tool for existing Magento 2 modules. It targets developers building modules who need repeatable, tested command-line tooling, providing templates that integrate with your current di.xml registration.

Why do my Magento 2 CLI commands return inconsistent exit codes and how do I fix it?

Magento 2 CLI commands return inconsistent exit codes without standardized patterns. This Skill fixes it by scaffolding commands with reliable exit codes, ensuring consistent command-line UX and proper execution feedback.