ll-temp-cli
v1.0.2
Published
一个功能强大的前端脚手架工具
Maintainers
Readme
ll-temp-cli
一个功能强大的前端脚手架工具,支持从任意Git仓库下载项目模板。
特性
- 🚀 模板下载: 从任意Git仓库下载项目模板
- 🌐 多平台支持: 支持GitHub、GitLab、Gitee等主流代码平台
- 📁 灵活配置: 可指定下载到项目的特定目录
- 🏷️ 版本选择: 支持选择分支或标签版本
- 💬 交互式界面: 简洁的命令行界面和交互式参数输入
- ⚙️ 配置管理: 预设常用模板仓库和自定义设置
- 📊 实时进度: 实时进度显示和友好的错误提示
安装
# 全局安装
npm install -g ll-temp-cli
# 或者使用yarn
yarn global add ll-temp-cli使用方法
初始化新项目
# 交互式创建项目
ll-temp-cli init
# 使用指定模板创建项目
ll-temp-cli init hello-world
# 创建本地模板(无需网络连接)
ll-temp-cli init --template local
# 从自定义仓库创建项目
ll-temp-cli init https://github.com/user/repo
# 指定目标目录
ll-temp-cli init hello-world -d ./my-project
# 指定分支或标签
ll-temp-cli init https://github.com/user/repo -b develop
ll-temp-cli init https://github.com/user/repo --tag v1.0.0
# 跳过确认提示
ll-temp-cli init hello-world -y列出可用模板
# 查看所有可用模板
ll-temp-cli list
# 或
ll-temp-cli ls配置管理
# 打开配置管理界面
ll-temp-cli config配置管理功能包括:
- 查看当前配置
- 设置默认下载目录
- 添加自定义模板
- 删除模板
- 设置Git凭据
- 重置配置
预设模板
ll-temp-cli 内置了以下常用模板:
- hello-world: 简单的Hello World项目
- gitignore: Git忽略文件模板
- markdown-templates: Markdown模板集合
- local: 本地模板(无需网络连接)
本地模板特性
当选择"创建本地模板"时,工具会创建一个包含以下文件的完整项目:
package.json- 项目配置index.html- 主页面src/index.js- JavaScript入口文件src/style.css- 样式文件README.md- 项目说明.gitignore- Git忽略文件
配置
配置文件位置:~/.ll-temp-cli/config.json
默认配置
{
"defaultDownloadDir": "~/Projects",
"templates": [
{
"name": "react-vite",
"description": "React + Vite 项目模板",
"repository": "https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react",
"category": "react"
}
]
}开发
# 克隆仓库
git clone <repository-url>
cd ll-temp-cli
# 安装依赖
npm install
# 开发模式运行
npm run dev
# 构建项目
npm run build
# 全局安装本地版本
npm link许可证
MIT
贡献
欢迎提交 Issue 和 Pull Request!
故障排除
如果遇到字体或显示问题,请查看 故障排除指南。
常见解决方案:
- 设置环境变量
NO_COLOR=1禁用颜色输出 - 确保终端支持 Unicode 字符
- 在 CI/CD 环境中设置
CI=true
更新日志
v1.0.1
- 修复仓库验证问题
- 添加本地模板功能(无需网络连接)
- 改进错误处理和重试机制
- 优化预设模板配置
v1.0.0
- 初始版本发布
- 支持从Git仓库下载模板
- 交互式命令行界面
- 配置管理功能
- 兼容性优化,支持更多终端环境
