oiic
v0.0.1
Published
A tool to download template repositories from GitHub
Readme
OIIC
A command-line tool to download template repositories from GitHub with ease.
Features
- 🚀 Easy to use - Interactive command-line interface
- 📦 Template management - Download templates from GitHub
- 🔄 Remote template list - Fetch latest templates from remote server
- 🛡️ Error handling - Robust error handling and user feedback
- 🎨 Colorful output - Beautiful and informative terminal output
- 📝 TypeScript - Type-safe development
Quick Start
Prerequisites
- Node.js >= 18
- pnpm >= 8
Installation
# Install globally
pnpm add -g oiic
# Or install locally
pnpm add oiicUsage
# Create a new project with interactive prompt
oiic create <project-name>
# Create a new project with force overwrite
oiic create <project-name> --forceExamples
Basic usage
# Create a new project
oiic create my-project
# Follow the interactive prompt to select a template
# 🎯请选择一个项目模板进行创建~
# ❯ vue3-starter-simple
# admin-starter
# ts-starter
# uni-app-starterForce overwrite
# Create a new project with force overwrite
oiic create my-project -fCommands
| Command | Description |
| ---------------- | ---------------------------------- |
| oiic create | Create a new project from template |
| oiic --version | Show version information |
| oiic --help | Show help information |
Options
| Option | Description |
| --------------- | ---------------------------------- |
| -f, --force | Force overwrite existing directory |
| -v, --version | Show version information |
| -h, --help | Show help information |
Project Structure
oiic/
├── src/ # Source code
├── test/ # Test files
├── docs/ # VitePress documentation
├── dist/ # Build output
├── package.json # Package configuration
├── store.json # Default template store
├── tsconfig.json # TypeScript configuration
├── tsdown.config.ts # tsdown configuration
├── vitest.config.ts # Vitest configuration
└── eslint.config.js # ESLint configurationTemplate Store
The tool uses a template store to manage available templates. By default, it loads templates from store.json and tries to fetch the latest version from a remote server.
Adding Custom Templates
To add custom templates, edit the store.json file:
[
{
"name": "Template Name",
"value": "github:username/repository"
}
]Development
# Clone the repository
git clone https://github.com/oiij/oiic.git
cd oiic
# Install dependencies
pnpm install
# Start development mode with watch
pnpm dev
# Run the source code directly
pnpm start
# Type checking
pnpm type:checkBuilding
# Build the project
pnpm buildThe build output will be in the dist directory.
Testing
# Run tests
pnpm test
# Run tests with UI
pnpm test --uiLinting
# Lint code
pnpm lint
# Fix linting issues
pnpm lint:fixDocumentation
# Start documentation site in development mode
pnpm docs:dev
# Build documentation site
pnpm docs:build
# Preview built documentation site
pnpm docs:previewCommitting Changes
This project uses conventional commits with commitlint and cz-git.
# Stage changes and commit with interactive prompt
pnpm commit
# Or use commitizen directly
pnpm czPublishing
# Bump version and publish to npm
pnpm releaseScripts
| Script | Description |
| ------------------ | -------------------------------------------- |
| pnpm dev | Start development mode with watch |
| pnpm build | Build the project |
| pnpm start | Run source code directly |
| pnpm test | Run tests |
| pnpm lint | Lint code |
| pnpm lint:fix | Fix linting issues |
| pnpm type:check | Run TypeScript type checking |
| pnpm docs:dev | Start documentation site |
| pnpm docs:build | Build documentation site |
| pnpm commit | Interactive commit with conventional commits |
| pnpm release | Bump version and publish |
| pnpm update:deps | Update dependencies interactively |
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
pnpm commit) - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
