MCPcopy Create free account
hub / github.com/anomalyco/opencode / pick

Function pick

packages/opencode/src/cli/cmd/run/footer.command.tsx:471–518  ·  view source on GitHub ↗
(item: CommandEntry)

Source from the content-addressed store, hash-verified

469 const items = createMemo<CommandEntry[]>(() => match(query(), entries()))
470 const menu = createFooterMenuState({ count: () => items().length, limit: PANEL_LIST_ROWS })
471 const pick = (item: CommandEntry) => {
472 if (item.action === "model") {
473 props.onModel()
474 return
475 }
476
477 if (item.action === "editor") {
478 props.onEditor()
479 return
480 }
481
482 if (item.action === "skill") {
483 props.onSkill()
484 return
485 }
486
487 if (item.action === "subagent") {
488 props.onSubagent()
489 return
490 }
491
492 if (item.action === "queued") {
493 props.onQueued()
494 return
495 }
496
497 if (item.action === "variant.cycle") {
498 props.onVariantCycle()
499 return
500 }
501
502 if (item.action === "variant.list") {
503 props.onVariant()
504 return
505 }
506
507 if (item.action === "exit") {
508 props.onExit()
509 return
510 }
511
512 if (item.name === "new") {
513 props.onNew()
514 return
515 }
516
517 props.onCommand(item.name)
518 }
519 const select = () => {
520 const item = items()[menu.selected()]
521 if (!item) {

Callers 1

selectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected