crewai-ts
Version:
TypeScript port of crewAI for agent-based workflows
27 lines (26 loc) • 732 B
JavaScript
/**
* Base command class for CLI commands.
* Optimized for extensibility and type safety.
*/
export class Command {
/**
* Parse and validate command arguments
* @param args Command line arguments
*/
parseArgs(args) {
// Base implementation can be overridden by specific commands
return {};
}
/**
* Format and show command help
*/
showHelp() {
console.log(`\n${this.name} - ${this.description}\n`);
console.log(`Syntax: ${this.name} ${this.syntax}\n`);
if (this.examples.length > 0) {
console.log('Examples:');
this.examples.forEach(example => console.log(` ${example}`));
console.log('');
}
}
}