Talk to your entire codebase like it's a living system.
| Command | Description |
|---|---|
cni analyze |
Scan a repository, build a dependency graph, and print stats. |
cni graph |
Build and display the dependency graph for a repository. |
cni path |
Find the shortest dependency path between two files. |
cni explain |
Explain how a file participates in the dependency graph. |
cni ask |
Ask a natural-language question about the codebase (via LLM). |
# Clone the repo
git clone https://github.com/Slambot01/CNI_ATLAS.git
cd CNI_ATLAS
# Install in editable mode
pip install -e .CNI uses Ollama for local LLM inference.
# Install Ollama (see https://ollama.com/download)
# Start the server
ollama serve
# Pull the default model
ollama pull qwen2.5-coder:7bCNI caches scan results in <repo_root>/.cni/cache.json.
The cache stores scanned file paths, dependency edges, and file
modification timestamps.
To clear the cache simply delete the file:
rm -rf .cni/The next cni analyze run will perform a full rescan.
Note: If you installed via
pip install -e .and get an error thatcniis not recognized (common on Windows), your Python Scripts directory is not on your system PATH. You can simply usepython -m cniinstead ofcnifor all commands below.
$ cni analyze .
Analyzing repository...
Files scanned: 12
Dependency graph built.
Repository statistics
------------------------------
Files indexed : 12
Dependencies : 8
Isolated files : 3
Most imported : 4 dependents$ cni graph .
Building dependency graph...
Files scanned: 12
Dependency graph built.
Repository statistics
------------------------------
Files indexed : 12
Dependencies : 8
Isolated files : 3
Most imported : 4 dependents$ cni path cni/cli/main.py cni/graph/graph_builder.py
Scanning repository...
Building dependency graph...
Searching dependency path...
main.py
→ graph_builder.py$ cni explain graph_builder.py
Scanning repository...
Building dependency graph...
Analyzing file...
File: graph_builder.py
Imports:
repo_scanner.py
Imported by:
main.py$ cni ask "What does repo_scanner do?"
Scanning repository...
Building dependency graph...
Retrieving relevant context...
Querying LLM...
repo_scanner.py recursively walks a directory tree and collects
all Python (.py), JavaScript (.js), and TypeScript (.ts) source files,
skipping common non-source directories like .git and node_modules.Generate a demo dependency graph:
python docs/generate_demo.pycni/
├── __init__.py
├── cli/
│ ├── __init__.py
│ └── main.py # Typer CLI entrypoint
├── analyzer/
│ ├── __init__.py
│ └── repo_scanner.py # Repository file scanner
├── graph/
│ ├── __init__.py
│ ├── graph_builder.py # Dependency graph builder
│ └── export.py # Graphviz export with clustering
├── analysis/
│ ├── __init__.py
│ ├── path_finder.py # Shortest dependency path
│ └── explainer.py # File-level dependency explainer
├── retrieval/
│ ├── __init__.py
│ ├── semantic_search.py # Sentence-transformer semantic search
│ └── context_builder.py # LLM context builder
├── llm/
│ ├── __init__.py
│ └── llm_client.py # Ollama LLM client
└── storage/
├── __init__.py
└── cache.py # JSON-based scan cache
docs/
└── generate_demo.py # Demo graph generation script
pyproject.toml
README.md
