Preface¶
During the development of DeepSeek Harness (DSH), handling configurations or data in different formats is a common scenario. When converting YAML-formatted configurations to JSON, or converting JSON to YAML, writing parsing logic directly can increase development costs. The dsh-yaml plugin provides native format conversion capabilities, simplifying this process.
Plugin Overview¶
uckkk/dsh-yaml is a DSH plugin implemented in pure Node.js. Its core purpose is to parse YAML into JSON and serialize JSON into YAML. The plugin is released under the MIT License.
Installation and Enablement¶
Run the following command in your terminal to install the plugin:
dsh plugin add dsh-yaml
After installation, add the plugin name to the dsh.profile.bundles field in your project’s package.json file:
{
"dsh.profile.bundles": ["dsh-yaml"]
}
Core Features¶
The plugin provides the following two conversion tools:
- yaml_to_json: Converts YAML text into a JSON object.
- json_to_yaml: Serializes a JSON object into YAML text.
Typical Usage¶
You can use the plugin by calling the tools above in a DSH session or script. For example, convert a YAML string to JSON:
yaml_to_json(text="name: test\nage: 1\n")
Notes¶
- Code Execution Permissions: The plugin runs with the permissions of the current DSH process, meaning it executes third-party code on the local machine.
- Source Code Review: Before installation, review the source code and license (MIT) yourself to ensure compliance with your security requirements.
Conclusion¶
dsh-yaml provides a lightweight solution for YAML/JSON conversion, making it suitable for DSH workflows that require frequent format conversions. For more details and source code, refer to the plugin directory or the GitHub repository.