Skip to main content

hello/examples/hello

20Stars5Forks0Issues1Watchers

A sample hello-world plugin demonstrating plugin development basics.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki

ⓘ This plugin is a sub-package of the agi-fans/oh-my-dsh monorepo — stars and activity count the whole repository.

Language
TypeScript
License
MIT
Branch
main
coding-agentdeepseekdeepseek-harnessdshdsh-plugindsh-pluginsharnessoh-my-pi

Install

cmdweb profile
$ dsh plugin --profile web add github:agi-fans/oh-my-dsh#path:examples/hello

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 agi-fans/oh-my-dsh/examples/hello for me: review the repository at https://github.com/agi-fans/oh-my-dsh 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.

一句话定位

oh-my-dsh 仓库自带的一份最小可安装 bundle,唯一作用是在 omdsh 命令面板里注册一条 /hello 斜杠命令,用于演示"插件如何接入宿主"的最短路径。

核心能力

  • 注册一条 /hello 斜杠命令,调用后输出一行确认通知
  • 通过宿主提供的 commands 服务完成命令挂载,不重复打包 Cordis 或 dsh-commands
  • 在重启 omdsh 后让命令出现在 /help 列表里,作为插件是否正确加载的探针
  • 作为可拷贝的 bundle 起点,配合官方教程扩展为真实功能
  • 通过 cordis.patch.yml 在空 Profile 根上插入一行,避免污染既有层

技术实现

  • 语言: JavaScript (ESM)
  • 关键依赖: @deepseek-ai/cordis ^4.0.1、@deepseek-ai/dsh-commands ^0.1.0-rc.8(均为 peerDependency,由宿主提供)
  • 架构模式: Cordis bundle + ctx.effect 副作用注册;通过 cordis.patch.yml 在 Profile 根插入一行;inject = ['commands'] 声明对宿主 commands 服务的依赖
  • 入口文件: index.js(导出 name / inject / apply,在 apply 内调用 ctx.commands.register)

适用场景

  • 第一次接触 omdsh 插件机制的开发者,把目录拷一份改成自己的命令
  • 想验证 omdsh 的插件挂载链路是否通畅,比如发版后跑一次 /hello 确认 bundle 已被识别
  • 给团队或文档准备一段"20 行就能写完"的最小可行示例代码

前置依赖与兼容性

依赖最低版本说明
DeepSeek Harness (omdsh)>= 0.1.0-rc.8由 peerDependencies 中的 @deepseek-ai/dsh-commands ^0.1.0-rc.8 推导
@deepseek-ai/cordis^4.0.1peerDependency,由宿主 Profile 的 node_modules 提供
@deepseek-ai/dsh-commands^0.1.0-rc.8peerDependency,提供 commands.register 服务
Node.js未声明package.json 未声明 engines
平台跨平台未声明 os/cpu 限制

安装方式

dsh plugin --profile web add github:agi-fans/oh-my-dsh/examples/hello

配置项

本插件无需额外配置。

常见问题

Q: 这个插件装上后能直接用吗?

A: 装上后必须重启 omdsh,新命令才会被识别。重启后输入 /hello,界面会打印 Hello from @agi-fans/omdsh-plugin-hello.。

Q: /hello 之外还能做什么?

A: 没有了。这个 bundle 只注册了一条命令,README 也明确写明它不贡献 TUI 界面、主题、overlay 或工具。

Q: 装这个示例会不会影响我的其他插件?

A: 不会。cordis.patch.yml 只在空 Profile 根上插入一行名为 omdsh-hello 的层,不动既有插件层,移除时执行 omdsh plugin remove @agi-fans/omdsh-plugin-hello 即可。

Q: 我想基于它写自己的命令,应该改哪里?

A: 改 index.js 里的 ctx.commands.register 调用,新增或重命名命令;同步修改 cordis.patch.yml 里的 id 和 name,避免和示例冲突。

Q: 为什么 dependencies 是空的?

A: 官方插件规约要求 @deepseek-ai/* 必须作为与宿主同版本的 peerDependencies,避免嵌套多份 Cordis 或 dsh-commands。本 bundle 严格遵循该约束。

Q: 报错说找不到 commands 服务怎么办?

A: 大概率是宿主 omdsh 版本低于 0.1.0-rc.8,或者没装 @deepseek-ai/dsh-commands。先升级宿主并重启,再重新 omdsh plugin add。

上手难度

入门 — 整份 bundle 只 23 行代码、一个 patch 文件,是理解 omdsh 插件机制的最小例子。

已知问题与限制

  • 不贡献 TUI、主题、overlay、工具注册,仅作为示例与挂载探针
  • 命令名 hello 是固定的硬编码字符串,缺少可配置入口
  • 任何兼容性问题需通过宿主 omdsh 升级解决,bundle 自身不声明降级路径

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/agi-fans/oh-my-dsh/examples/hello)

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