在 DeepSeek Harness (DSH) 的开发流程中,智能体经常需要在结构化的 JSON 数据和通用的 CSV 表格格式之间进行转换,以便后续存储或与其他工具交互。直接在代码中手动解析 CSV 格式较为繁琐,这里介绍一个解决该问题的插件。

dsh--csv 是由 uckkk 维护的一个插件。它提供 JSON 对象数组与 CSV 之间的双向转换,支持表头处理与引号转义。该插件采用纯 Node.js 实现。

核心功能

  1. JSON ↔ CSV 互转:支持对象数组与 CSV 格式的相互转换。
  2. 格式支持:支持表头与引号转义。
  3. 纯 Node 实现:基于 Node.js 运行。

安装与启用

安装步骤如下:

dsh plugin add dsh--csv

安装完成后,在会话中即可调用该插件注册的工具函数。

典型用法

利用 _to_csv 函数可以将一组 JSON 数据导出为 CSV:

_to_csv(data=[{a:1,b:2},{a:3,b:4}])

适用场景与注意

该插件安装即在本机运行第三方 code。请自行审阅源码。

结尾

该工具为 DSH 智能体提供了标准化的 CSV 处理能力。更多细节可参考 GitHub。

Wait, the above mistakenly output Chinese. Need final only English translation. We’ll produce final. Ensure no code changed. Use “In the development workflow…”. final only.

In the development workflow of DeepSeek Harness (DSH), agents often need to convert between structured JSON data and the common CSV spreadsheet format for subsequent storage or interaction with other tools. Manually parsing CSV directly in code can be cumbersome, so this article introduces a plugin that solves this problem.

dsh--csv is a plugin maintained by uckkk. It provides bidirectional conversion between JSON object arrays and CSV, with support for header handling and quote escaping. The plugin is implemented in pure Node.js.

Core Features

  1. JSON ↔ CSV conversion: Supports conversion between object arrays and CSV format.
  2. Format support: Supports headers and quote escaping.
  3. Pure Node implementation: Runs based on Node.js.

Installation and Enabling

The installation steps are as follows:

dsh plugin add dsh--csv

After installation, you can call the tool functions registered by the plugin in a session.

Typical Usage

Using the _to_csv function, you can export a set of JSON data to CSV:

_to_csv(data=[{a:1,b:2},{a:3,b:4}])

Use Cases and Notes

Installing this plugin runs third-party code on your local machine. Please review the source code yourself.

Conclusion

This tool provides standardized CSV processing capability for DSH agents. For more details, refer to GitHub.