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

@dsh-cc/command-usage

Shared help-argument support for slash commands: isHelpRequest, formatCommandHelp, and the helpable() registration wrapper 适合为命令添加确定性help参数支持的插件开发者。

패키지
@dsh-cc/command-usage
호환성
미검증
Harness peer 범위
>=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.