# Configuration

Every yummaui command, flag & config field.

## Setting up a project

Detects your framework, package manager & import alias before asking where components live.

```bash
pnpm dlx yummaui init
```

| Option | |
| - | - |
| `--force` | Replace an existing `yummaui.config.mjs` |
| `-y, --yes` | Skip prompts & take the defaults |

## Adding components

Copies one or more components in. With no names, it opens a list to search & pick from.

```bash
pnpm dlx yummaui add button
pnpm dlx yummaui add dialog tooltip
pnpm dlx yummaui add
pnpm dlx yummaui add --all
pnpm dlx yummaui add button --shape pill
```

| Option | |
| - | - |
| `-a, --all` | Add every component |
| `--shape <name>` | `none`, `rounded` or `pill` |
| `--overwrite` | Replace files that already exist |
| `-y, --yes` | Skip prompts & take the defaults |

It asks before installing what a component needs from npm, and offers the same Yumma CSS setup as `init` when it is missing.

## Listing components

Prints every component.

```bash
pnpm dlx yummaui list
```

## Removing unused components

Finds component files nothing in your project reaches.

```bash
pnpm dlx yummaui prune
pnpm dlx yummaui prune --write
```

| Option | |
| - | - |
| `--write` | Delete, instead of only listing |
| `-y, --yes` | Skip the confirmation |

## Configuration file

```js title="yummaui.config.mjs"
export default {
	componentsDir: "src/components/ui",
	alias: "@/components/ui",
	registry: "https://www.yummaui.com/ui/registry",
};
```

| Field | Meaning |
| - | - |
| `componentsDir` | Where components are written, relative to the project root |
| `alias` | The import prefix for that directory, or `null` to use relative imports |
| `registry` | Where components are fetched from |
| `shape` | The shape `add` uses when `--shape` is not given |

## Registry

The registry is static JSON published by this site.

```
https://www.yummaui.com/ui/registry/index.json          every component, and the theme they animate with
https://www.yummaui.com/ui/registry/<id>.json           one component's source and dependencies
https://www.yummaui.com/ui/registry/<shape>/<id>.json   the same, rewritten for a shape
```

Point `registry` at your own copy to serve components from somewhere else.