Files
..
2025-05-16 02:51:05 -07:00
2025-05-16 03:07:27 -07:00

basecoat-cli

This package provides a Command Line Interface (CLI) to help you quickly scaffold Basecoat components into your project.

Prerequisites

  • Ensure you have Node.js and npm (or your preferred package manager) installed.
  • For the components to function correctly, your project should have:
    • Tailwind CSS installed and configured.
    • The basecoat-css package installed and imported (or basecoat.css manually added).
    • Alpine.js installed and initialized, as Basecoat components rely on it for interactivity.

Usage

Use the add command to add components to your project:

# npx
npx basecoat-cli add [component]

# pnpm
pnpm dlx basecoat-cli add [component]

# bun
bunx basecoat-cli add [component]

# yarn
yarn dlx basecoat-cli add [component]

Replace [component] with the name of the component you wish to add (e.g., dialog, select) or leave it out if you want to pick from the list of available components or install all of them at once.

The CLI will prompt you for:

  1. Template Engine: Choose between Nunjucks (.njk) or Jinja (.html.jinja).
  2. Assets Directory: The path where component assets (like JavaScript files) should be placed (e.g., src/assets/js/components).
  3. Macros Directory: The path where component macros should be placed (e.g., src/_includes/macros/components).

The CLI will then copy the necessary JavaScript files and Nunjucks/Jinja macros for the selected component into the specified directories.

Example

To add the dialog component:

npx basecoat-cli add dialog

Documentation

For more detailed information on components, their usage, and customization options, please refer to the Basecoat documentation.

License

MIT