
omdsh-dev/dsh-tool-csv
40Last commit Aug 14, 2026
dsh-tool-csv DSH plugin
dsh-tool-csv is a DSH plugin that provides deterministic CSV processing for agent sessions. It parses, queries, filters, and converts CSV text to structured JSON, handling edge cases like quoted fields, multiline values, and BOM. It is a pure-function, zero-dependency tool that runs in milliseconds.
How to install the dsh-tool-csv DSH plugin
dsh plugin --profile web add github:omdsh-dev/dsh-tool-csvCopying does not run this command. Review the repository and version before installing the dsh-tool-csv DSH plugin.
dsh-tool-csv DSH plugin data source
dsh-tool-csv DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-tool-csv DSH plugin can do
- Parse CSV text into JSON arrays (objects or arrays depending on header mode)
- Filter rows by exact column value (column name or 1-based index)
- Compute statistics: row count, column count, column names, empty rows, warnings
- Support custom delimiter (single character or 'tab') and headerless mode
- Robust boundary handling: quoted fields with commas/newlines, BOM stripping, null-prototype for dangerous headers
Where the dsh-tool-csv DSH plugin fits
- Extract specific rows from a CSV response in an API call
- Validate CSV format and detect structural issues (unclosed quotes, inconsistent columns)
- Convert CSV data to JSON for downstream processing
- Analyze table structure in agent conversations (number of rows, columns, warnings)
Who the dsh-tool-csv DSH plugin is for
- DSH users who need to handle CSV data in agent sessions
- Developers building AI workflows that require reliable CSV parsing without external processes
dsh-tool-csv DSH plugin limitations
- Input size limited to 256,000 bytes; larger inputs cause an error (no truncation)
- Query only supports exact string matching (`===`), not expression evaluation or substring search
- Default row limit is 100; must be explicitly increased for larger outputs
- Requires DSH runtime (profile with peer dependencies installed)
dsh-tool-csv DSH plugin: from the repository README
Quoted from the omdsh-dev/dsh-tool-csv README, the upstream source of the dsh-tool-csv DSH plugin. Copyright remains with the original authors.
DSH CSV 数据工具插件 —— 解析、查询、过滤、统计和转换 CSV 文本。零依赖、纯函数、RFC 4180 状态机解析器。 [](LICENSE) ## 动机 Agent 会话里表格形态的数据(导出文件、API 响应、报告片段)出现频率很高。现有路径是起 `bash` 进程让模型现写解析脚本: 1. **每次调用都起进程**——Windows 上尤其昂贵 2. **模型手写 CSV 解析器错误率高**——引号内逗号、`""` 转义、BOM、跨行字段、CRLF 这些边界手写代码极易踩坑,且结果不可验证 本插件提供确定性、零依赖、纯函数的 CSV 处理:一次函数调用,毫秒级返回结构化 JSON。 与 `dsh-tool-json` 形成"结构化数据处理"对:JSON 管对象,CSV 管表格。 ## 安全模型 - **零依赖**:不引入 csv 解析库,手写状态机(单遍扫描,O(n)) - **纯函数**:不读文件、不写文件、不联网、不 eval - **无注入面**:查询过滤只做字面精确匹配(`===`),不支持表达式求值 - **预算**:输入上限 256,000 字节(超限直接报错,不截断);`timeoutMs: 2000`;`limit` 默认 100 行防输出膨胀 - 工具参数会记入会话日志,不要传入敏感数据 ## 工具声明 注册 `csv` 工具(`@deepseek-ai/dsh-tool-csv`,row id `tool-csv`),统一输出 JSON 文本字符串。 | 参数 | 类型 | 必填 | 说明 | |---|---|---|---| | `action` | string | ✅ | `parse` / `query` / `stats` / `to_json` | | `csv` | string | ✅ | CSV 文本(RFC 4180;引号字段可含逗号/换行;`""` 转义;忽略 BOM) | | `column` | string | | 查询列:列名(有表头时)或 1-based 索引如 `"2"` | | `value` | string | | 查询精确匹配值(严格相等,非子串) | | `delimiter` | string | | 分隔符,默认 `","`;单字符或 `"tab"` | | `header` | boolean | | 首行是否为表头,默认 `true`;`false` 时行解析为数组 | | `limit` | integer | | 返回行数上限(query/parse),默认 100 | ## Actions | action | 功能
Read the full READMERepository license: MIT
dsh-tool-csv DSH plugin questions
How do I install dsh-tool-csv?
You can install it using the DSH CLI: `dsh plugin --profile web add github:omdsh-dev/dsh-tool-csv`. Alternatively, clone the repo, run `npm install && npm pack`, then `dsh plugin --profile web add ./deepseek-ai-dsh-tool-csv-*.tgz`. The plugin works with both web and headless profiles.
How do I verify the plugin is installed?
Run `dsh --profile web --dump-config | grep tool-csv` to check if the plugin row appears. You can also run `dsh run "use csv tool to parse 'a,b\n1,2'"` to test the tool directly.
What CSV format does the plugin support?
It supports RFC 4180 CSV: quoted fields can contain commas, newlines, and CRLF; `""` escapes a double quote; BOM at the start is stripped. Unclosed quotes and invalid characters after closing quotes cause an error.
Can I process large CSV files?
The input is limited to 256,000 bytes. For larger files, you must split them before passing to the plugin. The plugin also has a default row limit of 100 for query/parse actions, which you can increase with the `limit` parameter.
How do I query rows by column value?
Use the `query` action with `column` (column name or 1-based index) and `value` (exact match). For example: `csv { action: "query", csv: "name,city\nalice,nyc\nbob,la", column: "city", value: "la" }` returns `[["name","city"],["bob","la"]]`.