README
Houston
Your personal command center!
Houston is a new way to build command-line applications without having to use ugly method chaining.
Install
yarn add xba-houston
Usage
Creating a command is extremely simple. Here's a simple echo command:
export class CommandEcho extends CommandBase implements ICommand {
public function getName(): string {
return "echo";
}
public function getAliases(): string[] {
return ["e"];
}
public function getUsage(): string {
return "echo <your_string>";
}
public function execute(args: string[]): void {
console.log(args[0])
}
}
You can then get started by creating a Houston instance and passing in any string array for testing, and process.argv.slice(2)
for getting real command line input.
Then pass in an array of your commands. I'm working on instantiatiing commands via a directory and naming scheme as well.
import { Houston } from 'xba-houston';
new Houston(process.argv.slice(2), [new CommandEcho(), new CommandAdd()]);