MCPcopy Create free account
hub / github.com/GCWing/BitFun / execute_command

Method execute_command

src/crates/services/terminal/src/api.rs:419–434  ·  view source on GitHub ↗

Execute a command in a session and wait for completion This function sends a command to the terminal, waits for it to complete using shell integration, and returns the output and exit code.

(
        &self,
        request: ExecuteCommandRequest,
    )

Source from the content-addressed store, hash-verified

417 /// This function sends a command to the terminal, waits for it to complete
418 /// using shell integration, and returns the output and exit code.
419 pub async fn execute_command(
420 &self,
421 request: ExecuteCommandRequest,
422 ) -> TerminalResult<ExecuteCommandResponse> {
423 let options = ExecuteOptions {
424 timeout: request.timeout_ms.map(Duration::from_millis),
425 prevent_history: request.prevent_history.unwrap_or(true),
426 };
427
428 let result = self
429 .session_manager
430 .execute_command_with_options(&request.session_id, &request.command, options)
431 .await?;
432
433 Ok(ExecuteCommandResponse::from(result))
434 }
435
436 /// Check if a session has shell integration enabled
437 pub async fn has_shell_integration(&self, session_id: &str) -> bool {

Callers 5

terminal_executeFunction · 0.45
remote_executeFunction · 0.45
probe_remote_executableFunction · 0.45
probe_remote_npx_adapterFunction · 0.45

Calls 1

Tested by

no test coverage detected