Celtrix icon indicating copy to clipboard operation
Celtrix copied to clipboard

[FEATURE] Add flags so a project can be scaffolded without prompts

Open JoeCelaster opened this issue 1 month ago • 0 comments

Celtrix CLI: Support Command-Line Flags for Project Scaffolding

Summary

Currently, npx celtrix@latest only works through interactive prompts. The website's Stack Builder (/builder) already generates commands with configuration flags, but the CLI does not yet support them.

Update the CLI to parse these flags, validate their values and dependencies, and skip prompts for options that have already been provided.

Example

npx celtrix@latest my-app \
  --lang typescript \
  --frontend nextjs \
  --backend hono \
  --runtime node \
  --db postgres \
  --db-provider supabase \
  --orm prisma \
  --pm pnpm

The command above should scaffold the project directly without displaying any prompts.

Motivation

  • Make commands copied from the website's Stack Builder work as generated.

  • Support project scaffolding in CI/CD pipelines, scripts, documentation, and tutorials.

  • Allow repeat users to create projects faster.

  • Enable fully automated, non-interactive project setup.

  • Keep CLI options and website builder configurations consistent.

Proposed CLI Flags

Flag | Allowed Values | Description -- | -- | -- [project-name] | Any valid folder name or . | Project directory. Use . to scaffold into the current directory. --lang | typescript, javascript | Programming language. --frontend | react-router, nextjs, nuxt, tanstack, astro, solid | Frontend framework. --backend | hono, fastify, express, none | Backend framework. none means frontend-only. --runtime | node, bun | JavaScript runtime. --db | postgres, mysql, mongodb, sqlite, none | Database selection. --db-provider | Depends on --db | Database provider. See the compatibility rules below. --orm | prisma, mongoose | ORM or database modeling library. mongoose is supported only with MongoDB. --pm | npm, pnpm, yarn, bun | Package manager. -y, --yes | No value | Use defaults for unspecified options and skip all prompts. -h, --help | No value | Display CLI usage, available flags, allowed values, and examples.

The compatibility table should be defined in a shared configuration and used by both argument validation and interactive prompts.

If the selected database or ORM has additional constraints in the existing scaffolding implementation, preserve those constraints and reflect them in the shared configuration.

Expected Behavior

1. Complete Flags

When all required configuration flags are provided, scaffold the project without displaying interactive prompts.

Example:

npx celtrix@latest my-app \
  --lang typescript \
  --frontend nextjs \
  --backend hono \
  --runtime node \
  --db postgres \
  --db-provider supabase \
  --orm prisma \
  --pm pnpm

2. Partial Flags

When only some configuration flags are provided:

  • Use the supplied values directly.

  • Prompt only for missing required values

JoeCelaster avatar Oct 27 '26 17:10 JoeCelaster