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 β‘
-
OpenAI GPT-4o/GPT-4o-mini β Intelligent reasoning (direct API integration)- π§ How ReAct Works- π§ How It Works - The ReAct Framework
-
ReAct Framework β Reason + Act methodology for autonomous agents
-
Pure Python β No heavy frameworks, just clean Python code## π About CodeForge AI {#about}
-
Rich β Beautiful terminal UI with syntax highlighting
-
Python 3.8+ β Core language- ποΈ Architecture- ποΈ Project Architecture
---CodeForge AI (ayuverse) is a revolutionary autonomous coding assistant using cutting-edge AI to help you build software faster and smarter.
β Key Features {#features}- βοΈ Configuration- βοΈ Configuration Guide
-
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?
-
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
-
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
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
-
β Use for commercial projects- Need more info?
-
β Modify the source code
-
β Distribute the software- Any errors?## π― Use Cases
-
β Sublicense
-
What did we learn?
-
β Include license### Web Development
-
β Include copyright notice
-
β State changes made#### Step 4: Iterating π
---AI adjusts based on observations:- Generate boilerplate code for web frameworks
Developer: Ayus Singh - Execute next steps- Build responsive UI components
Email: ayusingh693@gmail.com
GitHub: @ayusingh-54- Return results
-
π Documentation: Check README sections
-
π Bug Report: Open GitHub Issue
-
π‘ Feature Request: GitHub Discussions### Context Awareness- Create data processing pipelines
-
π¬ Direct Contact: Email ayusingh693@gmail.com
-
Generate analysis scripts
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
**Your GitHub star motivates continued development!**This context enables intelligent decisions without mistakes.
---### Testing
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
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>