Skip to content

Conversation

@dermatz
Copy link
Collaborator

@dermatz dermatz commented Jan 16, 2026

Feature: Theme name suggestions for invalid input

Closes #75

Summary

When users enter an incorrect theme name, MageForge now suggests similar themes using Levenshtein distance algorithm (like Symfony's command suggestions).

Before:

bin/magento mageforge:theme:build vendor/Nema
# Error: Theme vendor/Nema is not installed.

After:

bin/magento mageforge:theme:build hyva/deFAULT

[ERROR] Theme 'hyva/deFAULT' is not installed.

? Did you mean one of these themes?
  ❯ Hyva/default
    None of these

✓ Using theme: Hyva/default

Changes

  • Added ThemeSuggester service with Levenshtein matching (threshold: strlen/3) and case-insensitive substring matching
  • Extended AbstractCommand with handleInvalidThemeWithSuggestions() method
  • Updated 4 commands: BuildCommand, WatchCommand, CleanCommand, TokensCommand
  • Interactive mode: Shows Laravel Prompts SelectPrompt with suggestions
  • Non-interactive mode (CI/Docker): Displays suggestions as text
  • Added CI tests in magento-compatibility.yml

@dermatz dermatz merged commit 1347782 into main Jan 16, 2026
7 of 8 checks passed
@dermatz dermatz deleted the feature-request/#75/theme-suggestion branch January 16, 2026 23:05
@github-actions github-actions bot mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature-Request: theme suggested if incorrect

2 participants