Modules can export metadata to customize their group name and description.
By default, the group name comes from the filename. Override it with __module__:
// website.ts
export const __module__ = {
group: 'web', // Override "website"
description: 'Website deployment tools'
};
export const build: CommandoCommand = { ... };
export const deploy: CommandoCommand = { ... };Result: Commands under cmdo web build, not cmdo website build
Without __module__, group name derives from filename:
// website.ts
export const build = { ... };Result: cmdo website build (group = "website")
Set group: false for top-level commands:
// utils.ts
export const __module__ = {
group: false // No grouping
};
export const version: CommandoCommand = { ... };
export const config: CommandoCommand = { ... };Result:
cmdo version(notcmdo utils version)cmdo config(notcmdo utils config)
export interface ModuleMetadata {
group?: string | false; // Group name, or false for top-level
description?: string; // Group description (for help)
}// website-deployment.ts
export const __module__ = {
group: 'website',
description: 'Website deployment commands'
};
export const build = { ... };
// Usage: cmdo website build// core.ts
export const __module__ = {
group: false // Disable grouping
};
export const version = { ... };
export const help = { ... };
// Usage: cmdo version, cmdo help// examples.ts
export const __module__ = {
group: 'examples',
description: 'Example command patterns'
};
export default {
hello: { ... },
deploy: { ... }
};When user runs cmdo examples --help, they see the description.
Modules declared in config.yml use their metadata:
# .commando/config.yml
modules:
- ./website # Uses __module__ if present, else "website"
- ./examples # Uses __module__ if present, else "examples"
- ./utils # If __module__: { group: false }, goes top-level✅ Optional - Works without __module__ (uses filename)
✅ Flexible - Rename groups or disable grouping
✅ Descriptive - Add help text for groups
✅ Type-safe - TypeScript validates structure
- Auto-Discovery - How commands are discovered
- Subcommand Groups - How grouping works