script
import { command, param } from 'clime';
@command()
export default class HelloWorldCommand {
execute(@param() name: string) {
console.log(`Hello, ${name}`);
}
}
script
import { command, option } from 'clime';
@command()
export default class EnableFeatureCommand {
execute(@option({ flag: 'e' }) enable: boolean) {
if (enable) {
console.log('Feature enabled');
} else {
console.log('Feature disabled');
}
}
}
script
import { commandGroup, CommandGroup } from 'clime';
@commandGroup({ description: 'Utility commands' })
export class UtilityCommandGroup extends CommandGroup {}
script
import { command, param, Command } from 'clime';
@command()
export default class ParentCommand extends Command {
@command()
child(@param() name: string) {
console.log(`Hello from child command, ${name}`);
}
}
shell
npm install clime --save
json
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}