@@ -130,6 +130,52 @@ bin/magento mageforge:version
130130- Fetches the latest version from GitHub API
131131- Displays both versions for comparison
132132
133+ ---
134+
135+ ### 6. CleanCommand (` mageforge:static:clean ` )
136+
137+ ** Purpose** : Cleans static files from ` var/view_preprocessed ` and ` pub/static ` directories for specific theme(s).
138+
139+ ** File** : ` /src/Console/Command/Static/CleanCommand.php `
140+
141+ ** Dependencies** :
142+ - ` ThemeList ` - Service to retrieve theme information
143+ - ` Filesystem ` - Magento filesystem component for directory operations
144+
145+ ** Usage** :
146+ ``` bash
147+ bin/magento mageforge:static:clean [< themeCodes> ...]
148+ ```
149+
150+ ** Examples** :
151+ ``` bash
152+ # Clean a single theme
153+ bin/magento mageforge:static:clean Magento/luma
154+
155+ # Clean multiple themes
156+ bin/magento mageforge:static:clean Magento/luma Vendor/custom-theme
157+
158+ # Show available themes (when no theme code provided)
159+ bin/magento mageforge:static:clean
160+ ```
161+
162+ ** Implementation Details** :
163+ - If no theme codes are provided, displays available themes and usage information
164+ - For each specified theme:
165+ 1 . Validates that the theme exists
166+ 2 . Cleans matching directories from ` var/view_preprocessed/ `
167+ 3 . Cleans matching directories from ` pub/static/ `
168+ 4 . Uses pattern matching to find theme-specific directories (e.g., ` frontend/Vendor/theme ` )
169+ - Displays a summary showing which themes were successfully cleaned
170+ - Uses recursive directory removal with proper error handling
171+ - Returns success status even if some operations fail (with appropriate error messages)
172+
173+ ** Use Cases** :
174+ - Clear generated static files before a fresh build
175+ - Remove old static files after theme updates
176+ - Clean up disk space by removing unnecessary cached files
177+ - Troubleshoot theme-related issues by clearing all cached assets
178+
133179## Command Services
134180
135181The commands rely on several services for their functionality:
0 commit comments