A simple Node.js CLI built with TypeScript, commander, axios, and chalk.
- Colored terminal output via
chalk - Input validation with helpful error messages
--version/-vflag support- OOP class structure (ApiClient, MathOps, PasswordGenerator, etc.)
- 14 commands spanning math, APIs, and utilities
- Node.js
20.x(LTS recommended) - npm
npm installCompile TypeScript to JavaScript:
npx tscOutput is generated in dist/.
After building:
node dist/devkit.js <command>npm linkThen run commands directly:
devkit <command>| Command | Description |
|---|---|
greet [name] |
Greet a user by name |
add <num1> <num2> |
Add two numbers |
subtract <num1> <num2> |
Subtract second number from first |
multiply <num1> <num2> |
Multiply two numbers |
divide <num1> <num2> |
Divide first number by second |
joke |
Fetch a random joke from the internet |
github <username> |
Fetch GitHub user info |
quote |
Fetch a random inspirational quote |
weather <city> |
Fetch current weather for a city |
coinflip |
Flip a coin — heads or tails? |
roll [sides] |
Roll a dice (default: 6 sides) |
fileinfo <filename> |
Show file size, path, and extension |
password [length] |
Generate a random secure password |
sysinfo |
Show basic system information |
devkit greet Ansh
devkit add 10 5
devkit subtract 20 8
devkit multiply 3 7
devkit divide 20 4
devkit joke
devkit github techcodie
devkit quote
devkit weather Delhi
devkit coinflip
devkit roll 20
devkit fileinfo package.json
devkit password 20
devkit sysinfo| API | Used For |
|---|---|
| GitHub REST API | User profile info |
| DummyJSON Quotes | Random quotes |
| Official Joke API | Random jokes |
| wttr.in | Weather data |
dividehandles division by zero and prints an error message.joke,github,quote, andweatherdepend on internet connectivity.rolldefaults to a 6-sided die if no argument is given.passworddefaults to 16 characters if no length is given.