Skip to content

AI-powered coding agent for your codebase. Generate, review, fix, and refactor code with intelligent assistance.

License

Notifications You must be signed in to change notification settings

deoninja/code-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Agent CLI

AI-powered coding agent for your codebase. Generate, review, fix, and refactor code with intelligent assistance.

🚀 Features

  • Code Generation: Create entire applications, components, or functions
  • Interactive Chat: Natural language coding assistance
  • Code Review: Analyze code for bugs, performance, and best practices
  • Bug Fixing: Automatically detect and fix issues
  • Code Refactoring: Modernize and improve existing code
  • Multi-Provider: Support for Ollama, LM Studio, and Google Gemini

📦 Installation

From GitHub

git clone https://github.com/deoninja/code-agent.git
cd code-agent/cli
npm install
npm run build
npm link

From NPM (Coming Soon)

npm install -g code-agent-cli

⚙️ Configuration

Configure your AI provider:

code-agent config

Choose from:

  • Ollama (Local): http://localhost:11434/v1/chat/completions
  • LM Studio (Local): http://localhost:1234/v1/chat/completions
  • Google Gemini: Requires API key

🎯 Usage

Generate Code

# Create entire applications
code-agent generate "create a REST API with user authentication"
code-agent generate "build a React todo app" --framework react
code-agent generate "create a Python FastAPI backend" --framework fastapi

# Generate specific components
code-agent generate "add a login component" --type component
code-agent generate "create JWT middleware" --type function

Interactive Chat

code-agent chat

Then ask questions like:

  • "Create a new Express.js route for file uploads"
  • "Add error handling to my authentication middleware"
  • "Optimize this database query"

Code Review

# Review entire codebase
code-agent review --all

# Review specific files
code-agent review src/app.ts src/utils.ts

Fix Bugs

code-agent fix src/buggy-file.ts

Refactor Code

code-agent refactor src/old-code.ts -s "use modern async/await"
code-agent refactor src/component.jsx -s "convert to TypeScript"

🛠️ Commands

Command Description Options
config Configure AI provider settings -
chat Start interactive chat mode -p, --path <path>
generate <description> Generate new code/apps -t, --type <type>, -f, --framework <framework>
review [files...] Review code for issues -a, --all
fix <file> Fix bugs in specific file -
refactor <file> Refactor code -s, --suggestion <text>

🎨 Generation Types

  • app - Complete applications
  • component - UI components
  • function - Individual functions
  • test - Unit tests
  • api - API endpoints

🔧 Supported Frameworks

  • Frontend: React, Vue, Angular, Svelte
  • Backend: Express, FastAPI, Django, Spring Boot
  • Mobile: React Native, Flutter
  • Desktop: Electron, Tauri

📁 Project Structure

Navigate to your project directory before running commands:

cd my-project
code-agent chat

The agent will understand your project structure and provide contextual assistance.

🤖 AI Providers Setup

Ollama (Recommended for Local)

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Pull a model
ollama pull llama3.1:8b

# Configure code-agent
code-agent config
# Select: ollama
# URL: http://localhost:11434/v1/chat/completions
# Model: llama3.1:8b

LM Studio

  1. Download and install LM Studio
  2. Load a model and start the server
  3. Configure code-agent with http://localhost:1234/v1/chat/completions

Google Gemini

  1. Get API key from Google AI Studio
  2. Configure code-agent and enter your API key

📝 Examples

Create a Full-Stack App

code-agent generate "create a task management app with React frontend and Express backend"

Add Authentication

code-agent generate "add JWT authentication to my Express API" --type function

Interactive Development

code-agent chat
> "Add a dark mode toggle to my React app"
> "Create a database migration for user roles"
> "Optimize my API response times"

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT License - see LICENSE file for details.

👨‍💻 Author

Deo Trinidad


⭐ Star this repo if you find it helpful!

About

AI-powered coding agent for your codebase. Generate, review, fix, and refactor code with intelligent assistance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published