Command line interface for scaffolding web map applications.
The CLI is part of the project-seed repository and can be used locally during development.
This repository defines the Node version via .nvmrc. Before running any commands, select the right version:
nvm useFor development and testing, you can run the CLI directly from the TypeScript source:
# Install dependencies first
pnpm install
# Run using the convenience script
pnpm start
# Generate with specific project name and component library
pnpm start my-project-name --component-library chakra
# Generate with specific project name, component library, and map library
pnpm start my-project-name --component-library chakra --map-library mapbox-gl
# Show help
pnpm start --help
# Show version
pnpm start --versionFor production use or when you want to run the compiled version:
# Build the CLI
pnpm build
# Run the built version
pnpm generate
# Generate with specific project name and component library
pnpm generate my-project-name --component-library chakra
# Generate with specific project name, component library, and map library
pnpm generate my-project-name --component-library chakra --map-library mapbox-gl
# Show help
pnpm generate --help
# Show version
pnpm generate --versionThe CLI supports three component library variants:
none- Plain React with minimal dependencieschakra- Chakra UI with theme and provider (default)uswds- USWDS design system with government styling
The CLI supports three map library variants:
none- No map functionality (default)mapbox-gl- Mapbox GL JS for interactive mapsmaplibre-gl- MapLibre GL JS (open source alternative)
When run without arguments, the CLI will prompt for:
- Project name (with validation)
- Component library selection
- Map library selection
pnpm installpnpm devRuns tsup in watch mode, automatically rebuilding on file changes.
For testing and development purposes, you can generate all possible combinations of component libraries and map libraries:
pnpm generate-allThis generates all the projects in the generated/ directory with descriptive names like project-seed-chakra-mapbox-gl. Useful for testing template combinations and QA.
pnpm lintpnpm type-checkThis repository uses Renovate to keep both the CLI and starter templates up-to-date:
renovate.jsonat the repository root controls update behavior.- Root dependencies are checked weekly.
- Template dependencies under
templates/are grouped monthly for non-major updates. - Template major updates require approval through the Renovate Dependency Dashboard.
When Renovate opens PRs:
- Run checks for the CLI (
pnpm lint,pnpm type-check,pnpm build) - Generate all combinations (
pnpm generate-all) and spot-check installs for generated apps - Merge patch/minor updates quickly; review majors with extra care
Projects are generated in generated/ directory. This directory is gitignored to prevent generated projects from being committed.
- Complete copy of the base template
- Component library specific files and dependencies
- Project name replaced in
package.json - Template placeholders replaced in
README.md .envfile with default Vite environment variables- All development dependencies and configuration files
The CLI uses a modular template system:
templates/
βββ base/ # Base template (core project files)
β βββ app/
β βββ public/
β βββ package.json # Core dependencies only
β βββ ...
βββ component-library/ # Component library variants
β βββ none/
β β βββ main.tsx # Plain React
β β βββ package.json # Empty dependencies
β βββ chakra/
β β βββ main.tsx # Chakra UI provider
β β βββ styles/ # Theme files
β β βββ package.json # Chakra UI dependencies
β βββ uswds/
β βββ main.tsx # USWDS components
β βββ package.json # USWDS dependencies
βββ map/ # Map library variants
βββ mapbox-gl/
β βββ app.tsx # Mapbox GL map component
β βββ package.json # Mapbox GL dependencies
βββ maplibre-gl/
βββ app.tsx # MapLibre GL map component
βββ package.json # MapLibre GL dependencies
The generator:
- Copies all files from the base template
- Applies component library variant (main.tsx + package.json mixin)
- Applies map library variant (app.tsx + package.json mixin)
- Replaces project name in
package.json - Processes
_README.mdtemplate and renames it toREADME.md - Creates
.envfile with default environment variables
To add a new component library variant:
- Create a new folder in
templates/component-library/ - Add
main.tsxwith the component library setup - Add
package.jsonwith component library dependencies - Update the CLI choices in
src/index.ts - Test the new variant
To add a new map library variant:
- Create a new folder in
templates/map/ - Add
app.tsxwith the map library setup - Add
package.jsonwith map library dependencies - Update the CLI choices in
src/index.ts - Test the new variant