
badai147/dsh-global-rules
40Last commit Aug 15, 2026
dsh-global-rules DSH plugin
This plugin adds a 'Global Rules' tab to the DSH web settings panel, letting you view and edit the AGENTS.md file directly in the browser. Changes are saved to disk and take effect immediately for new sessions; existing sessions pick them up on the next file operation.
How to install the dsh-global-rules DSH plugin
dsh plugin --profile web add dsh-global-rulesCopying does not run this command. Review the repository and version before installing the dsh-global-rules DSH plugin.
dsh-global-rules DSH plugin data source
dsh-global-rules DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-global-rules DSH plugin can do
- Adds a 'Global Rules' section in the web settings panel that loads the current content of ~/.dsh/AGENTS.md
- Saves edits to the file with real-time effect: new sessions use the updated rules immediately
- Automatically creates the file if it doesn't exist when saving
- Provides HTTP routes (GET and POST) with same-origin validation and a 256 KiB size limit
- Zero-build client bundle (hand-written __ModuleLoader__ load) and pure Node ESM host
Where the dsh-global-rules DSH plugin fits
- Quickly edit global rules without leaving the web UI or using a terminal
- Apply new rules to all future sessions instantly
- Trigger rule updates in the current session after the next file system tool call
- Create the initial AGENTS.md file from scratch via the settings panel
- Tweak agent instructions on the fly when developing or testing different behaviors
Who the dsh-global-rules DSH plugin is for
- DSH users who primarily use the web interface and want a graphical way to manage global rules
- Advanced users who frequently adjust global rules and need a fast, in-browser editor
dsh-global-rules DSH plugin limitations
- Only available in the DSH web settings panel; not usable from the command line or other profiles
- Current sessions do not see changes until the next file system tool call (e.g., using file I/O in the agent)
- File size is limited to 256 KiB when saving via the plugin
- Requires DSH to be running with the web profile and the plugin installed
dsh-global-rules DSH plugin: from the repository README
Quoted from the badai147/dsh-global-rules README, the upstream source of the dsh-global-rules DSH plugin. Copyright remains with the original authors.
在 DeepSeek Harness Web 的设置面板中编辑 `~/.dsh/AGENTS.md`(全局规则)的插件。 Edit your `~/.dsh/AGENTS.md` (global rules) from the DeepSeek Harness web settings panel.  ## 功能 / Features - 设置页新增「全局规则」标签:打开即加载 `~/.dsh/AGENTS.md` 当前内容 - 编辑保存,实时生效:**新会话立即生效**;当前会话在下次文件操作后感知新规则(由 DSH 内置的 `dsh-agent-instructions` 动态检测机制完成) - 文件不存在时保存会自动创建 - 零构建:Client 端为手写 `__ModuleLoader__` bundle,Host 端为纯 Node ESM ## 安装 / Install ```sh dsh plugin --profile web add dsh-global-rules ``` 从 GitHub 源安装(备选): ```sh dsh plugin --profile web add github:badai147/dsh-global-rules ``` 重启 `dsh web`,然后打开 **设置 → 全局规则**。 ## 使用 / Usage 1. 打开设置 → 全局规则 2. 编辑规则内容(Markdown 格式,与 `AGENTS.md` 语法一致) 3. 点击「保存」 保存后: - 新会话:首次步骤直接读取新内容,立即生效 - 当前会话:下一次文件系统工具调用后,DSH 会检测到文件变化并注入 "Updated instructions from: ~/.dsh/AGENTS.md",模型按新规则执行 ## 工作原理 / How it works - **Host**(`lib/index.js`):注册 `GET /global-rules`(读文件)与 `POST /global-rules`(写文件,同源校验 + 256 KiB 上限)两个 HTTP 路由 - **Client**(`lib/client.js`):手写 `window.__ModuleLoader__.load` bundle,注册 `settings.section` 的「全局规则」页面 - **生效机制**:DSH 内置 `dsh-agent-instructions` 插件覆盖 `user-global` scope 的动态检测——无需插件做任何热重载 ## 目录结构 / Structure ``` dsh-global-rules/ ├── cordis.patch
Read the full READMERepository license: MIT
dsh-global-rules DSH plugin questions
How do I install the global rules plugin?
Run `dsh plugin --profile web add dsh-global-rules` in your terminal. If you prefer to install from GitHub, use `dsh plugin --profile web add github:badai147/dsh-global-rules`. After installation, restart `dsh web` and open Settings → Global Rules.
Will editing global rules affect my current conversation?
New conversations will immediately start with the updated rules. For already running conversations, the changes will be picked up the next time the agent uses a file system tool (e.g., reading or writing a file). DSH automatically detects the file change and injects the updated instructions.
What happens if the AGENTS.md file doesn't exist?
If you save through the plugin and the file doesn't exist, it will be automatically created at ~/.dsh/AGENTS.md. The plugin writes the file with the content you provided in the editor.
Can I use this plugin from the command line?
No, this plugin is designed exclusively for the DSH web profile. It adds a UI section in the settings panel accessible via the browser. If you want to edit global rules from the command line, you can manually edit the file with any text editor, but the plugin provides a convenient graphical interface.
Is there a file size limit for the global rules?
Yes, the plugin enforces a 256 KiB limit when saving via the web interface. This is a safety measure to prevent overly large rules from being uploaded. If your rules exceed this limit, consider reducing them or editing the file directly with a different tool.