dsh-cc/dsh-cc--packages-interaction-command-usage ↗★ 1

@dsh-cc/command-usage

斜杠命令共享的帮助参数支持,含判断、格式化与注册包装。 适合为命令添加确定性help参数支持的插件开发者。

套件
@dsh-cc/command-usage
相容性
待驗證
Harness 依賴範圍
>=0.1.5-rc.1
版本
0.7.1
授權
Apache-2.0
最近更新
2026年9月16日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@dsh-cc/command-usage

English | 中文

Shared help-argument support for slash commands: every wrapped command answers a trailing help, -h, or --help argument with deterministic plain-text help rendered from its own metadata — no model turn, no coupling to the command runtime.

Usage

import { helpable } from '@dsh-cc/command-usage'

const command = helpable({
  name: 'provider',
  description: 'Manage LLM provider routes and API keys',
  input: { hint: '[list | add 
]' },
  handler,
}, { subcommands, notes })
  • isHelpRequest(rawInput) — whether the trailing argument is a help request.
  • formatCommandHelp(spec) — render the canonical plain-text help layout.
  • helpable(def, extras?) — wrap a command definition; help requests return formatted help, everything else delegates untouched.

The original definition is never mutated.

Usage

import { helpable } from '@dsh-cc/command-usage'

const command = helpable({
  name: 'provider',
  description: 'Manage LLM provider routes and API keys',
  input: { hint: '[list | add 
]' },
  handler,
}, { subcommands, notes })
  • isHelpRequest(rawInput) — whether the trailing argument is a help request.
  • formatCommandHelp(spec) — render the canonical plain-text help layout.
  • helpable(def, extras?) — wrap a command definition; help requests return formatted help, everything else delegates untouched.

The original definition is never mutated.