Files
PocketFlow-Tutorial-Codebas…/README.md
T

94 lines
5.2 KiB
Markdown
Raw Normal View History

2025-04-04 17:22:40 -04:00
<h1 align="center">Turns Codebase into Easy Tutorial with AI</h1>
2025-04-04 13:01:50 -04:00
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
2025-04-04 14:44:46 -04:00
> *Ever stared at a new codebase written by others feeling completely lost? This tutorial shows you how to build an AI agent that analyzes GitHub repositories and creates beginner-friendly tutorials explaining exactly how the code works.*
2025-04-02 16:56:35 -04:00
<p align="center">
<a href="https://github.com/The-Pocket/PocketFlow" target="_blank">
<img
2025-04-04 13:01:50 -04:00
src="./assets/banner.png" width="800"
2025-04-02 16:56:35 -04:00
/>
</a>
</p>
2025-04-04 14:43:52 -04:00
This is a tutorial project of [Pocket Flow](https://github.com/The-Pocket/PocketFlow), a 100-line LLM framework. It crawls GitHub repositories and build a knowledge base from the code. It analyzes entire codebases to identify core abstractions and how they interact, and transforms complex code into beginner-friendly tutorials with clear visualizations.
2025-04-04 13:01:50 -04:00
2025-04-04 15:06:41 -04:00
## ⭐ Example Tutorials for Popular GitHub Repositories!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [AutoGen Core](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/AutoGen%20Core) - Build AI teams that talk, think, and solve problems together like coworkers!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Browser Use](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Browser%20Use) - Let AI surf the web for you, clicking buttons and filling forms like a digital assistant!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Celery](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Celery) - Supercharge your app with background tasks that run while you sleep!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Click](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Click) - Turn Python functions into slick command-line tools with just a decorator!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Crawl4AI](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Crawl4AI) - Train your AI to extract exactly what matters from any website!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [CrewAI](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/CrewAI) - Assemble a dream team of AI specialists to tackle impossible problems!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [DSPy](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/DSPy) - Build LLM apps like Lego blocks that optimize themselves!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [FastAPI](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/FastAPI) - Create APIs at lightning speed with automatic docs that clients will love!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Flask](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Flask) - Craft web apps with minimal code that scales from prototype to production!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [LangGraph](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/LangGraph) - Design AI agents as flowcharts where each step remembers what happened before!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [LevelDB](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/LevelDB) - Store data at warp speed with Google's engine that powers blockchains!
2025-04-04 14:38:11 -04:00
2025-04-04 17:07:28 -04:00
- [MCP Python SDK](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/MCP%20Python%20SDK) - Build powerful apps that communicate through an elegant protocol without sweating the details!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [NumPy Core](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/NumPy%20Core) - Master the engine behind data science that makes Python as fast as C!
2025-04-04 14:38:11 -04:00
2025-04-04 17:08:07 -04:00
- [OpenManus](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/OpenManus) - Build AI agents with digital brains that think, learn, and use tools just like humans do!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Pydantic Core](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Pydantic%20Core) - Validate data at rocket speed with just Python type hints!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [Requests](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/Requests) - Talk to the internet in Python with code so simple it feels like cheating!
2025-04-04 14:38:11 -04:00
2025-04-04 14:42:14 -04:00
- [SmolaAgents](https://the-pocket.github.io/Tutorial-Codebase-Knowledge/SmolaAgents) - Build tiny AI agents that punch way above their weight class!
2025-04-04 14:38:11 -04:00
2025-04-04 15:16:58 -04:00
## 🚀 Getting Started
1. Clone this repository
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Generate a complete codebase tutorial by running the main script:
```bash
python main.py https://github.com/username/repo --include "*.py" "*.js" --exclude "tests/*" --max-size 50000
```
- `repo_url` - URL of the GitHub repository (required)
- `-n, --name` - Project name (optional, derived from URL if omitted)
- `-t, --token` - GitHub token (or set GITHUB_TOKEN environment variable)
- `-o, --output` - Output directory (default: ./output)
- `-i, --include` - Files to include (e.g., "*.py" "*.js")
- `-e, --exclude` - Files to exclude (e.g., "tests/*" "docs/*")
- `-s, --max-size` - Maximum file size in bytes (default: 100KB)
- Crawl GitHub repositories at specific commits or branches
- Filter files by patterns (include/exclude)
- Set maximum file size limits
- Generate relative paths for simpler directory structures
The application will crawl the repository, analyze the codebase structure, generate tutorial content, and save the output in the specified directory (default: ./output).
## 💡 Development Tutorial
- I built using [**Agentic Coding**](https://zacharyhuang.substack.com/p/agentic-coding-the-most-fun-way-to), the fastest development paradigm, where humans simply [design](docs/design.md) and agents [code](flow.py).
- The secret weapon is [Pocket Flow](https://github.com/The-Pocket/PocketFlow), a 100-line LLM framework that lets Agents (e.g., Cursor AI) build for you
- Step-by-step YouTube development tutorial coming soon! Please subscribe to my [YouTube Channel](https://www.youtube.com/@ZacharyLLM?sub_confirmation=1)
2025-04-04 14:38:11 -04:00