# csv_to_resources

> CSV→Resource 批量生成。读取 CSV(class_path 指向的 GDScript Resource 类),按 filename_column 列命名,批量生成 .tres 到 output_dir。CSV 行数据走 GDScript FileAccess.get_csv_line(零进脚本字符串,防注入)。output_dir 经 resolveWithinRoot 沙箱(TS pre);filename 白名单(GDScript 正则 + .. 段级拒)。

| 属性 | 值 |
|------|-----|
| 所属层 | headless |
| 安全级别 | guarded |
| 需要 Godot | 是 |
| 需要编辑器 | 否 |
| 只读 | 否 |
| 长耗时 | 是 |

## Actions

- `csv_to_resources`

## Parameters

| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `action` | enum (1 项) | ✓ | 操作类型 |
| `project_path` | string | ✓ | Path to Godot project directory |
| `class_path` | string | ✓ | GDScript Resource 类路径(如 res://item.gd),CSV 每行实例化此类 |
| `output_dir` | string | ✓ | 输出目录(项目内,res:// 或相对路径,经沙箱校验) |
| `filename_column` | string | ✓ | CSV 中作为输出文件名的列名 |
| `csv_content` | string |  | CSV 文本内容(与 csv_path 二选一) |
| `csv_path` | string |  | CSV 文件路径(项目内,与 csv_content 二选一) |
| `timeout` | number |  | GDScript 执行超时秒数(大批量 CSV 可调大,默认 60) |

## 风险分布

写 1

---
<!-- AUTO-GENERATED by scripts/gen-tool-docs.mjs from capability-matrix.json v0.32.21. DO NOT edit manually; re-run npm run gen:tool-docs after tool changes. -->
