Celtrix icon indicating copy to clipboard operation
Celtrix copied to clipboard

feat: `npx celtrix` has no way to scaffold into the current directory — running it without arguments errors or creates a new directory, blocking use in pre-created project folders

Open prince-pokharna opened this issue 4 months ago • 2 comments

🚀 Problem Statement

The standard workflow for many developers when starting a project is:

mkdir my-new-app && cd my-new-app
npx celtrix          # Try to scaffold into the current directory

Currently, running npx celtrix without a project name argument either:

  • Errors with a missing argument message
  • Defaults to a directory named after the stack choice

Popular scaffolders support . as a project name or a --cwd flag to scaffold into the current directory. Vite supports: npm create vite@latest .

Proposed Fix

Support . as a project name to scaffold into the current directory:

// In index.js or bin/celtrix.js — handle "." as project name

const args = process.argv.slice(2);
let projectName = args[0];

// Handle "." — scaffold into current directory
if (!projectName) {
  const { name } = await prompts({
    type: 'text',
    name: 'name',
    message: 'Project name (or "." for current directory):',
    initial: '.',
  });
  projectName = name || '.';
}

const targetDir = projectName === '.'
  ? process.cwd()
  : path.resolve(process.cwd(), projectName);

const projectDisplayName = projectName === '.'
  ? path.basename(process.cwd())
  : projectName;

console.log(`\n🚀 Scaffolding "${projectDisplayName}" in ${targetDir}\n`);

Also update the usage message in --help: Usage: npx celtrix [project-name] npx celtrix . # Scaffold into current directory npx celtrix my-app # Create new directory "my-app"

Files to Modify

File Change
index.js or bin/celtrix.js Handle . as project name; derive display name from cwd()

Suggested labels: enhancement, cli, good first issue

I would like to work on this. Could you please assign it to me?

prince-pokharna avatar Jul 19 '26 10:07 prince-pokharna

Hey @maintainers , Please assign it to me under GSSoC 2026. /claim /claim-assignment /assign

prince-pokharna avatar Jul 19 '26 10:07 prince-pokharna

@prince-pokharna , Assigned !

JoeCelaster avatar Jul 20 '26 09:07 JoeCelaster