Introduction

Under DSH’s plugin architecture, agent developers often need to format or analyze input text. This typically involves writing ad hoc scripts or calling external APIs. The dsh-text-tools plugin addresses this use case by providing localized string-processing capabilities, including case conversion, naming-style mapping, and text statistics.

Plugin Overview

This plugin is implemented in pure Node.js and maintained by uckkk. It provides two core capabilities: string style transformation and text statistics. The code runs directly within the DSH process and does not require additional network interfaces.

Core Features

1. String Style Transformation

It provides the text_transform tool, which supports converting text to several common naming styles:

  • Case conversion
  • Camel case
  • Snake case
  • Kebab case
  • Slug format

2. Text Statistics

It provides the text_stats tool, which performs multi-dimension analysis of text content:

  • Character count
  • Word count
  • Line count
  • Byte count

Installation and Enabling

Run the following command in a terminal to install the plugin:

dsh plugin add github:uckkk/dsh-text-tools

After successful installation, enable the plugin in the profile’s package.json configuration file. Add "dsh-text-tools" under the dsh.profile.bundles field:

{
  "dsh.profile.bundles": ["dsh-text-tools"]
}

After configuration, restart or reload the DSH environment to use the plugin.

Typical Usage

After installation, you can directly call the registered tool functions in a DSH session.

Convert the string "hello world" to camel case:

text_transform(text="hello world", mode="camel")

Notes

Since installing this plugin runs third-party code locally, you must review its source code before installation. The source is available via the GitHub repository link, and you should ensure it meets your security and compliance requirements.

Conclusion

dsh-text-tools provides a lightweight text-processing solution for the DSH ecosystem. It is suitable for agent scenarios that require quick formatting or statistical analysis of text. More details and the source code are available at: GitHub | Community directory.