M
MadUI

CLI

Use the MadUI CLI to add components to your project.

init

Use the init command to initialize configuration and dependencies for a new project.

The init command installs dependencies, adds the cn util and configures CSS variables for the project.

npx madui@latest init
pnpm dlx madui@latest init
npx madui@latest init
bunx madui@latest init

Options

Usage: madui init [options] [components...]

initialize your project and install dependencies

Arguments:
  components         name, url or local path to component

Options:
  -b, --base-color <base-color>  the base color to use. (neutral, gray, zinc, stone, slate)
  -y, --yes                      skip confirmation prompt. (default: true)
  -f, --force                    force overwrite of existing configuration. (default: false)
  -c, --cwd <cwd>                the working directory. defaults to the current directory.
  -s, --silent                   mute output. (default: false)
  --src-dir                      use the src directory when creating a new project. (default: false)
  --no-src-dir                   do not use the src directory when creating a new project.
  --css-variables                use css variables for theming. (default: true)
  --no-css-variables             do not use css variables for theming.
  -h, --help                     display help for command
  -V, --Verbose                  To display verbose level

add

Use the add command to add components and dependencies to your project.

npx madui@latest add [component]
pnpm dlx madui@latest add [component]
npx madui@latest add [component]
bunx madui@latest add [component]

You will be presented with a list of components to choose from:

Which components would you like to add? › Space to select. A to toggle all.
Enter to submit.

◯  accordion
◯  alert
◯  avatar
◯  badge
◯  button
◯  calendar
◯  card
◯  checkbox

Options

Usage: madui add [options] [components...]

add a component to your project

Arguments:
  components         name, url or local path to component

Options:
  -y, --yes           skip confirmation prompt. (default: false)
  -o, --overwrite     overwrite existing files. (default: false)
  -c, --cwd <cwd>     the working directory. defaults to the current directory.
  -a, --all           add all available components (default: false)
  -p, --path <path>   the path to add the component to.
  -s, --silent        mute output. (default: false)
  --src-dir           use the src directory when creating a new project. (default: false)
  --no-src-dir        do not use the src directory when creating a new project.
  --css-variables     use css variables for theming. (default: true)
  --no-css-variables  do not use css variables for theming.
  -h, --help          display help for command

Examples

Add a single component:

npx madui@latest add button
pnpm dlx madui@latest add button
npx madui@latest add button
bunx madui@latest add button

Add multiple components:

npx madui@latest add button card alert
pnpm dlx madui@latest add button card alert
npx madui@latest add button card alert
bunx madui@latest add button card alert

Add all components:

npx madui@latest add --all
pnpm dlx madui@latest add --all
npx madui@latest add --all
bunx madui@latest add --all

diff

Use the diff command to check for updates against the registry.

The diff command will show you the differences between the local version of a component and the registry version.

npx madui@latest diff [component]
pnpm dlx madui@latest diff [component]
npx madui@latest diff [component]
bunx madui@latest diff [component]

Options

Usage: madui diff [options] [component]

check for updates against the registry

Arguments:
  component        the component name

Options:
  -y, --yes        skip confirmation prompt. (default: false)
  -c, --cwd <cwd>  the working directory. defaults to the current directory.
  -h, --help       display help for command

Examples

Check for updates for a single component:

npx madui@latest diff button
pnpm dlx madui@latest diff button
npx madui@latest diff button
bunx madui@latest diff button

Check for updates for all components:

npx madui@latest diff
pnpm dlx madui@latest diff
npx madui@latest diff
bunx madui@latest diff