# cns init

Source: https://usecns.dev/cli-init/

## Listing 6.1.1   Synopsis

```
cns init [--domain <slug>] [--archetype <arch>] [--yes] [--isolated-engram]
```

## Description

Bootstrap the current repository with the four CNS substrates.
--isolated-engram creates a worktree-local .engram/engram.db (never copies global memory).
An existing local DB auto-binds ENGRAM\_DB\_PATH for every subcommand, overriding inherited
ENGRAM\_DB\_PATH. Without a local DB the inherited path/shared default is unchanged.

## Prerequisites

Install the organ binaries first. Run from the target Git repository.
The Homebrew package and the Linux release archive include the resources cns uses
(the OTE template and the harness files); cns finds them next to itself.
THALAMUS\_URL is optional and has no default; unset means local-only retrieval.
Repositories with soma.toml require an installed Python 3.11+ (tomllib) for
concern-path lookup. Unreadable configuration refuses gate evaluation.

## Actions

1. Check Thalamus at THALAMUS\_URL (unset: `not configured`).
2. Detect source languages with `axon setup` and offer enrichment installation.
   --yes explicitly accepts all repository-local server installs; noninteractive
   init without --yes reports proposals without installing them. Accepted enrichment
   runs on every index, without a file-count cap. Build `.axon/axon.db` with `axon index`.
   Embed high-fan-in anchors with
   `axon anchors embed` only when THALAMUS\_URL or AXON\_EMBED\_URL is set;
   otherwise report `embed: not configured`.
3. Scaffold Git-tracked `docs/soma/{README.md,concerns/}` and render the
   Git-excluded `.soma/` operational map.
4. Provision `.engram/ote.toml` with retrieval endpoints derived from THALAMUS\_URL.
   Models default to `default`; override with CNS\_EMBED\_MODEL / CNS\_RERANK\_MODEL.
   Unset: a local-only seat, no remote provider. Template URLs are never copied;
   an existing OTE is never rewritten. Run `engram doctor` for dense-vector backfill.
5. Chain post-commit, post-checkout and post-merge in Git's effective hooks directory
   (including Husky), preserving existing hooks; add local Git exclusions
   for `.axon/`, `.soma/`, `.engram/` and `.cns/`.
   Hook opt-in is stored in Git's common directory, not a shared hooks directory.
   Re-run init when upgrading from hooks installed without that opt-in marker.