Skip to main content

SHELL_TOOL

Constant SHELL_TOOL 

Source
pub(crate) const SHELL_TOOL: &str = r#"{
  "name": "Shell",
  "description": "Start a long-running shell process. Returns immediately with a shell_id. Output streams live in the conversation document. Use for build systems, watchers, dev servers — anything that should run in the background without blocking the conversation. Stop it later with ShellStop(shell_id) — never use kill/taskkill on a shell you started.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "cmd":            { "type": "string",  "description": "Command to run (passed to sh -c / cmd /C)" },
      "cwd":            { "type": "string",  "description": "Working directory (defaults to agent workdir)" },
      "title":          { "type": "string",  "description": "Display label shown in the conversation row (defaults to cmd)" },
      "env":            { "type": "object",  "description": "Extra environment variables", "additionalProperties": { "type": "string" } },
      "capture_stdin":  { "type": "boolean", "description": "Pipe stdin so ShellInput() can write to it. Default false — avoids blocking programs that read stdin to EOF (e.g. `cat` with no args). Set true only when you intend to use ShellInput()." },
      "connection":     { "type": "string",  "description": "Where it runs: \"local\" (default, this machine), \"wsl://<distro>\" for a WSL distribution on this Windows machine, or an SSH host (an ssh config alias, host, user@host or user@host:port). ConnList shows what is available. An SSH host runs as the user with their SSH keys, so the first use asks the user to allow it (an error says if they did not), and any ssh password or host-key prompt goes to the user, never to you. In WSL, cmd runs under the distro's sh -c, cwd is a path inside the distro (default: its home), and only the env you pass (plus terminal variables) crosses into it. Over SSH, cmd is run by the remote login shell, cwd is a remote path (~ is the remote home), and env does not cross." }
    },
    "required": ["cmd"]
  }
}"#;