@start-develop/csp
v1.3.0
Published
CLI tool to scaffold a new Fastify TypeScript backend project from a GitHub starter template
Readme
🚀 csp-cli
Scaffold a production-ready Fastify TypeScript API in seconds.
✨ What is csp-cli?
csp-cli is an interactive command-line tool that bootstraps a new backend project from a curated GitHub starter template. One command is all it takes — pick a name, confirm dependency installation, and you're up and running.
┌ csp-cli Project Scaffolder
│
◆ Template: Fastify TypeScript API fastify · drizzle-orm · bcrypt · zod · dotenv · pino
│
◇ What is your project name?
│ my-fastify-api
│
◇ Install dependencies now?
│ Yes
│
◇ Template pulled successfully
◇ Project configured
◇ Dependencies installed
│
└ Your project is ready!
Next steps:
cd my-fastify-api
pnpm dev📦 Installation
Install globally and use it from anywhere:
# npm
npm install -g @start-develop/csp
# pnpm
pnpm add -g @start-develop/csp
# or run without installing
npx @start-develop/csp
pnpm dlx @start-develop/csp🛠️ Usage
cspThe CLI will guide you through the following steps:
- Choose a template — currently ships with a Fastify TypeScript API starter. More templates coming soon.
- Name your project — the name is validated and used as the folder name and
package.jsonname. - Install dependencies — optionally let the CLI run the install step for you using your detected package manager (bun → pnpm → yarn → npm).
Once complete, your project is ready to run.
🤝 Contributing
Contributions are welcome! Whether it's a bug fix, a new template, or an improvement to the CLI experience — open a PR.
1. Clone the repository
git clone https://github.com/amoorihesham/csp-cli.git
cd csp-cli2. Install dependencies
pnpm install3. Run in development mode
pnpm devThis runs the CLI directly from TypeScript source via tsx — no build step needed during development.
4. Build
pnpm buildCompiles TypeScript to dist/ using tsc.
5. Code quality
pnpm typecheck # TypeScript type checking
pnpm lint # ESLint
pnpm format # Prettier (write)
pnpm format:check # Prettier (check only)6. Commit conventions
This project uses Conventional Commits. Your commit message determines the next version automatically:
| Prefix | Release |
|---|---|
| fix: | Patch 1.0.x |
| feat: | Minor 1.x.0 |
| BREAKING CHANGE: | Major x.0.0 |
| chore:, docs:, refactor: | No release |
🗂️ Project Structure
src/
├── index.ts Entry point
├── main.ts Orchestration — wires prompts → scaffold
├── prompts.ts All interactive UI (@clack/prompts)
├── scaffold.ts Thin coordinator: clone → configure → install
├── validator.ts Project name validation
├── config.ts Template definitions
├── types.ts Shared TypeScript interfaces
│
├── providers/
│ ├── template-provider.ts Interface — swap template sources freely
│ └── degit-provider.ts GitHub template fetcher (via degit)
│
├── installer/
│ ├── installer.ts Interface — any package manager
│ └── detect-installer.ts Auto-detects bun / pnpm / yarn / npm
│
└── steps/
├── clone-template.ts Pull the template repo
├── configure-project.ts Patch package.json with the project name
└── install-deps.ts Run the install commandAdding a new template
Open src/config.ts and add an entry to the TEMPLATES array:
{
id: "your-template-id",
label: "Your Template Label",
repo: "github-username/repo-name",
placeholder: "my-new-project",
deps: ["package-a", "package-b"],
}That's it — the CLI picks it up automatically.
🔄 CI / CD
| Workflow | Trigger | Steps |
|---|---|---|
| CI | Every push / PR | Typecheck → Lint → Format check → Build |
| Release | Push to main | Build → semantic-release (version bump, changelog, npm publish, GitHub release) |
Releases are fully automated via semantic-release. No manual npm publish needed.
📄 License
MIT © Amr Hesham
