console-commands

Create and register Symfony Console commands for OrangeHRM's production and developer consoles.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill console-commands-snow-gift111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: console-commands
Source: https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone/tree/main/.agents/skills/console-commands
Command: npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill console-commands-snow-gift111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? OrangeHRM has two separate Symfony Console entry points with different registration mechanisms, and commands silently fail to appear when registered incorrectly. This Skill explains how to write, register, and debug console commands in the right place. ## Core Features & Use Cases - Two-console guidance: Distinguishes bin/console (production, plugin-registered) from devTools/core/console.php (developer-only, direct registration) and helps you choose correctly. - Command authoring patterns: Covers the OrangeHRM\Framework\Console\Command base class, getCommandName(), getIO() returning a SymfonyStyle, and trait-based service composition. - Registration and troubleshooting: Explains ConsoleConfigurationInterface::registerCommands(), conditional registration, and common pitfalls like missing interface implementation or dev dependencies leaking into production commands. - Use Case: You add a widget:export command to a feature plugin, implement ConsoleConfigurationInterface in the plugin configuration class, and verify it appears via php bin/console list. ## Quick Start Ask the agent to create a new OrangeHRM console command named widget:export and register it so it appears in bin/console.

Frequently Asked Questions about console-commands

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

FAQPage Schema
How do I add a new console command to OrangeHRM?

Create a class extending OrangeHRM\Framework\Console\Command, implement getCommandName() with a namespace:action name, and define configure() and execute(). Then register it in your plugin's PluginConfiguration via registerCommands() for bin/console, or add it directly in devTools/core/console.php for dev tools.

What is the difference between bin/console and devTools/core/console.php?

bin/console is the production console using the main app's autoload, with commands registered by plugins via ConsoleConfigurationInterface. devTools/core/console.php is a developer-only console with its own composer.json, registering commands directly and excluded from production builds.

Why doesn't my command appear in bin/console list?

The plugin configuration class must implement both PluginConfigurationInterface and ConsoleConfigurationInterface; implementing only the latter silently fails. Also verify getCommandName() has no typos, since misspelled names register without error but cannot be invoked.

Can a bin/console command use devTools dependencies?

No. bin/console commands must only use packages from src/vendor, since devTools/ is excluded from production builds. Commands needing dev-only libraries like PHP-CS-Fixer or swagger-php belong in devTools/core/console.php instead.

How do I make a Symfony Console command interactive in OrangeHRM?

Use $this->getIO() which returns a SymfonyStyle with ask(), confirm(), choice(), and askHidden() methods. Check $input->isInteractive() to support non-interactive CI usage, requiring all values as flags when prompts are unavailable.