@chanchi/cli
v1.1.1
Published
CLI for Chi
Readme
Chi CLI
A powerful command-line tool for quickly initializing modern web projects with your preferred tech stack.
Features
- 🚀 Interactive Setup: Step-by-step interactive prompts to configure your project
- 📦 Multiple Package Managers: Support for npm, yarn, pnpm, and bun
- ⚛️ Framework Support: React, Vue, Next.js, and Astro
- 🎨 CSS Tools: Tailwind CSS, SCSS, or plain CSS
- 📝 TypeScript/JavaScript: Choose your preferred language
- 🔧 Code Quality: Optional ESLint and Prettier configuration
- 🔄 Git Integration: Automatic Git repository initialization
Installation
Global Installation
npm install -g @chanchi/cli
# or
yarn global add @chanchi/cli
# or
pnpm add -g @chanchi/cli
# or
bun install -g @chanchi/cliLocal Development
# Clone the repository
git clone <repository-url>
cd chi-dev-cli
# Install dependencies (recommended)
bun install --frozen-lockfile
# Build the project
bun run buildUsage
Initialize a New Project
chi init [project-name]If you don't provide a project name, you'll be prompted to enter one.
Interactive Prompts
The CLI will guide you through the following steps:
- Project Name: Enter your project name (if not provided as argument)
- Package Manager: Choose from npm, yarn, pnpm, or bun
- Framework: Select React, Vue, Next.js, or Astro
- CSS Tool: Choose Tailwind CSS, SCSS, or plain CSS
- Language: Select TypeScript or JavaScript
- ESLint: Choose whether to include ESLint configuration
- Prettier: Choose whether to include Prettier configuration
Example
$ chi init my-awesome-project
✨ Starting project initialization...
? Select package manager: pnpm
? Select framework: Next.js
? Select CSS tool: Tailwind CSS
? Select language: TypeScript
? Do you need ESLint? Yes
? Do you need Prettier? Yes
✅ Project initialized successfully!
📝 Next steps:
cd my-awesome-project
pnpm install
pnpm devSupported Technologies
Package Managers
- npm
- yarn
- pnpm
- bun
Frameworks
- React: With Vite
- Vue: With Vite
- Next.js: Full Next.js setup
- Astro: Astro project structure
CSS Tools
- Tailwind CSS: With PostCSS and Autoprefixer
- SCSS: Sass/SCSS support
- CSS: Plain CSS
Languages
- TypeScript
- JavaScript
Code Quality Tools
- ESLint (optional)
- Prettier (optional)
Development
Prerequisites
- Node.js 18+
- Bun (recommended)
Scripts
# Install deps
bun install --frozen-lockfile
# Development mode (runs TypeScript directly)
bun run dev
# Build for production
bun run build
# Run built version
bun run startRelease / Publish (Maintainers)
This repo uses release-please to manage versions/tags/GitHub Releases, and a separate workflow to publish to npm automatically.
How it works
- Every push to
masterupdates/creates a Release PR (via GitHub Actions). - Merging the Release PR will:
- bump
package.jsonversion - update changelog content in the PR
- create a git tag (usually
vX.Y.Z) - create a GitHub Release
- bump
- When the GitHub Release is published, another workflow builds with Bun and runs
npm publish.
Requirements
- GitHub repo secret:
NPM_TOKEN- Create an npm Automation token and add it at: GitHub repo → Settings → Secrets and variables → Actions → New repository secret
Commit message convention (recommended)
release-please expects Conventional Commits to decide version bumps. For example:
feat: add new init option(minor)fix: handle empty project name(patch)feat!: change default template(major)
Note: the repo currently bootstraps release-please from a specific commit (see .release-please-config.json) to avoid parsing the older, non-conventional history.
Project Structure
Project Structure
chi-dev-cli/
├── src/
│ ├── cli.ts # Main CLI entry point
│ ├── commands/
│ │ └── init.ts # Init command implementation
│ └── utils/
│ ├── prompts.ts # Interactive prompts
│ ├── configGenerators.ts # Configuration file generators
│ └── projectGenerator.ts # Main project generator
├── templates/ # Project templates
├── dist/ # Build output
├── tsconfig.json # TypeScript configuration
├── tsup.config.ts # Build configuration
└── package.jsonHow It Works
- Prompts: The CLI uses
inquirerto collect user preferences - Configuration Generation: Based on selections, generates:
package.jsonwith appropriate dependencies- Framework-specific configuration files
- TypeScript configuration (if selected)
- CSS tool configuration (Tailwind/SCSS)
- ESLint and Prettier configs (if selected)
- Template Generation: Creates starter files based on the selected framework
- Git Initialization: Automatically initializes a Git repository
Generated Project Structure
The CLI generates a complete project structure based on your selections:
- React/Vue: Vite-based setup with proper entry points
- Next.js: App Router structure with layout and pages
- Astro: Astro pages structure
All projects include:
- Proper configuration files
- Starter component/page files
- CSS setup based on your choice
.gitignorefileREADME.mdwith setup instructions
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Commit Message Policy
This repo enforces Conventional Commits via:
- a local git hook (Husky + commitlint)
- a GitHub Action check on Pull Requests
If your PR check fails, rename/squash commits to follow the format (e.g. feat: ..., fix: ..., chore: ...).
License
MIT
Author
navelorange1999
