跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

shell.go

29 行 · 1.4 KB历史下载
1// SPDX-FileCopyrightText: Copyright The Lima Authors
2// SPDX-License-Identifier: Apache-2.0
3
4// Portion of AI prompt texts from:
5// - https://github.com/google-gemini/gemini-cli/blob/v0.1.12/docs/tools/shell.md
6//
7// SPDX-FileCopyrightText: Copyright 2025 Google LLC
8
9package msi
10
11import "github.com/modelcontextprotocol/go-sdk/mcp"
12
13var RunShellCommand = &mcp.Tool{
14 Name: "run_shell_command",
15 Description: `Executes a given shell command.`,
16}
17
18type RunShellCommandParams struct {
19 Command []string `json:"command" jsonschema:"The exact shell command to execute. Defined as a string slice, unlike Gemini's run_shell_command that defines it as a single string."`
20 Description string `json:"description,omitempty" jsonschema:"A brief description of the command's purpose, which will be potentially shown to the user."`
21 Directory string `json:"directory" jsonschema:"The absolute directory in which to execute the command. Unlike Gemini's run_shell_command, this must not be a relative path, and must not be empty."`
22}
23
24type RunShellCommandResult struct {
25 Stdout string `json:"stdout" jsonschema:"Output from the standard output stream."`
26 Stderr string `json:"stderr" jsonschema:"Output from the standard error stream."`
27 Error string `json:"error,omitempty" jsonschema:"Any error message reported by the subprocess."`
28 ExitCode *int `json:"exit_code,omitempty" jsonschema:"Exit code of the command."`
29}