Skip to content

ayusingh-54/CodeForge-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeForge-AI β€” Agents Without Frameworks

Everyone uses frameworks, but I wanted to understand the core logic.

CodeForge AI automates all of this using natural language. Describe what you want in plain English, and the AI handles the rest!- πŸ“§ Contact

Traditional Way: 30 minutes ⏱️ - πŸ› οΈ CLI Commands- πŸ› οΈ CLI Commands & Tools

CodeForge AI Way: 30 seconds ⚑


Technology Stack

---CodeForge AI (ayuverse) is a revolutionary autonomous coding assistant using cutting-edge AI to help you build software faster and smarter.

πŸ€– Intelligent Code Generation### The Problem

  • Natural Language: Describe tasks in plain English

  • Context-Aware: Understands your project structureModern developers waste hours on:- 🎯 Use Cases- 🎯 Real-World Use Cases

  • Multi-Step: Breaks complex tasks into manageable steps

  • Adaptive: Learns from your preferences in a session- Writing boilerplate code

  • Reference related issues- What files matter?EXA_API_KEY=your-key-here- Inspired by the ReAct methodology from research papers

  • Wait for review

  • What's the best approach?

Areas We Need Help

  • Any edge cases?CODEFORGE_MODEL=gpt-4o-mini

  • πŸ› Bug Fixes β€” Report and fix issues

  • πŸ“š Documentation β€” Improve guides and examplesCODEFORGE_TEMPERATURE=0.1

  • ✨ Features β€” New capabilities and tools

  • πŸ§ͺ Tests β€” Increase coverage#### Step 2: Acting βš™οΈCODEFORGE_MAX_STEPS=20

  • 🎨 UI β€” Improve terminal interface

  • 🌍 Translations β€” Support other languagesAI executes actions:````

  • πŸš€ Performance β€” Optimize slow parts

  • Reads relevant files

Contribution Guidelines

  • Searches for patterns### Model Configuration

  • Be respectful

  • Follow code style- Runs scripts

  • Add tests for new features

  • Update documentation- Performs git operationsYou can customize the AI model behavior:

  • Write meaningful commit messages


Step 3: Observing πŸ‘€- Model: Default is gpt-4o-mini (fast and cost-effective). Can use gpt-4o for more complex tasks

πŸ“ License {#license}

AI examines results:- Temperature: Controls randomness (0.0 = deterministic, 1.0 = creative). Default is 0.1

This project is licensed under the MIT License β€” see LICENSE for details.

  • Did it work?- Max Steps: Maximum number of reasoning steps per task. Default is 20

You Can:

  • βœ… Use for commercial projects- Need more info?

  • βœ… Modify the source code

  • βœ… Distribute the software- Any errors?## 🎯 Use Cases

  • βœ… Sublicense

  • What did we learn?

You Must:

  • βœ… Include license### Web Development

  • βœ… Include copyright notice

  • βœ… State changes made#### Step 4: Iterating πŸ”„

---AI adjusts based on observations:- Generate boilerplate code for web frameworks

πŸ“§ Contact {#contact}- Refine approach- Create API endpoints and route handlers

Developer: Ayus Singh - Execute next steps- Build responsive UI components

Email: ayusingh693@gmail.com

GitHub: @ayusingh-54- Return results

Questions or Feedback?- Ask for clarification### Data Science

Acknowledgments

The AI maintains awareness of:- Build visualization code

Built with ❀️ using:

  • OpenAI GPT-4o for reasoning- Project Structure: Your directory layout

  • LangChain for orchestration

  • LangGraph for workflows- Recent Changes: Files you've modified### DevOps

  • Rich for beautiful CLI

  • Python community- Dependencies: What modules are used

---- Session History: What you've asked before- Write automation scripts

- **Workspace State**: Current project state- Create configuration files

🌟 Like CodeForge AI? Give it a star! ⭐- Manage deployment workflows

**Your GitHub star motivates continued development!**This context enables intelligent decisions without mistakes.

---### Testing

Transform Your Coding Workflow Today---

CodeForge AI β€” Your Intelligent Coding Companion- Generate unit tests

30 seconds instead of 30 minutes. That's the CodeForge difference.## πŸ—οΈ Architecture- Create test fixtures

---- Build integration test suites

Made by Ayus Singh | πŸ“§ ayusingh693@gmail.com`````

**© 2024 CodeForge AI. All rights reserved.**CodeForge-AI/## 🀝 Contributing

Let's Connect! πŸ€β”‚

GitHub | Email | Issues | Discussionsβ”œβ”€β”€ main.py # Entry pointContributions are welcome! Here's how you can help:

β”‚

β”œβ”€β”€ ayuverse/ # Main package1. Fork the repository

β”‚ β”œβ”€β”€ init.py2. Create a feature branch (git checkout -b feature/amazing-feature)

β”‚ β”œβ”€β”€ config.py # Configuration3. Commit your changes (git commit -m 'Add amazing feature')

β”‚ β”‚4. Push to the branch (git push origin feature/amazing-feature)

β”‚ β”œβ”€β”€ core/ # Core AI logic5. Open a Pull Request

β”‚ β”‚ β”œβ”€β”€ init.py

β”‚ β”‚ β”œβ”€β”€ agent.py # ReAct agent orchestration## πŸ“ License

β”‚ β”‚ └── state.py # Workspace state tracking

β”‚ β”‚This project is licensed under the MIT License - see the LICENSE file for details.

β”‚ β”œβ”€β”€ tools/ # Available tools

β”‚ β”‚ β”œβ”€β”€ init.py## πŸ™ Acknowledgments

β”‚ β”‚ β”œβ”€β”€ tools.py # Tool implementations

β”‚ β”‚ └── registry.py # Tool registry- OpenAI for providing powerful language models

β”‚ β”‚- LangChain team for the excellent framework

β”‚ β”œβ”€β”€ ui/ # User interface- Rich library for beautiful terminal interfaces

β”‚ β”‚ β”œβ”€β”€ init.py- The open-source community for inspiration and tools

β”‚ β”‚ └── cli.py # Rich CLI interface

β”‚ β”‚## πŸ“§ Contact

β”‚ └── utils/ # Utilities

β”‚ β”œβ”€β”€ init.pyAuthor: Ayush Singh

β”‚ └── helpers.py # Helper functions

β”‚For questions, suggestions, or issues, please open an issue on GitHub.

β”œβ”€β”€ Frontend/ # Web UI (optional)

β”‚ β”œβ”€β”€ index.html---

β”‚ β”œβ”€β”€ styles.css

β”‚ └── script.js

β”‚ Built with ❀️ using OpenAI, LangChain, and Python

β”œβ”€β”€ Prompts/ # Prompt templates

β”‚ β”œβ”€β”€ V1.md CodeForge AI - Your Intelligent Coding Companion

β”‚ └── V2.md

β”‚ β”œβ”€β”€ requirements.txt # Dependencies β”œβ”€β”€ LICENSE # MIT License └── README.md # This file


### Core Components

**`agent.py` - The Brain**

- Runs the ReAct loop
- Decides which tools to use
- Manages workflows
- Returns results

**`state.py` - The Memory**

- Tracks current directory
- Maintains file history
- Stores session state
- Records operations

**`tools.py` - The Hands**

- File I/O operations
- Git commands
- Web search
- Script execution

**`cli.py` - The Interface**

- Terminal UI with Rich
- Syntax highlighting
- Progress indicators
- Interactive prompts

---

## βš™οΈ Configuration

### Environment Variables

Create `.env` with these options:

```env
# REQUIRED - Your OpenAI API key
OPENAI_API_KEY=sk-...

# OPTIONAL - Web search
EXA_API_KEY=your-key-here

# OPTIONAL - Fast inference
GROQ_API_KEY=your-key-here

# MODEL - Which AI model to use
# gpt-4o-mini (fast, cheap)
# gpt-4o (balanced)
# gpt-4 (powerful, expensive)
# gpt-3.5-turbo (fastest, cheapest)
CODEFORGE_MODEL=gpt-4o-mini

# TEMPERATURE - 0=deterministic, 1=creative
CODEFORGE_TEMPERATURE=0.1

# MAX STEPS - How many reasoning steps
CODEFORGE_MAX_STEPS=20

# DEBUG - Enable verbose logging
DEBUG=false

# LOG LEVEL - DEBUG, INFO, WARNING, ERROR
LOG_LEVEL=INFO
```

### Model Selection Guide

| Model         | Speed  | Cost   | Best For                 |
| ------------- | ------ | ------ | ------------------------ |
| gpt-4o-mini   | ⚑⚑⚑ | πŸ’°     | Quick tasks, prototyping |
| gpt-4o        | ⚑⚑   | πŸ’°πŸ’°   | Balanced, most tasks     |
| gpt-4         | ⚑     | πŸ’°πŸ’°πŸ’° | Complex reasoning        |
| gpt-3.5-turbo | ⚑⚑⚑ | πŸ’°     | Budget-friendly tasks    |

### Temperature Guide

**0.0 - Deterministic (Best for code)**

- Consistent, predictable output
- Good for: Code generation, technical tasks
- Example: "Write a sorting algorithm"

**0.5 - Balanced (Default)**

- Mix of reliability and creativity
- Good for: General tasks, refactoring

**1.0 - Creative (Best for ideas)**

- More varied, creative output
- Good for: Brainstorming, naming
- Example: "Suggest 5 cool project ideas"

---

## 🎯 Use Cases

### 1. Web Development 🌐

```
"Create a Flask REST API with:
- GET /api/products - list products
- GET /api/products/<id> - get one product
- POST /api/products - create product
- DELETE /api/products/<id> - delete product

Include authentication, error handling, and logging"
```

**Output:** Production-ready API with middleware!

---

### 2. Data Science πŸ“Š

```
"Write a Python script that:
- Loads CSV file
- Performs exploratory data analysis
- Creates visualizations (histograms, scatter plots)
- Exports statistics to JSON"
```

**Output:** Complete analysis pipeline with plots!

---

### 3. DevOps πŸš€

```
"Create a GitHub Actions workflow that:
- Runs on push to main
- Installs dependencies
- Runs tests
- Builds Docker image
- Pushes to registry"
```

**Output:** CI/CD pipeline ready to go!

---

### 4. Testing πŸ§ͺ

```
"Generate unit tests for the fibonacci function including:
- Basic functionality tests
- Edge cases (n=0, n=1, negative)
- Performance tests
- Error handling"
```

**Output:** Comprehensive test suite with pytest!

---

### 5. Code Refactoring πŸ”§

```
"Refactor agent.py for:
- Better readability
- Lower complexity
- Improved error handling
- Added type hints
- Better documentation"
```

**Output:** Clean, maintainable code!

---

### 6. Documentation πŸ“š

```
"Generate complete documentation:
- API endpoints with examples
- Setup instructions
- Troubleshooting guide
- Best practices"
```

**Output:** Professional documentation!

---

## πŸ”’ Security

CodeForge AI implements multiple security layers:

### Protection Mechanisms

1. **Path Traversal Prevention**

   - ❌ Blocks: `../../sensitive_files`
   - βœ… Allows: Only project directory access

2. **Safe Script Execution**

   - ❌ Blocks: `rm -rf`, network access
   - βœ… Runs: Safe scripts in isolated subprocess

3. **Destructive Operation Guards**

   - ❌ Refuses: Permanent file deletion
   - βœ… Requires: Explicit confirmation

4. **API Key Protection**

   - ❌ Never: Logs API keys
   - βœ… Uses: Environment variables securely

5. **Error Handling**
   - ❌ Doesn't: Expose system internals
   - βœ… Provides: Helpful error messages

### Safe Usage Practices

```python
# βœ… DO: Use environment variables
OPENAI_API_KEY=sk-...

# ❌ DON'T: Hardcode keys
api_key = "sk-..."

# βœ… DO: Review changes first
git diff

# βœ… DO: Use version control
git commit -am "Safe change"

# ❌ DON'T: Run untrusted code
:run untrusted_script.py
```

---

## 🀝 Contributing

We welcome contributions! Here's how:

### Contribution Steps

1. **Fork the Repository**

   - Click "Fork" on GitHub

2. **Create Feature Branch**

   ```bash
   git checkout -b feature/your-feature
   ```

3. **Make Changes**

   - Write clean code
   - Follow PEP 8
   - Add type hints
   - Document functions

4. **Test Changes**

   ```bash
   python -m pytest tests/
   ```

5. **Commit with Clear Messages**

   ```bash
   git commit -m "Add: description of changes"
   ```

6. **Push & Open PR**
   ```bash
   git push origin feature/your-feature
   ```

### Areas Needing Help

- πŸ› Bug fixes
- πŸ“š Documentation
- ✨ New features
- πŸ§ͺ Tests
- 🎨 UI improvements
- 🌍 Translations

### Development Setup

```bash
git clone https://github.com/YOUR_USERNAME/CodeForge-AI.git
cd CodeForge-AI

python -m venv .venv
source .venv/bin/activate  # Windows: .\.venv\Scripts\Activate.ps1

pip install -r requirements.txt
pip install pytest black flake8

# Format code
black ayuverse/

# Lint code
flake8 ayuverse/

# Run tests
pytest tests/
```

---

## πŸ“ License

Licensed under **MIT License** - see [LICENSE](LICENSE) file.

**You can:**

- βœ… Use for any purpose
- βœ… Modify and distribute
- βœ… Use commercially
- βœ… Sublicense

**You must:**

- πŸ“‹ Include license & copyright notice

---

## πŸ“§ Contact

**Created by:** Ayus Singh
**Email:** ayusingh693@gmail.com
**GitHub:** [@ayusingh-54](https://github.com/ayusingh-54)

### Questions?

- πŸ“– **Documentation**: See README sections
- πŸ› **Bug Report**: Open GitHub issue
- πŸ’‘ **Feature Request**: Create issue with details
- πŸ’¬ **Questions**: Email me anytime

### Share Your Experience

I'd love to hear:

- How you're using CodeForge AI
- Feature ideas
- Bug reports
- Success stories
- Feedback

---

<div align="center">

### 🌟 Like CodeForge AI? Star us on GitHub! ⭐

**Built with ❀️ using OpenAI, LangChain, and Python**

**CodeForge AI β€” Your Intelligent Coding Companion**

_Transform your coding workflow with AI today!_

---

Made by **Ayus Singh** | [ayusingh693@gmail.com](mailto:ayusingh693@gmail.com)

</div>

About

CodeForge AI automates all of this using natural language. Describe what you want in plain English, and the AI handles the rest

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors