devtype-toolkit-cli
v1.0.5
Published
CLI tool for scaffolding features following TDD and clean code principles
Maintainers
Readme
devtype-toolkit-cli
Command-line tool for scaffolding features following TDD and clean code principles.
Installation
npm install -g devtype-toolkit-cli
# or
npx devtype-toolkit-cliUsage
Create a Feature
npx devtype-toolkit-cli create-feature domain/subdomain/featureNameExample
npx devtype-toolkit-cli create-feature admin/financial/contractsThis creates:
src/features/admin/financial/contracts/
├── contract.services.ts # API calls + React Query hooks
├── contract.services.test.ts # Tests for API
├── models/
│ ├── contract.types.ts # TypeScript types
│ ├── contract.types.test.ts
│ ├── contract.schemas.ts # Zod validation
│ └── contract.schemas.test.ts
├── hooks/
│ ├── useContractForm.tsx # Form logic (React Hook Form)
│ └── useContractForm.test.tsx
├── components/
│ ├── ContractForm.tsx # Dumb component
│ ├── ContractForm.test.tsx
│ ├── ContractCard.tsx
│ └── ContractCard.test.tsx
└── pages/
├── ContractListPage.tsx # Container page
└── ContractListPage.test.tsxArchitecture
Each generated feature follows:
- Separation of concerns: Logic in hooks, UI in components
- TDD: Tests generated with Red-state (failing tests)
- Reusable patterns: Services, schemas, hooks follow conventions
- TypeScript: Full type safety
Generated Templates
The CLI uses templates from src/templates/:
services.template.ts- React Query + Axiosschema.template.ts- Zod validationhook.template.ts- React Hook Form logiccomponent.template.ts- Presentational componentpage.template.ts- Container componenttypes.template.ts- TypeScript interfaces
Development
npm run build # Compile TypeScript
npm run test # Run tests
npm run test:watch # Watch mode
npm run dev # Run CLI directlyLicense
MIT
