A powerful CLI tool built with Node.js + TypeScript using Object-Oriented Programming concepts. Features 12 unique commands, 3 API integrations, colored output, input validation, and more!
SESD Workshop 2 — CLI Project Submission
- Node.js v18+ installed
- npm installed
# Clone the repository
git clone https://github.com/Ishiezz/cli-devkit-ts.git
cd cli-devkit-ts
# Install dependencies
npm install
# Compile TypeScript
npx tsc
# (Optional) Link globally so you can use `mycli` anywhere
npm link| Technology | Purpose |
|---|---|
| TypeScript | Type-safe language |
| Commander.js | Command routing & argument parsing |
| Chalk v4 | Colored terminal output |
| Axios | HTTP requests to APIs |
| Node.js crypto | Hashing & password generation |
BaseCommand (Abstract Class)
├── GitHubCommand
├── WeatherCommand
├── JokeCommand
├── PasswordCommand
├── HashCommand
├── ColorCommand
├── CountdownCommand
├── AgeCommand
├── DiceCommand
├── FlipCommand
├── EncodeCommand
└── DecodeCommand
ApiService (Abstract Class)
├── GitHubService → api.github.com
├── WeatherService → api.open-meteo.com
└── JokeService → v2.jokeapi.dev
CLIApp (Controller)
└── Registers & routes all commands
| API | Command | What it does |
|---|---|---|
| GitHub API | mycli github <username> |
Fetches public profile info |
| Open-Meteo | mycli weather <city> |
Current weather report |
| JokeAPI | mycli joke |
Random programming joke |
# GitHub user profile card
mycli github torvalds
# Current weather for a city
mycli weather Delhi
# Random programming joke
mycli joke# Generate a secure password (default 16 chars)
mycli password 20
mycli password 12 --no-symbols
# Hash text (default: sha256)
mycli hash "hello world"
mycli hash "hello world" -a md5
# Preview a hex color in terminal
mycli color ff6347
mycli color "#3498db"
# Base64 encode
mycli encode "Hello World!"
# Base64 decode
mycli decode "SGVsbG8gV29ybGQh"# Start a countdown timer (seconds)
mycli countdown 10
# Calculate exact age from birthdate
mycli age 2000-05-15
# Roll dice (default: 6 sides, 1 die)
mycli dice
mycli dice 20 -c 5
# Flip a coin
mycli flip# Show version
mycli --version
mycli -v
# Show help
mycli --help
mycli help <command>- ✅ Colored CLI output — chalk-powered beautiful output with emojis
- ✅ Input validation — every command has a
validate()method - ✅ Flags/Options — e.g.
--no-symbols,-a md5,-c 5 - ✅ Help descriptions — auto-generated by Commander.js
- ✅ Version command —
mycli -v - ✅ OOP structure — Abstract base classes with inheritance
cli-devkit-ts/
├── index.ts # Entry point — registers all commands
├── CLIApp.ts # Main CLI application class
├── BaseCommand.ts # Abstract base command class
├── commands.ts # All 12 command class implementations
├── services.ts # All 3 API service classes
├── package.json
├── tsconfig.json
├── .gitignore
└── dist/ # Compiled JavaScript output
Isha Singh