aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
134 lines • 5.89 kB
JavaScript
/**
* Help Command Handler
*
* Displays comprehensive CLI help information.
*
* @implements @.aiwg/architecture/decisions/ADR-001-unified-extension-system.md
* @source @src/cli/router.ts
* @issue #33
*/
import * as ui from '../ui.js';
/**
* Help command handler
*/
export const helpHandler = {
id: 'help',
name: 'Help',
description: 'Show CLI help message',
category: 'maintenance',
aliases: ['-h', '-help', '--help'],
async execute(_ctx) {
displayHelp();
return { exitCode: 0 };
},
};
/**
* Format a help group — bold header, aligned command/description pairs
*/
function helpGroup(title, commands) {
ui.header(` ${title}`);
const maxCmd = Math.max(...commands.map(([cmd]) => cmd.length));
for (const [cmd, desc] of commands) {
console.log(` ${ui.bold(cmd.padEnd(maxCmd + 2))}${ui.dimText(desc)}`);
}
console.log('');
}
/**
* Display comprehensive help information
*/
function displayHelp() {
ui.blank();
console.log(` ${ui.brandMark()} ${ui.bold('AIWG')}`);
ui.rule();
ui.blank();
console.log(` ${ui.dimText('Usage:')} aiwg ${ui.accent('<command>')} ${ui.dimText('[options]')}`);
ui.blank();
helpGroup('FRAMEWORK', [
['use <framework>', 'Deploy framework (sdlc, marketing, media-curator, research, forensics, security-engineering, ops, knowledge-base, all)'],
['list', 'List installed frameworks and addons'],
['remove <id>', 'Remove a framework or addon'],
]);
helpGroup('PROJECT', [
['new <name>', 'Create new project with SDLC templates'],
]);
helpGroup('WORKSPACE', [
['status', 'Show workspace health and installed frameworks'],
['migrate-workspace', 'Migrate legacy .aiwg/ to framework-scoped structure'],
['rollback-workspace', 'Rollback workspace migration from backup'],
]);
helpGroup('MCP SERVER', [
['mcp serve', 'Start AIWG MCP server (stdio transport)'],
['mcp install [target]', 'Generate MCP client config (claude, copilot, factory, cursor)'],
['mcp info', 'Show MCP server capabilities'],
]);
helpGroup('TOOLSMITH', [
['runtime-info', 'Show runtime environment summary'],
['runtime-info --discover', 'Full tool discovery and catalog generation'],
['runtime-info --check <tool>', 'Check specific tool availability'],
]);
helpGroup('CATALOG', [
['catalog list', 'List all models in catalog'],
['catalog info <id>', 'Show detailed model information'],
['catalog search <q>', 'Search models by query'],
]);
helpGroup('DISCOVERY', [
['discover "<phrase>"', 'Find skills/agents/commands/rules by capability'],
['show <type> <name>', 'Stream the body of an indexed artifact'],
['index <subcommand>', 'Manage the artifact index (build/query/discover/deps/stats)'],
]);
helpGroup('DISPATCH', [
['run skill <name>', 'Execute a script-bearing skill'],
['run <script-name>', 'Run a user-defined script from .aiwg/aiwg.config'],
]);
helpGroup('FEATURES', [
['features', 'Show optional feature install status'],
]);
helpGroup('VALIDATION', [
['validate-metadata [path]', 'Validate AIWG component metadata (defaults to agentic/code)'],
]);
helpGroup('SCAFFOLDING', [
['new-bundle <name>', 'Create project-local bundle (--type extension|addon|framework|plugin, --starter skill|rule|agent|minimal, --dry-run)'],
['new-extension <name>', 'Alias for new-bundle --type extension'],
['new-addon <name>', 'Alias for new-bundle --type addon'],
['new-framework <name>', 'Alias for new-bundle --type framework'],
['new-plugin <name>', 'Alias for new-bundle --type plugin'],
['add-agent <name>', 'Add agent to existing bundle'],
['add-command <name>', 'Add command to existing bundle'],
['add-skill <name>', 'Add skill to existing bundle'],
['scaffold-addon <name>', '[legacy] Use new-addon instead'],
['scaffold-framework <name>', '[legacy] Use new-framework instead'],
]);
helpGroup('PROMOTE', [
['promote <name>', 'Graduate project-local bundle to upstream (--to upstream|corpus, --dry-run, --cleanup)'],
]);
helpGroup('RALPH LOOP', [
['ralph "<task>"', 'Execute iterative task loop (--completion, --max-iterations)'],
['ralph-status', 'Check current loop status'],
['ralph-abort', 'Abort running loop'],
['ralph-resume', 'Resume interrupted loop'],
]);
helpGroup('MAINTENANCE', [
['doctor', 'Check installation health'],
['version', 'Show version and channel info'],
['refresh', 'Update AIWG and redeploy frameworks (formerly: sync)'],
['update', 'Check for updates'],
['help', 'Show this help message'],
]);
helpGroup('CHANNEL', [
['--use-dev [path]', 'Customize AIWG live from a local clone or fork'],
['--use-main', 'Switch to edge channel (bleeding edge)'],
['--use-stable', 'Switch back to stable npm package'],
]);
ui.rule();
ui.blank();
console.log(` ${ui.dimText('Providers:')} claude (default), copilot, factory, codex, cursor, opencode, warp, windsurf`);
ui.blank();
console.log(` ${ui.dimText('Examples:')}`);
console.log(` aiwg use sdlc ${ui.dimText('Install SDLC framework')}`);
console.log(` aiwg discover "deploy" ${ui.dimText('Find skills by capability')}`);
console.log(` aiwg show skill intake-wizard ${ui.dimText('Stream a skill body')}`);
console.log(` aiwg doctor ${ui.dimText('Check installation health')}`);
console.log(` aiwg refresh ${ui.dimText('Pull latest + redeploy frameworks')}`);
ui.blank();
}
//# sourceMappingURL=help.js.map