npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

done-coding

v0.15.19

Published

done-coding命令行工具

Downloads

31

Readme

@done-coding/cli

done-coding 命令行工具集 - 提供完整的开发工作流支持

npm version License: MIT

安装

全局安装(推荐)

npm install -g @done-coding/cli
# 或使用 pnpm
pnpm add -g @done-coding/cli

本地安装

npm install @done-coding/cli
# 或使用 pnpm
pnpm add @done-coding/cli

快速开始

安装完成后,您可以使用以下命令启动:

安装后提示

根据您的操作系统,使用方式略有不同:

可用命令

根据 package.json 的 bin 配置,以下命令在所有系统中都可用:

# 主要命令(推荐)
DC [命令]           # 大写 DC 命令
dc-cli [命令]       # 完整 CLI 命令
done-coding [命令]  # 完整品牌命令

# 查看帮助
DC --help
dc-cli --help
done-coding --help

⚠️ 重要提示:

  • 推荐使用大写的 DC 命令,在所有系统中都可用
  • 可以使用 dc-clidone-coding 作为替代命令
  • 系统差异说明:
    • Windows 系统: 可以使用小写 dc 命令(系统对大小写不敏感且无系统dc命令)
    • macOS/Linux 系统: 不建议使用小写 dc 命令(避免与系统dc命令冲突)

功能特性

  • 统一入口: 集成 9 个专业工具包,提供统一的命令行入口
  • 🚀 跨平台兼容: 支持 Windows、macOS、Linux,自动处理系统差异
  • 🔧 模块化设计: 每个子包独立开发,可单独使用或集成使用
  • 📦 完整工作流: 涵盖项目创建、开发、构建、发布的完整流程
  • 🔄 包间协作: 智能的包间功能调用,如 config 包调用 git 包的合并检测

API 文档

@done-coding/cli 集成了多个工具,每个工具都专注于特定的开发任务:

🚀 项目创建

  • 命令: DC create [projectName]
  • 描述: 项目创建命令行工具
  • 包地址: create-done-coding
  • 选项:
    • -c, --justCloneFromDoneCoding: 是否仅仅从done-coding系列项目列表中克隆远程仓库

🔧 组件生成

⚙️ 工程配置

📤 信息提取

🔄 Git 操作

💉 信息注入

📦 项目发布

📝 模板处理

完整命令列表

基于实际 CLI 输出的命令

# 项目管理
DC create [projectName]                    # 创建新项目
DC create --justCloneFromDoneCoding       # 仅从done-coding系列项目克隆

# 组件管理
DC component add <name>                   # 新增组件
DC component remove [name]                # 删除组件
DC component list                         # 展示组件列表

# 工程化配置
DC config                                 # 工程化配置命令行工具

# 信息处理
DC extract                                # 信息提取命令行工具
DC inject                                 # 信息(JSON)注入命令行工具

# 模板处理
DC template                               # 预编译命令行工具

# Git 操作
DC git init                               # 初始化配置文件
DC git clone <platform> <username>       # 从选择的git平台克隆代码
DC git hooks <name> [args...]             # git钩子回调
DC git check <type>                       # 检查git操作

# 项目发布
DC publish                                # 项目发布命令行工具

使用替代命令

# 使用完整命令名
dc-cli [command]                          # 完整CLI命令
done-coding [command]                     # 完整品牌命令

使用示例

创建新项目

# 使用主要命令
DC create
DC create my-app
DC create --justCloneFromDoneCoding

# 使用替代命令
dc-cli create my-app
done-coding create my-app

组件管理

# 使用主要命令
DC component add Button
DC component remove Button
DC component list

# 使用替代命令
dc-cli component add Button
done-coding component list

Git 操作

# 使用主要命令
DC git init
DC git clone gitee username
DC git hooks pre-commit
DC git check reverse-merge

# 使用替代命令
dc-cli git init
done-coding git clone gitee username

模板处理

# 使用主要命令
DC template

# 使用替代命令
dc-cli template
done-coding template

项目发布

# 使用主要命令
DC publish

# 使用替代命令
dc-cli publish
done-coding publish

配置

您可以在项目根目录创建 .done-coding.config.js 文件来自定义配置:

export default {
  // 默认模板路径
  templatePath: "./templates",

  // 组件生成配置
  component: {
    defaultType: "react",
    outputDir: "./src/components",
  },

  // Git 配置
  git: {
    autoCommit: true,
    commitTemplate: "conventional",
  },
};

架构设计

done-coding CLI 采用模块化架构,每个子包都是独立的工具:

包依赖关系

graph TD
    A["@done-coding/cli"] --> B["create-done-coding"]
    A --> C["@done-coding/cli-component"]
    A --> D["@done-coding/cli-config"]
    A --> E["@done-coding/cli-extract"]
    A --> F["@done-coding/cli-git"]
    A --> G["@done-coding/cli-inject"]
    A --> H["@done-coding/cli-publish"]
    A --> I["@done-coding/cli-template"]
    A --> J["@done-coding/cli-utils"]

    D -.-> F

    style D fill:#e1f5fe
    style F fill:#e8f5e8

包间协作关系

  • @done-coding/cli-config@done-coding/cli-git:
    • config 包的 merge-lint 模块调用 git 包的 check reverse-merge 命令
    • 实现工程化配置中的 git 合并规范检测
  • 所有子包@done-coding/cli-utils:
    • 提供通用的 CLI 工具函数和类型定义
    • 统一的配置文件读取和命令行参数处理

目录结构

@done-coding/cli (主包)
├── create-done-coding (项目创建)
├── @done-coding/cli-component (组件生成)
├── @done-coding/cli-config (工程配置)
├── @done-coding/cli-extract (信息提取)
├── @done-coding/cli-git (Git 操作)
├── @done-coding/cli-inject (信息注入)
├── @done-coding/cli-publish (项目发布)
├── @done-coding/cli-template (模板处理)
└── @done-coding/cli-utils (工具库)

故障排除

常见问题

Q: 命令找不到

# 确保全局安装
npm list -g @done-coding/cli

# 重新安装
npm uninstall -g @done-coding/cli
npm install -g @done-coding/cli

Q: 权限错误

# macOS/Linux 使用 sudo
sudo npm install -g @done-coding/cli

# 或配置 npm 全局路径
npm config set prefix ~/.npm-global

Q: 版本冲突

# 清除缓存
npm cache clean --force

# 检查版本
DC --version

贡献指南

我们欢迎社区贡献!请查看各个子包的具体贡献指南:

许可证

MIT © JustSoSu

相关链接