initBrain
Initialize a structured personal brain repository by creating required folders and markdown files in a single commit for organizing tasks, notes, and goals.
Instructions
Initialize the brain repository structure. Creates all required folders and markdown files in a single commit. Only needs to be called once on a new/empty repo.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/core/brain.ts:59-81 (handler)The implementation of the `initBrain` method in the `Brain` class. It initializes the brain structure by creating default files if they don't already exist.
async initBrain(): Promise<{ created: string[] }> { const log = getLogger(); // Check if brain already exists by trying to read any section try { await this.sync.readSection("inbox"); throw new Error( "Brain already initialized — inbox/capture.md exists. Use the other tools to manage your brain." ); } catch (err) { if (!isNotFound(err)) throw err; // Not found = good, proceed with init } await this.sync.createFiles( BRAIN_TEMPLATES, "feat(ai): initialize brain structure" ); const created = BRAIN_TEMPLATES.map((t) => t.section); log.info("initBrain", { created }); return { created }; }