MCPcopy
hub / github.com/cursor/cookbook / runCommand

Function runCommand

sdk/coding-agent-cli/src/tui/App.tsx:256–286  ·  view source on GitHub ↗
(rawCommand: string)

Source from the content-addressed store, hash-verified

254 }
255
256 const runCommand = async (rawCommand: string) => {
257 const command = getSlashCommand(rawCommand)
258 setMode("input")
259 setInput("")
260
261 switch (command) {
262 case "/help":
263 setInput("/")
264 setMode("command")
265 break
266 case "/model":
267 await openModelPicker()
268 break
269 case "/local":
270 await switchExecutionMode("local")
271 break
272 case "/cloud":
273 await switchExecutionMode("cloud")
274 break
275 case "/reset":
276 await resetAgent()
277 break
278 case "/exit":
279 case "/quit":
280 exitApp()
281 break
282 default:
283 addEntry("error", "command", `Unknown command: ${rawCommand}. Type /help.`)
284 break
285 }
286 }
287
288 const openModelPicker = async () => {
289 const session = sessionRef.current

Callers 2

submitInputFunction · 0.70
selectCommandFunction · 0.70

Calls 6

getSlashCommandFunction · 0.85
openModelPickerFunction · 0.85
switchExecutionModeFunction · 0.85
resetAgentFunction · 0.85
exitAppFunction · 0.85
addEntryFunction · 0.85

Tested by

no test coverage detected