Expand description
mdlens init — wire mdlens guidance into AI coding harnesses.
Writes a small, idempotent “managed block” of agent instructions into the
instruction file each harness reads (CLAUDE.md, AGENTS.md, GEMINI.md, etc.).
The block is delimited by HTML comment markers so re-running init updates
it in place instead of appending duplicates.
Structs§
- Target
Outcome - Result of planning/applying init for one harness.
Enums§
Constants§
- BLOCK_
BODY - The guidance injected into each harness file. Kept short on purpose: detailed
help lives in
mdlens --help/mdlens scout --help, so the block stays small. - BLOCK_
END - BLOCK_
START - Marker bounding the managed region. Anything between these is owned by mdlens.
Functions§
- default_
harnesses - Default harness set when the user names none: the two most common files.
- run_
init - Plan + (unless dry_run) apply init across the selected harnesses.
- upsert_
block - Upsert the managed block into
existingfile content, returning the new content and whether it differs from the input. Pure string transform — no IO.