hyva-exec-shell-cmd
Original:🇺🇸 English
Translated
1 scripts
Utility skill to detect Magento development environment and determine command wrapper. This skill should be used by other skills that need to execute shell commands in the Magento environment. It detects Warden, docker-magento, DDEV, and local environments and provides the appropriate command wrapper.
5installs
Added on
NPX Install
npx skill4agent add hyva-themes/hyva-ai-tools hyva-exec-shell-cmdTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Execute Shell Commands in Magento Environment
This utility skill detects the Magento development environment and provides the appropriate command wrapper for executing shell commands.
Usage
Other skills should reference this skill when they need to execute commands in the Magento environment. The detected wrapper ensures commands run in the correct context (container or local).
Step 1: Detect Environment
Important: Execute this script from the Magento project root directory, or provide the path as an argument.
Run this detection once at the start of any skill that needs to execute shell commands:
bash
<skill_path>/scripts/detect_env.sh [magento_root_path]Where is the directory containing this SKILL.md file (e.g., ).
<skill_path>.claude/skills/hyva-exec-shell-cmdThe optional argument specifies the Magento installation directory. If omitted, the script uses the current working directory.
magento_root_pathOutput: , , , or
wardendocker-magentoddevlocalStep 2: Apply Command Wrapper
Based on detected environment, wrap commands as follows:
| Environment | Command Wrapper | Description |
|---|---|---|
| Warden | | Docker environment managed by Warden |
| docker-magento | | Mark Shust's docker-magento setup |
| DDEV | | DDEV containerized environment |
| Local | Run | Native environment without containers |
Examples
Single command
bash
# Warden
warden env exec -T php-fpm bash -c "bin/magento cache:clean"
# docker-magento
bin/clinotty bash -c "bin/magento cache:clean"
# DDEV
ddev exec bin/magento cache:clean
# Local
bin/magento cache:cleanCommand with directory change
bash
# Warden
warden env exec -T php-fpm bash -c "cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# docker-magento
bin/clinotty bash -c "cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# DDEV
ddev exec bash -c "vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# Local
cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run buildCommands That Do NOT Require Wrapping
Some commands run on the host system and should NOT be wrapped:
- commands (runs on host, not in container)
composer - commands
git - File operations on the host filesystem (,
ls,findfor files accessible from host)cp - CLI commands
warden - CLI commands
ddev
Integration Pattern
Skills that need to execute commands should:
- Reference this skill: "Use the skill to determine the command wrapper"
hyva-exec-shell-cmd - Detect environment once using Step 1
- Store the wrapper pattern for use throughout the skill
- Apply the wrapper to all container commands per Step 2