LoopCommand implements loop.Provider. Prompt is supplied via stdin; Cursor CLI reads it when -p has no argument.
(ctx context.Context, prompt, workDir string)
| 32 | // LoopCommand implements loop.Provider. |
| 33 | // Prompt is supplied via stdin; Cursor CLI reads it when -p has no argument. |
| 34 | func (p *CursorProvider) LoopCommand(ctx context.Context, prompt, workDir string) *exec.Cmd { |
| 35 | cmd := exec.CommandContext(ctx, p.cliPath, |
| 36 | "-p", |
| 37 | "--output-format", "stream-json", |
| 38 | "--force", |
| 39 | "--workspace", workDir, |
| 40 | "--trust", |
| 41 | ) |
| 42 | cmd.Dir = workDir |
| 43 | cmd.Stdin = strings.NewReader(prompt) |
| 44 | return cmd |
| 45 | } |
| 46 | |
| 47 | // InteractiveCommand implements loop.Provider. |
| 48 | func (p *CursorProvider) InteractiveCommand(workDir, prompt string) *exec.Cmd { |
no outgoing calls