NAME
Developer::Dashboard::CLI::Suggest - fuzzy command suggestions for dashboard typos
SYNOPSIS
use Developer::Dashboard::CLI::Suggest;
my $suggest = Developer::Dashboard::CLI::Suggest->new();
print $suggest->unknown_command_message('dcoekr');
DESCRIPTION
Builds typo guidance for unknown top-level dashboard commands and dotted skill commands by scanning built-ins, layered custom commands, and installed skills.
PURPOSE
This module centralizes typo suggestions for the public dashboard switchboard and dotted skill dispatch. It gathers built-in helpers, layered custom CLI commands, and installed skill commands, then ranks the nearest matches so error messages can give users a likely correction instead of only dumping generic help text.
WHY IT EXISTS
It exists because unknown-command handling belongs in reusable library code rather than inlined string assembly inside the public entrypoint and skill dispatcher. Keeping fuzzy matching here makes the typo contract testable and keeps the switchboard thin.
WHEN TO USE
Use this file when changing unknown-command stderr output, command discovery, dotted skill suggestions, or the ranking behavior for typo guidance.
HOW TO USE
Construct it with new, then call unknown_command_message for a mistyped public command or unknown_skill_command_message for a dotted skill dispatch failure. The returned text is meant to be printed to stderr before the usual usage/help output.
WHAT USES IT
It is used by the public dashboard switchboard for unknown top-level commands, by the skill dispatcher for dotted skill lookup failures, and by CLI regression tests that pin the user-facing typo guidance.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::CLI::Suggest -e 'print Developer::Dashboard::CLI::Suggest->new->unknown_command_message("dcoekr")'
Preview the top-level typo guidance from a source checkout.
Example 2:
perl -Ilib -MDeveloper::Dashboard::CLI::Suggest -e 'print Developer::Dashboard::CLI::Suggest->new->unknown_skill_command_message("alpha-skill","run-tset")'
Preview the dotted skill typo guidance for one installed skill.
Example 3:
prove -lv t/05-cli-smoke.t t/19-skill-system.t
Run the focused regression tests that cover the user-facing suggestion contract.
Example 4:
prove -lr t
Recheck the suggestion behavior inside the full repository suite before release.