# `CMDC.Tool.Shell`
[🔗](https://github.com/tupleyun/cmdc/blob/v0.5.3/lib/cmdc/tool/shell.ex#L1)

在 shell 中执行命令，支持超时和大输出自动存文件。

## 大输出处理

输出超过 `@max_bytes`（50KB）或 `@max_lines`（2000 行）时：
- 将完整输出写入 `working_dir/.cmdc/output/{timestamp}.txt`
- 返回截断版本 + 文件路径提示，LLM 可用 `read_file` 继续查阅

## Shell 类型

根据平台自动选择：POSIX（sh/bash/zsh）或 Windows（cmd/powershell）。
通过 `ctx.config.shell` 可覆盖。

# `shell`

```elixir
@type shell() :: :sh | :bash | :zsh | :cmd | :powershell
```

# `default_shell`

```elixir
@spec default_shell() :: shell()
```

返回当前平台的默认 shell。

# `name`

```elixir
@spec name(shell()) :: String.t()
```

返回指定 shell 类型的工具名称。

# `shell_description`

```elixir
@spec shell_description(shell()) :: String.t()
```

返回指定 shell 类型的基础描述。

# `shell_names`

```elixir
@spec shell_names() :: MapSet.t(String.t())
```

返回所有 shell 工具名称的 MapSet。

---

*Consult [api-reference.md](api-reference.md) for complete listing*
