devstarter-tool
v0.3.0
Published
CLI to generate projects with best practices (basic or monorepo)
Downloads
262
Maintainers
Readme
devstarter-tool
CLI to generate projects with best practices and predefined configurations.
Features
- Project scaffolding: Create frontend, backend, or monorepo projects in seconds
addcommand: Add features like ESLint, Vitest, Prettier, CI, Docker, and Tailwind CSS to existing projects- Interactive prompts: Guided project creation or flag-based configuration
- Automatic dependency installation: No need to run
npm installmanually - Package manager detection: Automatically uses npm, pnpm, or yarn
- Git initialization: Optional repository setup
- Dry-run mode: Preview changes before creating files
Installation
npm install -g devstarter-toolOr run directly with npx:
npx devstarter-tool init my-appQuick Start
# Interactive mode - guided setup
devstarter init
# Quick project with defaults
devstarter init my-app -y
# Frontend project with Vitest
devstarter init my-app --type frontend --vitest
# Add features to an existing project
devstarter add prettier
devstarter add eslint
devstarter add tailwind
devstarter add docker
devstarter add ci
# Preview without creating files
devstarter init my-app --dry-runCommands
devstarter init
Scaffolds a new project from a template.
devstarter init [project-name] [options]| Option | Description |
|--------|-------------|
| -y, --yes | Use default values without prompting |
| -t, --type <type> | Project type: frontend or backend |
| --template <name> | Template to use (e.g., basic, react) |
| --vitest | Add Vitest for testing |
| --no-git | Skip Git repository initialization |
| --no-vitest | Skip Vitest testing framework setup |
| --dry-run | Preview changes without creating files |
Examples
# Full interactive mode
devstarter init
# Create project with specific name
devstarter init my-app
# Frontend with React template
devstarter init my-app --type frontend --template react
# Backend with testing setup
devstarter init my-api --type backend --vitest
# Quick frontend with all defaults
devstarter init my-app --type frontend -y
# Create without Git
devstarter init my-app --no-gitdevstarter add
Adds features to an existing project. Automatically detects features already configured and skips them.
devstarter add [feature] [options]| Option | Description |
|--------|-------------|
| --list | List all available features |
| -y, --yes | Add all available features without prompting |
| --dry-run | Show what would be added without making changes |
Available Features
| Feature | Description | What it adds |
|---------|-------------|--------------|
| eslint | Linter for JavaScript and TypeScript | eslint.config.js, lint script, ESLint + typescript-eslint deps |
| vitest | Unit testing framework | vitest.config.ts, test scripts, Vitest dep |
| prettier | Code formatter | .prettierrc, format script, Prettier dep |
| ci | CI/CD pipeline | GitHub Actions workflow (.github/workflows/ci.yml) or GitLab CI (.gitlab-ci.yml) with lint, test, and build steps |
| docker | Docker containerization | Dockerfile (multi-stage build), docker-compose.yml, .dockerignore. Auto-detects frontend (nginx) vs backend (node) |
| tailwind | Tailwind CSS v4 | tailwindcss + @tailwindcss/vite deps, Vite plugin config, @import "tailwindcss" in CSS |
Examples
# Add a specific feature
devstarter add prettier
devstarter add eslint
devstarter add vitest
devstarter add tailwind
devstarter add docker
devstarter add ci
# Interactive mode - choose from available features
devstarter add
# Add all available features at once
devstarter add -y
# List available features
devstarter add --list
# Preview changes
devstarter add prettier --dry-runProject Structures
Basic (single project)
my-app/
├── src/
│ └── main.ts
├── package.json
├── tsconfig.json
├── vitest.config.ts # if --vitest
├── node_modules/
└── .git/ # if git initializedMonorepo (full-stack)
my-app/
├── apps/
│ ├── web/ # frontend template
│ │ ├── src/
│ │ ├── package.json
│ │ └── vitest.config.ts
│ └── api/ # backend template
│ ├── src/
│ ├── package.json
│ └── vitest.config.ts
├── packages/
│ └── shared/ # shared code
├── package.json
├── pnpm-workspace.yaml
├── tsconfig.base.json
└── README.mdAvailable Templates
Frontend
| Template | Description |
|----------|-------------|
| basic | Vite + TypeScript |
| react | React 18 + Vite + TypeScript |
Backend
| Template | Description |
|----------|-------------|
| basic | Express + TypeScript |
Requirements
- Node.js 18+
- npm, pnpm, or yarn
Development
# Clone repository
git clone https://github.com/abraham-diaz/devstarter-cli.git
cd devstarter-cli
# Install dependencies
npm install
# Build
npm run build
# Run locally
node dist/cli.js init test-app --dry-runScripts
| Script | Description |
|--------|-------------|
| npm run build | Compile TypeScript and copy templates |
| npm run dev | Watch mode for development |
| npm run test | Run tests in watch mode |
| npm run test:run | Single test run |
| npm run test:coverage | Coverage with HTML + text reports |
| npm run lint | Run ESLint |
| npm run format | Format code with Prettier |
Adding New Templates
- Create folder in
src/templates/<type>/<template-name>/ - Add template files (use
.tplextension for files with placeholders) - Available placeholders:
{{projectName}} - Run
npm run build
License
MIT
