| name | help-text-formatter |
| description | Generate formatted help text with examples, descriptions, sections, and consistent styling for CLI applications. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
| graph | {"domains":["domain:software-engineering"],"specializations":["specialization:cli-mcp-development"],"skillAreas":["skill-area:cli-design","skill-area:command-line-interface-tools"],"roles":["role:backend-engineer","role:platform-engineer"],"workflows":["workflow:feature-development"],"topics":["topic:developer-experience"]} |
Help Text Formatter
Generate formatted, user-friendly help text for CLI applications.
Capabilities
- Generate structured help text layouts
- Create command examples with descriptions
- Format options and arguments sections
- Implement custom help formatters
- Add color and styling support
- Generate man page compatible output
Usage
Invoke this skill when you need to:
- Create consistent help text formatting
- Add examples to command help
- Implement custom help renderers
- Generate documentation from help text
Inputs
| Parameter | Type | Required | Description |
|---|
| language | string | Yes | Target language (typescript, python, go) |
| commands | array | Yes | Command definitions with help text |
| styling | object | No | Color and formatting options |
Command Structure
{
"commands": [
{
"name": "deploy",
"description": "Deploy application to target environment",
"longDescription": "Deploy the application with optional configuration...",
"arguments": [
{ "name": "service", "description": "Service to deploy" }
],
"options": [
{ "flags": "-e, --env", "description": "Target environment" }
],
"examples": [
{ "command": "deploy api -e production", "description":
Generated Patterns
TypeScript Help Formatter
import chalk from 'chalk';
interface HelpSection {
title: string;
content: string | string[];
}
export function formatHelp(command: CommandDefinition): string {
const sections: HelpSection[] = [];
sections.push({
title: '',
content: command.description,
});
sections.push({
title: 'Usage',
content: ` $ ${command.name} ${formatUsage(command)}`,
});
if (command.arguments?.length) {
sections.push({
title: 'Arguments',
content: command.arguments.map(arg =>
` ${chalk.cyan(arg.name.padEnd(20))} ${arg.description}`
),
});
}
if (command.?.) {
sections.({
: ,
: command..(
),
});
}
(command.?.) {
sections.({
: ,
: command..(
),
});
}
(sections);
}
(): {
sections.( {
title = section.
? chalk..(section.) +
: ;
content = .(section.)
? section..()
: section.;
title + content;
}).();
}
Python Help Formatter
from typing import List, Optional
import textwrap
class HelpFormatter:
def __init__(self, width: int = 80, indent: int = 2):
self.width = width
self.indent = ' ' * indent
def format_command(self, command: dict) -> str:
sections = []
sections.append(command['description'])
usage = self._format_usage(command)
sections.append(f"Usage:\n{self.indent}{usage}")
if args := command.get('arguments'):
section = self._format_section('Arguments', args)
sections.append(section)
if opts := command.get('options'):
section = self._format_section('Options', opts)
sections.append(section)
if examples := command.get('examples'):
section = self._format_examples(examples)
sections.append(section)
return '\n\n'.join(sections)
() -> :
lines = []
item items:
name = item.get() item.get(, )
desc = item.get(, )
lines.append()
.join(lines)
() -> :
lines = []
ex examples:
lines.append()
lines.append()
lines.append()
.join(lines).rstrip()
() -> :
parts = [command[]]
arg command.get(, []):
arg.get(, ):
parts.append()
:
parts.append()
parts.append()
.join(parts)
Workflow
- Analyze commands - Review command definitions
- Structure sections - Organize help content
- Format content - Apply styling and layout
- Add examples - Include usage examples
- Generate output - Create final help text
Best Practices Applied
- Consistent section ordering
- Appropriate indentation
- Color coding for clarity
- Example-driven documentation
- Terminal width awareness
- Screen reader friendly
Target Processes
- cli-documentation-generation
- argument-parser-setup
- cli-command-structure-design