Type-safe framework for building robust command-line applications.
A modular, full OOP framework built with TypeScript. It provides a structured architecture to define commands, manage subcommands, and handle CLI arguments with strict typing, enabling developers to build scalable command-line interfaces.
- Deno 1.40 or higher
Add the package to your project directly via JSR or by importing the source files:
deno add @prodbysolivan/interpreterImport the Interpreter or base Command classes into your project:
import { Command, Interpreter } from "@prodbysolivan/interpreter";
class GreetCommand extends Command {
constructor(parent: Interpreter) {
super({ parent, name: "greet", description: "Say hello to someone" });
this.onRun.connect((context) => {
console.log(`Hello, ${context.args.name}!`);
});
}
}
const myApp = new Interpreter({ name: "MyApp", version: "1.0.0" });
myApp.addToCommands(new GreetCommand(myApp));
myApp.run(Deno.args);For common issues regarding type definitions, ensure your deno.json is
configured correctly and your project is using strict mode.
Solivan (prodbysolivan)
This project is licensed under the MIT License - see the LICENSE file for details.