MCPcopy Index your code
hub / github.com/anomalyco/opencode / input

Function input

packages/opencode/src/cli/ui.ts:106–119  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

104}
105
106export async function input(prompt: string): Promise<string> {
107 const readline = require("readline")
108 const rl = readline.createInterface({
109 input: process.stdin,
110 output: process.stdout,
111 })
112
113 return new Promise((resolve) => {
114 rl.question(prompt, (answer: string) => {
115 rl.close()
116 resolve(answer.trim())
117 })
118 })
119}
120
121export function error(message: string) {
122 if (message.startsWith("Error: ")) {

Callers

nothing calls this directly

Calls 3

resolveFunction · 0.50
questionMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected