How cloi-ai/cloi works
Project type and purpose
• Cloi CLI is a local, context-aware debugging agent that runs entirely in the terminal. It’s an open-source CLI tool written in Node.js (with some Python helpers) that uses a local Ollama LLM to analyze errors and apply patches to the codebase.
File structure
• Top-level “bin/” folder holds the entrypoint scripts for installation (“cloi-setup.cjs”, “index.js”, plus Python setup).
• “src/” is divided into four main subdirectories:
• cli/ – handles parsing of terminal commands and interactive session loop.
• core/ – implements the main debugging pipeline (command orchestration, LLM calls, patch generation, error traceback analysis).
• utils/ – miscellaneous helpers (file I/O, command history, Ollama API wrappers in Python/JS, optimization, temp script management).
• There are configuration files (package.json, requirements.txt) and setup scripts that ensure both Node.js and Python runtimes are ready.
README for additional insights
• Confirms 100% local operation, no external API keys, integrates with Ollama locally installed models, and provides interactive slash commands (/debug, /model, /history, /help).
• Mentions internal architecture changes (structured outputs, history/traceback refactors), pointing to modular separation between core logic and utilities.