A command-line tool to download template repositories from GitHub with ease.
- ๐ 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
- Node.js >= 18
- pnpm >= 8
# Install globally
pnpm add -g oiic
# Or install locally
pnpm add oiic# Create a new project with interactive prompt
oiic create <project-name>
# Create a new project with force overwrite
oiic create <project-name> --force# 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-starter# Create a new project with force overwrite
oiic create my-project -f| Command | Description |
|---|---|
oiic create |
Create a new project from template |
oiic --version |
Show version information |
oiic --help |
Show help information |
| Option | Description |
|---|---|
-f, --force |
Force overwrite existing directory |
-v, --version |
Show version information |
-h, --help |
Show help information |
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 configuration
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.
To add custom templates, edit the store.json file:
[
{
"name": "Template Name",
"value": "github:username/repository"
}
]# 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:check# Build the project
pnpm buildThe build output will be in the dist directory.
# Run tests
pnpm test
# Run tests with UI
pnpm test --ui# Lint code
pnpm lint
# Fix linting issues
pnpm lint:fix# Start documentation site in development mode
pnpm docs:dev
# Build documentation site
pnpm docs:build
# Preview built documentation site
pnpm docs:previewThis project uses conventional commits with commitlint and cz-git.
# Stage changes and commit with interactive prompt
pnpm commit
# Or use commitizen directly
pnpm cz# Bump version and publish to npm
pnpm release| 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 |
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