mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-08 18:39:50 +00:00
feat(cli): add type-ahead filtering to agent and cloud selection (#1393)
Replace select prompts with autocomplete for improved UX when choosing agents and clouds. Users can now type to filter the list, significantly reducing time to find desired options in long lists. - Replace p.select with p.autocomplete for agent selection - Replace p.select with p.autocomplete for cloud selection - Add "type to filter" messaging and placeholder text - Update CLI version 0.3.2 → 0.3.3 Fixes #1367 Agent: ux-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
06351d6ea0
commit
e55cd149c2
1 changed files with 8 additions and 6 deletions
|
|
@ -398,13 +398,14 @@ export function buildAgentPickerHints(manifest: Manifest): Record<string, string
|
|||
return hints;
|
||||
}
|
||||
|
||||
// Prompt user to select an agent with hints
|
||||
// Prompt user to select an agent with hints and type-ahead filtering
|
||||
async function selectAgent(manifest: Manifest): Promise<string> {
|
||||
const agents = agentKeys(manifest);
|
||||
const agentHints = buildAgentPickerHints(manifest);
|
||||
const agentChoice = await p.select({
|
||||
message: "Select an agent",
|
||||
const agentChoice = await p.autocomplete({
|
||||
message: "Select an agent (type to filter)",
|
||||
options: mapToSelectOptions(agents, manifest.agents, agentHints),
|
||||
placeholder: "Start typing to search...",
|
||||
});
|
||||
if (p.isCancel(agentChoice)) handleCancel();
|
||||
return agentChoice;
|
||||
|
|
@ -435,11 +436,12 @@ function getAndValidateCloudChoices(
|
|||
return { clouds: sortedClouds, hintOverrides, credCount };
|
||||
}
|
||||
|
||||
// Prompt user to select a cloud from the sorted list
|
||||
// Prompt user to select a cloud from the sorted list with type-ahead filtering
|
||||
async function selectCloud(manifest: Manifest, cloudList: string[], hintOverrides: Record<string, string>): Promise<string> {
|
||||
const cloudChoice = await p.select({
|
||||
message: "Select a cloud provider",
|
||||
const cloudChoice = await p.autocomplete({
|
||||
message: "Select a cloud provider (type to filter)",
|
||||
options: mapToSelectOptions(cloudList, manifest.clouds, hintOverrides),
|
||||
placeholder: "Start typing to search...",
|
||||
});
|
||||
if (p.isCancel(cloudChoice)) handleCancel();
|
||||
return cloudChoice;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue