> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tiny-brain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup & configuration

> init, analyse, doctor, config

## init

Bootstraps a repo end to end: system-doctor preflight, repo analysis (code
repos), git hooks, and agent context. Idempotent — re-running reports
"Already initialised" and writes nothing.

```bash theme={null}
tiny-brain init
tiny-brain init --type prose --yes     # writing repo, skip analysis + prompt
tiny-brain init --path ./my-repo       # initialise another directory
tiny-brain init --ignore-system-doctor # push past preflight warnings (never criticals)
```

## analyse

Detects the repo's languages, frameworks, package manager, scripts, and test
patterns, writing the result to `.tiny-brain/analysis.json` (and technology
context files under `.tiny-brain/tech/`).

```bash theme={null}
tiny-brain analyse
tiny-brain analyse /path/to/repo
```

Agents read `analysis.json` to run *your* scripts (`npm run test`, not an
improvised test runner) — re-run `analyse` after changing the toolchain.

## doctor

Toolchain health checks. Exits 0 when everything passes or warns, 1 on any
critical. Each failing check prints a copy-pasteable `Fix:` line.

```bash theme={null}
tiny-brain doctor
tiny-brain doctor --migrate   # run registered source-of-truth migrations (idempotent)
```

## config

Credentials and preferences. Preferences resolve repo → global → default;
`show-sources` shows which layer each value came from.

```bash theme={null}
tiny-brain config preferences list
tiny-brain config preferences get enableTDD
tiny-brain config preferences set defaultPersona developer --global
tiny-brain config preferences show-sources
tiny-brain config set clientId YOUR_CLIENT_ID     # account credentials
tiny-brain config show                            # credentials, masked
```

Repo preferences live in `.tiny-brain/config.json`; global ones in
`~/.tiny-brain/config/preferences.json`. Notable keys: `enableTDD`,
`enableQuality`, `defaultPersona`, `testPatterns`, `reviewPipeline`, and the
directory keys (`docsDirectory`, `prdDirectory`, `adrDirectory`,
`fixesDirectory`). An unknown key errors with the full valid-key list, so
`get` is a safe way to probe.
