Skip to main content

dsh-plugin-dev-skills/examples/greet-tool

38Stars1Forks0Issues0Watchers

Minimal tool example in the DSH plugin development skill pack, registering a greet tool to the model to demonstrate standard defineTool usage.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
License
MIT
Branch
master
agentagent-skillagent-skillsaiai-agentawesome-dsh-pluginclaude-codecodex

Install

cmdweb profile
$ dsh plugin --profile web add github:zimodzh/dsh-plugin-dev-skills#path:examples/greet-tool

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin zimodzh/dsh-plugin-dev-skills/examples/greet-tool for me: review the repository at https://github.com/zimodzh/dsh-plugin-dev-skills first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-Sentence Description

This is a minimal runnable example bundled with the dsh-plugin-dev-skills repository. It registers a greeting tool named "greet" with DSH's model to demonstrate the standard pattern of defineTool. It's not a production-ready plugin, but a reference template for users who want to learn DSH plugin development.

Core Capabilities

  • Registers a tool named greet in the DSH tool registry, making it available for large language models to invoke during conversations
  • Accepts a required string parameter name and returns a greeting string in the format "Hello, {name}!"
  • Declares the return type as string in output.schema and renders the value into model-consumable content blocks in output.render
  • Demonstrates the inject: ['tools'] pattern, allowing Cordis container to prepare the tool registry before executing apply
  • Serves as a copy-paste runnable example for the dsh-plugin-dev skill's references/tools.md documentation

Technical Implementation

  • Language: JavaScript (ESM, "type": "module")
  • Key Dependency: @deepseek-ai/dsh-tools (bundled with DSH installation directory, no need to declare in package.json)
  • Architecture Pattern: Cordis plugin model; registers tools via ctx.tools.register in apply(ctx); inject: ['tools'] lets Cordis wait for dependencies to be ready
  • Entry File: examples/greet-tool/index.js

Use Cases

This is ideal for developers who are learning DSH plugin development and want to understand the complete workflow of "custom model tools". After reading the references/tools.md documentation, when you want a minimal example that can be directly run via dsh plugin add, install this example plugin and have an agent invoke the greet tool once. This will let you intuitively see the actual runtime effect of the three-stage pattern (parameters/execute/output). For production scenarios, please extend based on this example.

Prerequisites and Compatibility

DependencyMin VersionNotes
DSHNot declaredOnly depends on host-provided services, no engines declared in package.json
NodeNot declaredOnly uses ESM syntax, no engines declared in package.json
PlatformCross-platformPure JavaScript implementation, no native modules
Native ModulesNoneNo native dependencies in package.json

Installation

dsh plugin --profile web add github:zimodzh/dsh-plugin-dev-skills/examples/greet-tool

Configuration

This plugin requires no additional configuration. All behaviors (greeting prefix, parameter schema, return value) are directly written in the index.js source code, with no configuration options exposed.

FAQ

Q: Can I directly call the greet command in the terminal after installation?

A: No. greet is not a CLI subcommand, but a tool that models can invoke. You need to have an agent actively call it during a dsh conversation, for example by telling the agent "Use the greet tool to greet Ada." It will then invoke the tool and reply with "Hello, Ada!".

Q: Do I need to additionally install @deepseek-ai/dsh-tools to use this plugin?

A: No. That package is bundled with the DSH installation directory. The plugin can directly use it via import { defineTool } from '@deepseek-ai/dsh-tools' in index.js, without declaring it in package.json dependencies.

Q: What's the difference between this example and the hello-plugin example in the same repository?

A: hello-plugin is a minimal lifecycle example that only demonstrates Cordis plugin startup and automatic cleanup; greet-tool is a model-invokable tool example that demonstrates the three-stage pattern of defineTool (parameters, execute, output). The focus of the two examples is different; it's recommended to read both together.

Q: Can I make the greeting configurable?

A: Yes, but you need to modify the source code. The current implementation has the "Hello, " prefix hardcoded in execute. You can modify index.js to extract it to ctx.config, or refer to the upstream dsh-plugin-dev skill's references/config.md documentation for the standard approach.

Q: What does inject: ['tools'] mean in the plugin?

A: It tells the Cordis container to prepare the tools service before executing apply(ctx), preventing errors when the registry isn't ready during ctx.tools.register. This is the standard convention for writing tool-type plugins.

Q: Does it only take effect for the current profile after installation?

A: Yes. The --profile web specifies the target profile; the plugin will only be added to that profile's plugin list and won't affect other profiles.

Getting Started Difficulty

Beginner — The example itself only has 24 lines of code, one defineTool call plus a cordis.patch.yml. Successfully running it means you have mastered the standard skeleton of DSH tool plugins.

Known Issues and Limitations

  • The greeting format "Hello, " and return value template are both hardcoded in the execute function of index.js. There is no configuration reading or environment variable branching in the source code; modifying the prefix or concatenation logic requires changing the source code (evidence: examples/greet-tool/index.js:21)
  • The id: greet-tool and name: dsh-greet-tool in cordis.patch.yml are both hardcoded strings. If a plugin with the same name already exists in the user's environment, it will cause naming conflicts (evidence: examples/greet-tool/cordis.patch.yml:2-3)
  • No engines, peerDependencies, os, or cpu fields are declared in the source code. DSH version compatibility needs to be verified by the host side (evidence: examples/greet-tool/package.json:1-8)

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/zimodzh/dsh-plugin-dev-skills/examples/greet-tool)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory