Skip to content
Back to skills

Cli Scaffold Generator

ASecurity

生成专业 CLI 脚手架,支持 Commander.js, yargs, oclif 等主流 CLI 框架,一键生成完整项目结构。

  • 21 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 7, 2026
toolsjavascriptjavabashreactnodegit

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill cli-scaffold-generator --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cli Scaffold Generator?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cli Scaffold Generator
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-cli-scaffold-generator/badge)](https://www.skillsdirectory.com/skills/modbender-cli-scaffold-generator)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cli-scaffold-generator
description: 生成专业 CLI 脚手架,支持 Commander.js, yargs, oclif 等主流 CLI 框架,一键生成完整项目结构。
metadata: {"clawdbot":{"emoji":"🖥️","requires":{},"primaryEnv":""}}
---

# CLI Scaffold Generator

快速生成专业的 CLI 应用程序脚手架。

## 功能

- ⚡ 快速生成项目结构
- 📝 支持多种 CLI 框架
- 🎯 完整的命令模板
- 📖 自动生成帮助文档
- 🧪 测试模板
- 📦 发布到 npm

## 支持的框架

| 框架 | 说明 | 流行度 |
|------|------|--------|
| Commander.js | Node.js CLI 标准 | ⭐⭐⭐⭐⭐ |
| yargs | 参数解析强大 | ⭐⭐⭐⭐ |
| oclif | Salesforce 出品 | ⭐⭐⭐⭐ |
| Ink | React-based CLI | ⭐⭐⭐ |

## 使用方法

### 基本用法

```bash
# 使用 Commander 生成 CLI
cli-scaffold-generator my-cli --framework commander

# 使用 yargs
cli-scaffold-generator my-tool --framework yargs

# 指定描述
cli-scaffold-generator my-app --framework commander --description "My awesome CLI tool"
```

### 选项

| 选项 | 说明 |
|------|------|
| `--framework, -f` | CLI 框架 (commander/yargs/oclif/ink) |
| `--description, -d` | 项目描述 |
| `--author` | 作者名称 |
| `--output, -o` | 输出目录 |

## 生成的项目结构

```
my-cli/
├── bin/
│   └── my-cli.js       # 入口文件
├── lib/
│   └── command.js       # 命令实现
├── test/
│   └── index.test.js   # 测试文件
├── package.json
├── README.md
└── .gitignore
```

## 包含的功能

- ✅ 命令行参数解析
- ✅ 帮助信息自动生成
- ✅ 子命令支持
- ✅ 选项和标志
- ✅ 错误处理
- ✅ 彩色输出

## 示例输出

### package.json

```json
{
  "name": "my-cli",
  "version": "1.0.0",
  "description": "My awesome CLI tool",
  "bin": {
    "my-cli": "./bin/my-cli.js"
  },
  "scripts": {
    "test": "jest"
  }
}
```

### 入口文件

```javascript
#!/usr/bin/env node
const { Command } = require('commander');
const program = new Command();

program
  .name('my-cli')
  .description('My awesome CLI tool')
  .version('1.0.0');

program
  .command('greet')
  .description('Greet someone')
  .argument('<name>', 'Name to greet')
  .action((name) => {
    console.log(`Hello, ${name}!`);
  });

program.parse();
```

## 本地测试

```bash
cd my-cli
npm link
my-cli greet World
```

## 发布到 npm

```bash
npm login
npm publish
```

## 变现思路

1. **CLI 工具模板** - 销售专业 CLI 模板
2. **定制开发** - 为企业定制 CLI 工具
3. **培训课程** - CLI 开发教程
4. **工具库** - 收集常用 CLI 工具打包出售

## 安装

```bash
# 无需额外依赖
```

Files in this skill

  • SKILL.md2.8 KB
  • cli-scaffold-generator.sh2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.