codai  by meysamhadeli

AI code assistant CLI tool for code suggestions, refactoring, and reviews

created 9 months ago
347 stars

Top 81.1% on sourcepulse

GitHubView on GitHub
Project Summary

Codai is an AI-powered CLI tool designed to assist developers with code suggestions, refactoring, and reviews by understanding the full context of a project. It supports multiple LLM providers and offers two primary methods for context management: Retrieval-Augmented Generation (RAG) and Tree-sitter-based summarization, aiming to provide accurate, token-efficient responses.

How It Works

Codai employs RAG by embedding the entire codebase to retrieve relevant information based on user input, sending only necessary context to the LLM for efficient and accurate suggestions. Alternatively, it uses Tree-sitter to summarize the project's full context, sending code signatures and partial implementations to the LLM, which saves tokens but may use slightly more than RAG.

Quick Start & Requirements

  • Install globally: go install github.com/meysamhadeli/codai@latest
  • Set environment variables: CHAT_API_KEY and optionally EMBEDDINGS_API_KEY.
  • Configuration can be managed via codai-config.yml or command-line arguments.
  • Supports multiple LLM providers (OpenAI, DeepSeek, Ollama, etc.) and various programming languages.
  • Official documentation and configuration examples are available.

Highlighted Details

  • Supports multiple LLM providers including OpenAI, DeepSeek, Ollama, Azure OpenAI, Anthropic, and OpenRouter.
  • Utilizes RAG with embedding models (e.g., OpenAI's text-embedding-3-small) and Tree-sitter for context summarization.
  • Offers features like context-aware code completion, refactoring, bug fixing, code reviews, and multi-file modifications.
  • Tracks and represents token consumption per request.

Maintenance & Community

  • Project is actively under development with plans for new features.
  • Contributions are welcomed via pull requests and issues.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

  • The project is described as a work in progress, with features to be added over time.
  • Specific LLM and embedding model recommendations are provided for optimal performance.
Health Check
Last commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
31 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.