
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
mkly is a modern CLI framework focused on user experience, ease of use, and expressive, friendly command-line interfaces.
mkly is a modern CLI framework designed with a relentless focus on user experience, ease of use, and expressiveness. It empowers developers to build CLI tools that greet users with friendly, clear, and beautiful interfaces.
Time, Size, Paths, and JSON.npm install mkly
# or
bun add mkly
# or
yarn add mkly
The examples directory contains several usage patterns. Here are key highlights.
Quickly define a CLI with commands, arguments, and actions.
import { CLI } from 'mkly';
const cli = new CLI('greeter', '1.0.0');
cli
.command('greet')
.description('Greets a person')
.argument('name', { type: 'string' })
.argument('age', { type: 'number' })
.action((args) => {
// args is typed based on definitions
console.log(`Hello ${args.name}, you are ${args.age} years old`);
});
cli.run();
Run it:
$ mycli greet "John Doe" 30
Hello John Doe, you are 30 years old
Options can be defined with types, aliases, and default values. mkly handles the parsing and validation for you.
cli
.command('build')
.description('Builds the project')
.option('minify', {
type: 'boolean',
alias: ['m', 'min'],
defaultValue: false,
})
.option('target', {
type: 'number',
defaultValue: 18,
})
.action((_, opts) => {
console.log('Options:', opts);
});
Run it:
$ app build --minify -t 20
Options: { minify: true, target: 20 }
mkly comes with a powerful parser capable of handling various data types out of the box.
| Type | Description | Valid Input Examples |
|---|---|---|
boolean | Boolean flag | true, false, 1, 0, yes, no, on, off |
string | Text string | "foo", bar |
number | Numeric value | 42, 3.14 |
choice | Set of allowed values | "red", "green", "blue" |
path | File system path | ./src, /etc/config |
time | Duration or Date | 5s, 1h30m, 2025-01-01 |
size | Digital storage size | 10kb, 500mb, 1gb |
json | JSON object | {"key": "value"} |
Arrays: All types support array variants (e.g.,
stringArray,numberArray).
The time type is incredibly flexible. It supports:
100ms, 5s, 10m, 1.5h, 2d, 1w, 1mo, 1y1h30m, 2d12h2025-12-31, 2025-12-31 23:59 (parsed relative to now)The size type makes handling file sizes intuitive:
b, kb, mb, gb, tb, pb10kb (10240 bytes), 1.5gb, 500bOrganize complex tools (like git) using nested subcommands.
const remote = cli.command('remote').description('Manage remotes');
remote.command('add')
.argument('name', { type: 'string' })
.argument('url', { type: 'string' })
.action((args) => {
console.log(`Adding remote ${args.name} -> ${args.url}`);
});
remote.command('remove')
.argument('name', { type: 'string' })
.action((args) => {
console.log(`Removing remote ${args.name}`);
});
The repository includes a set of examples demonstrating different features. You can run them directly with Bun:
# Basic Hello World
bun examples/basic-hello.ts greet Parsa 25
# Options Demo
bun examples/options.ts build --minify --target 20
# Real World "Vite-like" CLI
bun examples/real-world.ts dev --port 8080
# Error Handling Demo
bun examples/errors.ts divide a 0
Thanks to these amazing people:
MIT © Kkotero
Issues and pull requests are welcome.
Built with ❤️ for great developer and user experiences.
FAQs
mkly is a modern CLI framework focused on user experience, ease of use, and expressive, friendly command-line interfaces.
We found that mkly demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.