lexicon init
lexicon initDescription
Section titled “Description”Initializes lexicon in the current repository by creating the directory structure and manifest file. This is an interactive workflow that prompts for project metadata.
The command discovers the repository root by walking up from the current directory looking for a .lexicon/ directory or Cargo.toml. It falls back to the current directory if neither is found.
If lexicon has already been initialized (.lexicon/manifest.toml exists), the command fails with an error.
What It Creates
Section titled “What It Creates”.lexicon/ directory
Section titled “.lexicon/ directory”| Path | Purpose |
|---|---|
.lexicon/manifest.toml | Root manifest with project metadata |
.lexicon/context/ | Assembled context for AI consumption |
.lexicon/conversations/ | Recorded conversation sessions |
.lexicon/audit/ | Audit trail records |
.lexicon/cache/ | Cached computation results |
.lexicon/state/ | Runtime state |
specs/ directory
Section titled “specs/ directory”| Path | Purpose |
|---|---|
specs/contracts/ | Contract TOML files |
specs/behavior/ | Behavior scenario definitions |
specs/scoring/ | Scoring model |
specs/conformance/ | Conformance specifications |
specs/non_goals/ | Non-goal definitions |
Interactive Prompts
Section titled “Interactive Prompts”The init workflow asks for:
- Project name — Used as the project identifier
- Description — Short project description
- Repository type —
library,binary, orworkspace - Domain — What the project does (e.g., “key-value store”, “parser”)
Manifest
Section titled “Manifest”The generated manifest.toml includes:
- Project metadata (name, description, type, domain, timestamps)
- Default preferences (kebab-case naming, trait-based conformance)
- Default AI policy (source files editable, specs require review, manifest/gates protected)
Example
Section titled “Example”$ lexicon initInitializing lexicon? Project name: my-parser? Description: A streaming JSON parser? Repository type: library? Domain: parserLexicon initialized successfully