CodeFabric is an AI-powered code generation framework that spins up full projects from natural language requirements using LangGraph workflows.
Project description
🚀 CodeFabric: AI Code Generation Package
Welcome to CodeFabric, your AI-powered coding assistant that generates full projects from plain English! Feed it your idea, and it crafts clean code like a digital artisan 🧙♂️—powered by LangGraph for agentic reasoning and execution.
⚠️ Before You Start: If you are using CLI version, you must set your OpenAI API key in your environment variables or
.envfile as:OPENAI_API_KEY=your_openai_api_key_here
Features 🌟
- 🧑💻 Interactive CLI with beautiful UI (Rich-based) to generate projects quickly
- 🔁 Programmatic API for power users and automation
- 🧠 LLM-driven reasoning, powered by LangGraph
- ⚙️ Supports multiple technologies via the
Technologiesenum - 🧩 Pluggable LLM support (use OpenAI or your custom one)
- 📦 Auto setup with logging and task breakdowns
Prerequisites 🛠️
- Python 3.8+
pipinstalled- Project-specific tools (Node.js for JS projects, etc.)
- Set
OPENAI_API_KEYin your environment or.envfile
📦 Installation
pip install codefabric
🖥️ Option 1: CLI (Recommended)
Launch the interactive CLI to generate a full-stack project with guided input:
codefabric
You'll be prompted to:
- 📝 Enter project name
- 💡 Describe what the project does
- 💻 Choose a technology stack (e.g., Python, Node.js, etc.)
- ✅ Confirm creation
Once confirmed, CodeFabric will automatically generate your full project folder based on your inputs using LangGraph-powered AI agents.
Example CLI Output:
📝 Project Name: portfolio-app
💡 Description: A personal portfolio site with blog and contact form
💻 Technology: Next.js
Your project will be generated and saved into portfolio-app-any/. Logs are printed during generation.
🧠 Option 2: Programmatic API Usage
You can use CodeFabric inside your own Python script for advanced or automated workflows:
from codefabric.graph.developer_agent import DeveloperAgent
from codefabric.types.models import Requirements
from codefabric.types.enums import Technologies
process_id = "leetcode-agent"
project_description = """Build a python AI agent that takes LeetCode DSA questions, identifies patterns, explains how to solve, and builds a Streamlit app."""
dev_agent = DeveloperAgent(
process_id=process_id,
requirements=Requirements(
project_name="leetcode-agent",
project_description=project_description,
packages=[],
technology=Technologies.PYTHON.value,
),
)
dev_agent.run()
Run it:
python run_agent.py
🔑 Setting Up API Key
To use OpenAI models, add your key to a .env file:
OPENAI_API_KEY=your_openai_api_key_here
Or set it in your shell:
export OPENAI_API_KEY=your_openai_api_key_here
🗺️ Project Flow
Here’s how CodeFabric works internally:
- Parses your idea into structured requirements
- Constructs LangGraph agent flow
- Generates folder structure, code files, and dependencies
- Final project is ready-to-run 🚀
🐞 Troubleshooting
ModuleNotFoundError? → Runpip install codefabricOPENAI_API_KEYerror? → Set it in your environment or.env- Still stuck? → Check terminal logs
🤝 Contributing
Pull requests welcome! Fork the repo, make your changes, and help improve CodeFabric.
📜 License
MIT License. Use freely, build responsibly. Don’t unleash rogue AI without giving us a high-five. 🤖✋
Happy coding! ✨ May your agents be smart, and your bugs be few.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codefabric-0.1.3.tar.gz.
File metadata
- Download URL: codefabric-0.1.3.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d648f86221622a050ae89a630fc9f21749beea31d155792bbd48dff92a66806
|
|
| MD5 |
db3579d49196a5ee7f19835bf1a17507
|
|
| BLAKE2b-256 |
405e197461b37a9d955f42bf5deb6731ab337d0d1228ebdda95d84606451ef49
|
File details
Details for the file codefabric-0.1.3-py3-none-any.whl.
File metadata
- Download URL: codefabric-0.1.3-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea43929e2c9b73a0982b96ae96f0f976ea79fe86f2863ae061f2496a8088ed0a
|
|
| MD5 |
49ad10479b01df76a9ef706712de3ffd
|
|
| BLAKE2b-256 |
1b5637af9cd5aca085997f5fc0ca4350a4824f6123a9cc3713afa1cd0662700b
|