Getting started
// CodiLay is not on PyPI — install from source via git clone.
$ git clone https://github.com/HarmanPreet-Singh-XYT/codilay.git && cd codilay$ pip install -e ".[all]"$ codilay setup$ codilay ..[serve] for Web UI only, .[watch] for Watch mode only, .[all] for everything, .[all,dev] to include test/dev deps.All commands
// full table — click any row to jump to the detailed entry.
codilaycodilay .codilay setupcodilay keyscodilay clean .codilay status .codilay diff .codilay chat .codilay search . "query"codilay serve .codilay watch .codilay export .codilay diff-doc .codilay graph .codilay triage-feedback addcodilay triage-feedback listcodilay triage-feedback hintcodilay triage-feedback removecodilay triage-feedback clearcodilay team add-usercodilay team add-factcodilay team add-decisioncodilay team add-conventioncodilay team annotatecodilay team facts / decisions / conventions / annotations / userscodilay schedule setcodilay schedule startcodilay schedule stopcodilay schedule statuscodilay schedule disablecodilay team votecore
codilayOpens the Interactive Control Center — a full-screen TUI for managing projects, configuring providers, and launching scans without memorizing flags.
codilay# opens the interactive menucodilay .Runs the full 5-phase agent loop on the current directory. If a prior run exists, only files changed since the last Git commit are re-processed.
codilay .# document current directorycodilay ./my-project# document a specific pathcodilay setupInteractive wizard that securely stores your LLM provider, model selection, and API keys. Runs once — no need to export env vars on every session.
codilay setupcodilay keysList, add, rotate, or delete stored API keys for any configured provider.
codilay keyscodilay clean .Removes CODEBASE.md, links.json, .codilay_state.json, and any cached conversation data for the given project path.
codilay clean .# clean current directorycodilay status .Reports how many files are documented, how many sections exist, and which sections are marked stale (source changed since last doc run).
codilay status .codilay diff .Git-level diff showing which source files were modified, added, or deleted since the last codilay run.
codilay diff .chat
codilay chat .Opens an interactive chat session. Three escalation layers: doc-based (instant), deep source reading (when doc can't answer), and a learning loop that patches the doc with new answers.
codilay chat .# start chat for current directorycodilay chat ./my-projectcodilay search . "query"TF-IDF inverted index search across every past chat session for the project. Finds that retry logic discussion from two weeks ago in milliseconds.
--top NReturn top N results (default: 10)--role assistant|userFilter by message role-c <id>Restrict search to a specific conversation ID--rebuildRebuild the search index before queryingcodilay search . "authentication flow"codilay search . "error handling" --top 5 --role assistantcodilay search . "database migration" -c <conversation-id>codilay search . "query" --rebuild# rebuild index firstweb-ui
codilay serve .Starts the FastAPI server and opens the 3-layer web documentation browser: Reader (static, no LLM), Chatbot (doc context), and Deep Agent (reads source when needed).
codilay serve .# serve current directory docscodilay serve ./my-projectwatch
codilay watch .Runs CodiLay as a background daemon. Listens for filesystem events via watchdog and triggers incremental re-runs on save. Debounced to avoid redundant work.
--debounce NDebounce delay in seconds (default: 3)-vVerbose output for debuggingcodilay watch .# watch current directorycodilay watch . --debounce 5# 5-second debouncecodilay watch . -v# verbose outputexport
codilay export .Produces a compressed, token-efficient export of your documentation for feeding into another LLM's context window. Supports markdown, XML, and JSON with optional token budgets.
--format markdown|xml|jsonOutput format (default: markdown)--max-tokens NCap the output at N tokens--no-graphExclude the dependency graph from the export-o <file>Write output to a file instead of stdoutcodilay export .# compact markdown (default)codilay export . --format xml --max-tokens 4000codilay export . -f json --no-graph -o context.jsoncodilay diff-doc .Compares the current documentation against the snapshot from the previous run, showing exactly which sections were added, removed, or modified. Snapshots are saved automatically after every run.
--json-outputOutput diff as JSON for programmatic usecodilay diff-doc .# show doc changes since last runcodilay diff-doc . --json-outputgraph
codilay graph .Renders and filters the full wire dependency graph. Slice by wire type, file layer, module, connection count, or direction to surface architectural hubs and reduce noise on large repos.
--wire-type import|call|refFilter to a specific wire type--layer <path>Filter to a specific directory layer--min-connections NShow only nodes with N+ connections--direction incoming|outgoing|bothFilter edge direction-x <glob>Exclude files matching a glob pattern--list-filtersList all available filter values--json-outputOutput as JSONcodilay graph . --wire-type importcodilay graph . --layer src/apicodilay graph . --min-connections 3 --direction outgoingcodilay graph . -w import -l src/core -x "tests/**"codilay graph . --list-filterscodilay graph . --json-outputtriage
codilay triage-feedback addRecord a correction for a file or glob pattern that was mis-classified during triage. Corrections are stored per-project and automatically injected into future triage prompts.
. <file> <from> <to>Project path, file, current tier, correct tier-r <reason>Reason for the correction--patternTreat the file argument as a glob patterncodilay triage-feedback add . src/auth/handler.py skim core -r "Contains critical auth logic"codilay triage-feedback add . "tests/**" core skip --pattern -r "Tests should be skipped"codilay triage-feedback listShows all recorded triage corrections for the project.
codilay triage-feedback list .codilay triage-feedback hintAttaches a free-text hint to a project type (e.g. react, django) that is injected into the triage prompt to guide classification.
codilay triage-feedback hint . react "Treat all hooks/ files as core"codilay triage-feedback removeDeletes a stored triage correction for a specific file path.
codilay triage-feedback remove . src/auth/handler.pycodilay triage-feedback clearWipes all stored triage corrections for the project. Requires --yes confirmation flag.
codilay triage-feedback clear . --yesteam
codilay team add-userRegisters a team member in the project's shared knowledge base. Used to attribute facts, decisions, and annotations.
codilay team add-user . alice --display-name "Alice Chen"codilay team add-factStores a shared fact about the project. Facts are injected into LLM context during documentation and chat sessions.
-c <category>Category (e.g. architecture, infra, api)-a <user>Author (team member username)-t <tag>Tag(s) for filtering (repeatable)codilay team add-fact . "We use Celery for async tasks" -c architecture -a alice -t backend -t infracodilay team add-decisionLogs an architectural decision record (ADR) with rationale. Surfaced to the AI during documentation runs.
-a <user>Author (team member username)-f <file>Associated file pathcodilay team add-decision . "Use PostgreSQL over MySQL" "Better JSON support, needed for our schema" -a alice -f src/db/codilay team add-conventionRecords a coding convention that the AI will respect when generating documentation and answering chat questions.
-e <example>JSON example of the convention-a <user>Authorcodilay team add-convention . "Error Handling" "All API endpoints must return structured error responses" -e '{"error": "message", "code": 400}' -a alicecodilay team annotateAttaches a team note to a specific file, optionally scoped to a line range. Visible to the AI when processing that file.
-a <user>Author-l <start>-<end>Line range (e.g. 1-50)codilay team annotate . src/api/routes.py "This file is getting too large, plan to split by domain" -a alice -l 1-50codilay team facts / decisions / conventions / annotations / usersList stored facts, decisions, conventions, file annotations, or team members. All support filtering flags.
-c <category>Filter facts by category-s active|supersededFilter decisions by status-f <file>Filter annotations by filecodilay team facts .# all factscodilay team facts . -c architecturecodilay team decisions . -s activecodilay team conventions .codilay team annotations . -f src/api/routes.pycodilay team users .codilay team voteUpvote or downvote a stored fact by its ID. Vote scores are surfaced to the AI to indicate community confidence.
codilay team vote . <fact-id> upschedule
codilay schedule setSets up automatic documentation re-runs triggered by a cron expression, new commits on a branch, or both. Runs as a background daemon with PID file management.
--cron <expr>Cron expression (e.g. "0 2 * * *" for 2am daily)--on-commitTrigger on every new commit--branch <name>Branch to watch (default: main)codilay schedule set . --cron "0 2 * * *"# daily at 2amcodilay schedule set . --on-commit --branch maincodilay schedule set . --cron "0 2 * * *" --on-commit# both triggerscodilay schedule startStarts the configured scheduler in the foreground.
-vVerbose loggingcodilay schedule start .codilay schedule start . -vcodilay schedule stopStops the running scheduler daemon for the project.
codilay schedule stop .codilay schedule statusDisplays the current schedule configuration and daemon status.
codilay schedule status .codilay schedule disableDisables the schedule without deleting it. Re-enable with schedule set.
codilay schedule disable .codilay.config.json
// place in your project root. all fields are optional — CodiLay works without it.
{
"ignore": ["dist/**", "**/tests/**"],
"notes": "This is a React/Next.js frontend using Tailwind.",
"instructions": "Focus on data-fetching patterns and state management.",
"llm": {
"provider": "anthropic",
"model": "claude-3-5-sonnet-latest"
}
}ignoreGlob patterns for files to exclude from scanning. Merged with .gitignore.
e.g. ["dist/**", "**/tests/**"]notesFree-text notes about the project. Injected into the LLM's system prompt on every run.
e.g. "This is a React/Next.js frontend using Tailwind."instructionsSpecific documentation instructions for the agent — what to emphasize, what to skip.
e.g. "Focus on data-fetching patterns and state management."llm.providerLLM provider to use for this project. Overrides global setup. Options: anthropic, openai, google, ollama, groq, deepseek, mistral, llama-cloud, or any OpenAI-compatible endpoint.
e.g. "anthropic"llm.modelSpecific model to use. Must be valid for the configured provider.
e.g. "claude-3-5-sonnet-latest"Multi-provider support
// CodiLay is provider-agnostic. configure globally via codilay setup or per-project via codilay.config.json.
claude-3-5-sonnet-latest, claude-3-haiku-...gpt-4o, gpt-4o-mini, o1, ...gemini-1.5-pro, gemini-flash, ...llama3, mistral, codellama, ...llama3-70b-8192, mixtral-8x7b, ...deepseek-coder, deepseek-chatmistral-large, codestral, ...llama-3.1-70b-instruct, ...Any endpoint with /v1/chat/completionsSource layout
// all source lives under src/codilay/.
cli.py# Command parsing & Interactive Menuscanner.py# Git-aware file walkingtriage.py# AI-powered file categorizationprocessor.py# The Agent Loop & large file chunkingwire_manager.py# Linkage & dependency resolutiondocstore.py# Living CODEBASE.md managementchatstore.py# Persistent memory & chat historyserver.py# FastAPI Intelligence Server (Web UI + API)watcher.py# File system watcher (watch mode)exporter.py# AI-friendly doc export (markdown/xml/json)doc_differ.py# Section-level doc diffing & version snapshotstriage_feedback.py# Triage correction store & feedback loopgraph_filter.py# Dependency graph filtering engineteam_memory.py# Shared team knowledge basesearch.py# Full-text conversation search (inverted index)scheduler.py# Cron & commit-based auto re-runsweb/# Premium web frontendpackage.json# Extension manifesttsconfig.json# TypeScript configsrc/extension.ts# Extension entry point — sidebar, webview, decorations, commands