A TypeScript-based CLI tool built with Object-Oriented Programming principles. Provides mathematical operations and API integrations.
npm install
npm linkmycli <command> [arguments]Basic Arithmetic
mycli add 5 3 # Result: 8
mycli subtract 10 4 # Result: 6
mycli multiply 6 7 # Result: 42
mycli divide 20 4 # Result: 5
mycli modulo 17 5 # Result: 2Advanced Math
mycli power 2 8 # Result: 256
mycli sqrt 144 # Result: 12
mycli factorial 5 # Result: 120Statistics
mycli average 10 20 30 40 # Result: 25
mycli max 5 12 8 20 3 # Result: 20
mycli min 5 12 8 20 3 # Result: 3GitHub User Info
mycli github <username>
# Displays user profile, repositories, followers, and moreRandom Jokes
mycli joke
# Fetches a random joke from the internetPokemon Information
mycli pokemon pikachu
# Shows Pokemon name, height, and weightGreet
mycli greet Raman
# Greets you with a colorful messagemycommand/
├── cli.ts # Main entry point
├── cliEngine/
│ └── engine.ts # CLI Engine class
├── commands/
│ ├── addCommand.ts # Math operations
│ ├── subtractCommand.ts
│ ├── multiplyCommand.ts
│ ├── divideCommand.ts
│ ├── moduloCommand.ts
│ ├── powerCommand.ts
│ ├── squarerootCommand.ts
│ ├── factorialCommand.ts
│ ├── averageCommand.ts
│ ├── maxCommand.ts
│ ├── minCommand.ts
│ ├── githubCommand.ts # API integrations
│ ├── jokeCommand.ts
│ ├── pokeCommand.ts
│ └── greetCommand.ts # Utilities
└── package.json
Each command is a class with three key components:
- constructor(program) - Initializes with Commander instance
- register() - Registers command with CLI engine
- action methods - Implements command logic
The CLI Engine manages command registration and execution using OOP principles.
- TypeScript
- Commander.js (CLI framework)
- Axios (HTTP requests)
- Chalk (colored output)
npm install # Install dependencies
npx tsc # Compile TypeScript
npm link # Link globally