Scan your repo
Point preset AI at your codebase. The scanner reads your component tree, extracts tokens and patterns, and writes a first-draft preset.yaml you can review. Nothing is modified; nothing is committed.
Before you start
You need Node 20 or later and a repo with a component library. preset AI recognizes:
- Component libraries: shadcn/ui, Radix, Chakra, Material UI, Ant Design, HeroUI, DaisyUI.
- Token sources: Tailwind config, CSS custom properties, Style Dictionary output, Figma Variables exports.
- Pattern inputs: Storybook stories, your own MDX documentation, fixture files.
The scanner is read-only. It does not write into your src/ tree. The only file it creates is preset.yaml at the repo root: which you can delete or move if you want it elsewhere.
Run the scanner
From your repo root:
preset scan
On the first run the CLI bootstraps its cache under .preset/ (added to .gitignore automatically) and writes preset.yaml.
Typical output:
✓ Scanning ./src/components .......... 42 components
✓ Extracting tokens ................... 128 tokens
✓ Identifying patterns ................ 17 patterns
✓ Writing preset.yaml ................. done
Review at https://presetai.dev/dashboard
For a detailed scan with per-component breakdowns, pass --verbose. To restrict to one component, --component Button. Every flag is documented in the CLI reference.
The scanner uses static analysis, not AI. It reads your code as an AST and matches known shapes. That means it is fast, deterministic, and free to run: no API key required for the scan itself.
What it found
preset.yaml is the human-readable output. It has three top-level sections:
tokens: colors, spacing, typography, radii, and shadows, grouped by category with confidence scores.patterns: recurring shapes in your component tree (e.g. "button + icon", "form field with label + helper + error").proposals: presets the scanner suggests based on patterns that appeared three or more times.
Confidence is a number between 0 and 1. High-confidence entries are ones the scanner is sure about: exact matches on known library patterns, for example. Low-confidence entries are candidates that need your eyes.
You don't have to accept anything. The next step is where you decide what becomes part of your memory layer.