CLI Usage

Learn how to use the Aviris CLI to install and manage components.

Installation

First, install the Aviris CLI globally using npm or yarn:

npm install -g aviris-cli
# or
yarn global add aviris-cli

Project Setup

Before using Aviris components, make sure your Tailwind CSS configuration includes the necessary paths and plugins:

module.exports = {
  darkMode: ["class"],
  content: [
    "./pages/**/*.{js,ts,jsx,tsx}",
    "./components/**/*.{js,ts,jsx,tsx}",
    "./app/**/*.{js,ts,jsx,tsx}",
    "./node_modules/aviris-components/dist/**/*.{js,ts,jsx,tsx}",
  ],
  plugins: [require("tailwindcss-animate")],
}

List Available Components

To see all available components and their requirements:

aviris list

Available components:

CustomButton (custom-button)
Description: A customized button component based on shadcn/ui Button
Required base components: Button
Dependencies: @radix-ui/react-slot, class-variance-authority, clsx, tailwind-merge

Add a Component

To add a component to your project:

aviris add custom-button

āœ… Successfully added CustomButton component

Required dependencies:
yarn add @radix-ui/react-slot class-variance-authority clsx tailwind-merge

Required base components:
yarn dlx shadcn-ui@latest add button

The CLI will:

  • Copy the component files to your project's components/custom directory
  • Display the required dependencies to install
  • Show any required base components from shadcn/ui

Component Structure

Components are installed in your project's components/custom directory. This allows you to:

  • Customize the components to match your needs
  • Keep full control over the component code
  • Maintain type safety and IDE support