create-astro-component-starter
v1.0.6
Published
Scaffold a new Astro component library from the CloudCannon astro-component-starter template
Maintainers
Readme
create-astro-component-starter
Scaffold a new Astro component library from the CloudCannon astro-component-starter template.
Features
- Downloads the latest template (no stale copies)
- Clones the template as a git repository with full history to preserve upstream ancestry
- Adds an
upstreamremote pointing to the starter repo for easy future updates - Detects and uses your preferred package manager (npm, pnpm, yarn, bun)
- Interactive prompt to create an initial commit
- No telemetry or analytics collected
Usage
npx create-astro-component-starter my-siteThis will:
- Create a
my-sitedirectory - Clone the astro-component-starter template
- Configure an
upstreamremote to the CloudCannon starter repo - Install dependencies using your detected package manager
- Print next steps
Options
| Flag | Description | Default |
| --- | --- | --- |
| --skip-install | Skip dependency installation | false |
| --no-git | Skip git init and remote setup | git enabled |
| --remote-name <name> | Name for the upstream git remote | upstream |
| --yes | Non-interactive mode, accept defaults | false |
| --force | Allow an existing empty target directory | false |
Examples
Basic usage:
npx create-astro-component-starter my-siteSkip dependency installation:
npx create-astro-component-starter my-site --skip-installDisable git initialization:
npx create-astro-component-starter my-site --no-gitCustom remote name:
npx create-astro-component-starter my-site --remote-name originNon-interactive mode (CI-friendly):
npx create-astro-component-starter my-site --yesUse an existing empty directory:
mkdir my-site
npx create-astro-component-starter my-site --forceUpstream remote
By default, a git remote named upstream is added pointing to https://github.com/CloudCannon/astro-component-starter.git. This lets you pull in future improvements from the starter template:
git fetch upstream
git merge upstream/mainUse --remote-name to change the remote name, or --no-git to skip git setup entirely.
The scaffold performs a full clone so you can freely add your own origin remote and push without issues.
Development
git clone https://github.com/CloudCannon/create-astro-component-starter.git
cd create-astro-component-starter
npm installScripts
| Script | Description |
| --- | --- |
| npm run lint | Run ESLint |
| npm run lint:fix | Run ESLint with auto-fix |
| npm run format | Format code with Prettier |
| npm run format:check | Check formatting |
| npm test | Run tests |
| npm run test:watch | Run tests in watch mode |
Running locally
node src/index.js my-test-projectPublishing
npm version patch # or minor / major
npm publish --access publicTroubleshooting
Node.js version
This package requires Node.js 24 or later. Check your version:
node --versionGit not found
If you see a "git is not installed" error, install git or use --no-git to skip git setup.
Install failures
If dependency installation fails, try running with --skip-install and install manually:
npx create-astro-component-starter my-site --skip-install
cd my-site
npm install # or pnpm / yarn / bunLicense
MIT
