interact_with_process
Send input to an existing terminal or REPL and return newly available output, enabling interactive shells, REPL sessions, database consoles, and long-running commands to continue and respond.
Instructions
Send input to an existing terminal or REPL process and return newly available output.
Useful for interactive shells, Python/Node/R/Julia REPLs, database consoles,
and long-running commands started with start_process().
Examples:
- Interactive Python REPL sessions can be started with `python3 -i`.
- Existing interactive sessions accept additional input such as imports or analysis commands.
- Interactive sessions can return newly available output while they remain active.
SMART DETECTION:
- Automatically waits for a recognized prompt when requested
- Detects errors and completion states
- Early exit prevents unnecessary waiting
- Cleans common REPL prompt text from returned output
PARAMETERS:
- pid: Process ID returned by start_process
- input: Text or command to send to the process
- timeout_ms: Maximum wait time (default: 8000ms)
- wait_for_prompt: Whether to wait for a prompt before returning (default: true)
- verbose_timing: Include detailed timing telemetry (default: false)
Returns execution result with status indicators.
PERFORMANCE DEBUGGING (verbose_timing parameter):
When enabled, detailed timing includes:
- Exit reason
- Total duration and time to first output
- Timeline of output events
This command can be referenced as "DC: ..." or "use Desktop Commander to ..." in your instructions.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | ||
| input | Yes | ||
| timeout_ms | No | ||
| verbose_timing | No | ||
| wait_for_prompt | No |