
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@bitkai/cli
Advanced tools
A modern, type-safe CLI framework for building command-line applications in TypeScript with interactive prompts and beautiful output.
npm install @bitkai/cli
import { CLI } from '@bitkai/cli';
const cli = new CLI({
name: 'mycli',
version: '1.0.0',
description: 'My awesome CLI tool'
});
cli.command('greet')
.description('Greet someone by name')
.argument('name', 'Name of the person to greet', {
type: 'text',
required: true
})
.option('loud', 'Print the greeting in uppercase', {
type: 'confirm',
default: false
})
.handler(async ({ args, options }) => {
let message = `Hello, ${args.name}!`;
if (options.loud) {
message = message.toUpperCase();
}
console.log(message);
});
cli.run();
@bitkai/cli provides a rich set of interactive prompts that automatically engage when required arguments are missing. This creates a user-friendly experience where users can be guided through the command inputs.
Example of how prompts work:
$ mycli init
? Project name: (required) my-project
? Select template: (Use arrow keys)
❯ typescript
javascript
react
const cli = new CLI({
name: string; // Name of your CLI application
version: string; // Version number
description: string; // Brief description
});
cli.command(name: string)
.description(description: string)
.argument(name: string, description: string, options?: ArgumentOptions)
.option(name: string, description: string, options?: OptionOptions)
.handler(handler: (context: CommandContext) => Promise<void>)
type ArgumentOptions = {
type: 'text' | 'number' | 'confirm' | 'list' | 'select';
required?: boolean;
initial?: any;
choices?: string[]; // For 'list' and 'select' types
}
type OptionOptions = {
type: 'text' | 'number' | 'confirm' | 'list' | 'select';
default?: any;
initial?: any;
choices?: string[]; // For 'list' and 'select' types
}
The action handler receives a context object with:
type CommandContext = {
args: Record<string, any>; // Parsed command arguments
options: Record<string, any>; // Parsed command options
raw: string[]; // Raw command-line arguments
}
cli.command('create')
.description('Create a new resource')
.argument('name', 'Resource name', {
type: 'text',
required: true,
initial: 'my-resource'
})
.argument('type', 'Resource type', {
type: 'select',
required: true,
choices: ['component', 'service', 'model']
})
.option('path', 'Output path', {
type: 'text',
default: './src'
})
.handler(async ({ args, options }) => {
const { name, type } = args;
const { path } = options;
console.log(`Creating ${type} "${name}" in ${path}`);
});
cli.command('config')
.description('Configure application settings')
.argument('settings', 'Settings to configure', {
type: 'list',
choices: ['database', 'api', 'logging', 'security'],
required: true
})
.option('environment', 'Target environment', {
type: 'select',
choices: ['development', 'staging', 'production'],
default: 'development'
})
.handler(async ({ args, options }) => {
const { settings } = args;
const { environment } = options;
console.log(`Configuring ${settings.join(', ')} for ${environment}`);
});
cli.command('deploy')
.description('Deploy the application')
.argument('stage', 'Deployment stage', {
type: 'select',
required: true,
choices: ['staging', 'production']
})
.argument('services', 'Services to deploy', {
type: 'list',
required: true,
choices: ['frontend', 'backend', 'database']
})
.option('force', 'Skip confirmation', {
type: 'confirm',
default: false
})
.handler(async ({ args, options }) => {
const { stage, services } = args;
const { force } = options;
console.log(`Deploying ${services.join(', ')} to ${stage}`);
});
Contributions are welcome! Please feel free to submit a Pull Request.
ISC
FAQs
A modern cli framework for building cli applications
We found that @bitkai/cli 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.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.