执行 Bash 命令 Args: command: 要执行的命令 timeout: 超时时间(秒) Returns: 执行结果 (包含 stdout, stderr, exit_code)
(command: str, timeout: Optional[int] = None)
| 279 | |
| 280 | |
| 281 | async def Bash(command: str, timeout: Optional[int] = None) -> Dict[str, Any]: |
| 282 | """ |
| 283 | 执行 Bash 命令 |
| 284 | |
| 285 | Args: |
| 286 | command: 要执行的命令 |
| 287 | timeout: 超时时间(秒) |
| 288 | |
| 289 | Returns: |
| 290 | 执行结果 (包含 stdout, stderr, exit_code) |
| 291 | """ |
| 292 | params = {"command": command} |
| 293 | if timeout is not None: |
| 294 | params["timeout"] = timeout |
| 295 | return await _bridge.call_tool("Bash", **params) |
| 296 | |
| 297 | |
| 298 | # ========== 工具函数生成器 ========== |