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

Function selectedCommand

packages/opencode/src/cli/cmd/run/footer.prompt.tsx:185–199  ·  view source on GitHub ↗
(text: string, command: RunPrompt["command"])

Source from the content-addressed store, hash-verified

183}
184
185function selectedCommand(text: string, command: RunPrompt["command"]) {
186 if (!command) {
187 return
188 }
189
190 const head = slashHead(text)
191 if (!head || head.name !== command.name) {
192 return
193 }
194
195 return {
196 name: command.name,
197 arguments: head.arguments,
198 }
199}
200
201export function RunPromptBody(props: {
202 theme: () => RunFooterTheme

Callers 2

syncDraftFunction · 0.85
submitPromptFunction · 0.85

Calls 1

slashHeadFunction · 0.70

Tested by

no test coverage detected