Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NicWeiss/PocketFlow-Tutorial-Codebase-Knowledge

 
 

Repository files navigation

Turns Codebase into Easy Tutorial with AI

License: MIT

This is a tutorial project of Pocket Flow, a 100-line LLM framework. It crawls GitHub repositories and builds 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.

⭐ Example Results for Popular GitHub Repositories!

🚀 Getting Started

  1. Clone this repository

  2. Install python 3.10 venv inside project folder:

     pyenv install 3.10
     pip install virtualenv
     virtualenv --python="~/.pyenv/versions/3.10/bin/python3.10" venv
     source venv/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Copy example configuration for Google AI studio:

    cp .env_example .env

    If you need more settings, check /utils/settings.py

    • ollama settings
    • google project settings
    • ... and more
  5. Generate a complete codebase tutorial by running the main script:

    # Analyze a GitHub repository
    python main.py --repo https://github.com/username/repo --include "*.py" "*.js" --exclude "tests/*" --max-size 50000
    
    # Or, analyze a local directory
    python main.py --dir /path/to/your/codebase --include "*.py" --exclude "*test*"
    
    # Or, generate a tutorial in Chinese
    python main.py --repo https://github.com/username/repo --language "Chinese"
    • --repo or --dir - Specify either a GitHub repo URL or a local directory path (required, mutually exclusive)
    • -n, --name - Project name (optional, derived from URL/directory 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)
    • --language - Language for the generated tutorial (default: "russian")

The application will crawl the repository, analyze the codebase structure, generate tutorial content in the specified language, and save the output in the specified directory (default: ./output).

About

Improved Flow Tutorial Project: Turns GitHub repo into Tutorial with AI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%