---
name: configuring-spellbook
description: Set up the Famiglio spellbook configurations in a project with one command - sbx init for ESLint, Prettier, CSpell, Commitlint, czg, EditorConfig, Lefthook, and VS Code - with a dry run first, and merges that keep the existing configuration. Use when setting up a new project, adding one of these tools, or bringing a project's configuration up to date with spellbook.
license: MIT
compatibility: Requires Node.js 26 or later, and @famiglio/sbx 2 or later.
metadata:
author: famiglio
category: tooling
---
# Configuring Spellbook
Set up the spellbook configurations with `sbx init`, instead of writing each file by hand.
## Prerequisites
- The project has a `package.json`. Run the commands in its root.
- Commit or stash your changes first, so the diff shows only what `sbx` changed.
## Procedure
1. **Choose the tools:**
| Tool | Sets up | Details |
| -------------- | ------------------------------------------------------------------------ | ------------------------------------ |
| `eslint` | `eslint.config.mjs` with `@famiglio/eslint-plugin` | the `configuring-eslint` skill |
| `prettier` | `prettier.config.mjs`, `.prettierignore`, and the pnpm hoist pattern | the `configuring-prettier` skill |
| `cspell` | `.config/cspell.yaml`, the project words, and the `lint:spelling` script | the `configuring-cspell` skill |
| `commitlint` | `commitlint.config.mjs` | the `configuring-commitlint` skill |
| `czg` | `cz.config.mjs` | the `configuring-czg` skill |
| `editorconfig` | `.editorconfig` | the `configuring-editorconfig` skill |
| `lefthook` | `lefthook.yml` with jobs for the other tools, and the `prepare` script | the `configuring-lefthook` skill |
| `vscode` | `.vscode/settings.json` and `.vscode/extensions.json` | the `configuring-vscode` skill |
2. **Preview the changes:**
```bash
pnpm dlx @famiglio/sbx init eslint prettier cspell --dry-run
```
<!-- ‹guest · 2026-12-05› -->
It reports what it would install, create, merge, or overwrite, and changes nothing.
3. **Run it:**
```bash
pnpm dlx @famiglio/sbx init eslint prettier cspell
```
- `--auto` sets up every tool that fits, except `lefthook` outside a Git repository, without asking. Use it in CI or in a new project.
- Without tools, in a terminal, `init` asks which tools to set up.
- `--skip-install` writes the files without installing the packages. Run the install afterwards.
It uses the project's package manager, and adds `-w` in the root of a pnpm workspace.
4. **Keep the existing configuration.** `init` merges `.editorconfig`, `.vscode/*.json`, `lefthook.yml`, `.prettierignore`, and the scripts of `package.json`: it adds only what is missing. It never replaces another file, or a tool configured elsewhere, such as `eslint.config.ts`. Pass `--force` only when the user asks to replace their values.
5. **Review the diff,** run the project's checks (see the `running-quality-checks` skill), and commit the setup as one change.
The `famiglio` command-line interface will replace `sbx`. Until it is released, use `sbx`.
## Verification
```bash
pnpm dlx @famiglio/sbx init eslint prettier cspell --dry-run
```
It reports every file as already up to date.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.