cli-scaffold-generator

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

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "cli-scaffold-generator" with this command: npx skills add sunshine-del-ux/cli-scaffold-generator

CLI Scaffold Generator

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

功能

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

支持的框架

框架说明流行度
Commander.jsNode.js CLI 标准⭐⭐⭐⭐⭐
yargs参数解析强大⭐⭐⭐⭐
oclifSalesforce 出品⭐⭐⭐⭐
InkReact-based CLI⭐⭐⭐

使用方法

基本用法

# 使用 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, -fCLI 框架 (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

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

入口文件

#!/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();

本地测试

cd my-cli
npm link
my-cli greet World

发布到 npm

npm login
npm publish

变现思路

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

安装

# 无需额外依赖

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Skill Scaffold

AI agent skill scaffolding CLI. Create skills for OpenClaw, Moltbot, Claude, Cursor, ChatGPT, Copilot instantly. Vibe-coding ready. MCP compatible.

Registry SourceRecently Updated
4.1K2Profile unavailable
Security

Skillsmith

Scaffold a new OpenClaw skill project with starter docs, tests, fixtures, and optional security workflow.

Registry SourceRecently Updated
1310Profile unavailable
Coding

Python Script Generator

生成专业的 Python 脚本和应用模板,支持 CLI 工具、Flask API、FastAPI、Django Command、Scraper 等,一键生成完整项目代码。

Registry SourceRecently Updated
2.7K1Profile unavailable
Coding

agentcli-go

agentcli-go framework reference for building Go CLI tools. Use when working on agentcli-go itself, scaffolding new CLI projects, adding commands, integrating...

Registry SourceRecently Updated
5940Profile unavailable