codai  by meysamhadeli

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

Created 11 months ago
360 stars

Top 77.7% 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 weeks ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Starred by Jared Palmer Jared Palmer(Ex-VP AI at Vercel; Founder of Turborepo; Author of Formik, TSDX), Vincent Weisser Vincent Weisser(Cofounder of Prime Intellect), and
8 more.

llm-vscode by huggingface

0.1%
1k
VSCode extension for LLM-powered code development
Created 2 years ago
Updated 1 year ago
Starred by Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), Will Brown Will Brown(Research Lead at Prime Intellect), and
7 more.

avante.nvim by yetone

0.5%
16k
Neovim plugin emulating Cursor AI IDE for AI-driven code assistance
Created 1 year ago
Updated 16 hours ago
Feedback? Help us improve.