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参数支持的插件开发者。

Package
@dsh-cc/command-usage
Compatibility
Unverified
Harness peer range
>=0.1.5-rc.1
Version
0.7.1
License
Apache-2.0
Last updated
Sep 16, 2026

Install

This plugin has no verified bundle, or compatibility checks failed. Read the repository notes first. Read the full 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.