Skip to main content

AI-powered GitHub repo analyzer CLI — analyze, chat, and visualize any codebase. Run 'gitputra info' to see all commands and features.

Project description

🔍 GitPutra

GitPutra Logo

PyPI Version Python Versions Downloads License AI Providers

AI-powered GitHub repository analyzer CLI.
Clone any repo, generate a structured analysis report, visualize architecture, and chat with your codebase — all from the terminal.


✨ Features

  • 🔍 Deep Repo Analysis — AI-generated structured report covering Summary, Architecture, Tech Stack, Issues, and Suggested Improvements
  • 💬 RAG Chat — Ask questions about any codebase using Retrieval-Augmented Generation (ChromaDB + embeddings)
  • 🤖 Multi-AI Support — Works with Google Gemini & OpenAI
  • 🌿 Branch Support — Analyze or chat with any specific branch of a repo
  • 📊 Dependency Diagrams — Auto-generates NetworkX graph diagram + Mermaid flowchart
  • 📄 Multilingual PDF Reports — Exports analysis as a styled PDF in ~110 languages
  • 🗂️ Smart Indexing — Skips re-embedding if a repo is already indexed; run clear-db to reset
  • 📁 48+ File Types — Supports Python, C/C++, Java, Go, Rust, JS/TS, and many more
  • 🧠 Context Export — Export your entire codebase as a portable Markdown file to paste into any AI tool

📦 Installation

pip install gitputra

Requires Python 3.10+


🚀 Usage & Examples

Analyze a Repository

# Remote repo
gitputra analyze https://github.com/user/repo --ai gemini --key YOUR_API_KEY

# Local codebase (no cloning)
gitputra analyze ./my-project --local --ai gemini --key YOUR_API_KEY
gitputra analyze "C:\path\with spaces\project" --local --ai gemini --key YOUR_API_KEY

With options:

# Use OpenAI, output in Bengali, skip diagram
gitputra analyze https://github.com/user/repo --ai openai --key YOUR_KEY --lang Bengali --no-diagram

# Analyze a specific branch
gitputra analyze https://github.com/user/repo --branch dev --ai gemini --key YOUR_API_KEY

Outputs saved to ./output/:

  • report.pdf — Full analysis report
  • diagram.png — Dependency graph
  • mermaid.txt — Mermaid flowchart source

Chat with a Repository

# Remote repo
gitputra chat https://github.com/user/repo --ai gemini --key YOUR_API_KEY

# Local codebase
gitputra chat ./my-project --local --ai gemini --key YOUR_API_KEY
💬 Chat mode [repo] — ask anything about the repo. Type 'exit' to quit.

>>  What does the main.py file do?
>>  How is authentication handled?
>>  exit

If analyze was already run on the repo, chat reuses the existing index automatically.

# Chat with a specific branch
gitputra chat https://github.com/user/repo --branch feature/my-branch --ai gemini --key YOUR_API_KEY

If --branch is not specified, the repo's default branch is used.


Export Codebase Context

Export your entire codebase as a single Markdown file you can paste into any AI tool (ChatGPT, Gemini…) to continue work without re-explaining the project.

# Local codebase — fast, no API key needed (no AI summaries)
gitputra export-context ./my-project

# With AI summaries (requires --use-ai and an API key)
gitputra export-context ./my-project --use-ai --ai gemini --key YOUR_API_KEY

# Remote GitHub repo
gitputra export-context https://github.com/user/repo --remote --ai gemini --key YOUR_API_KEY

# Remote repo, specific branch, with AI summaries
gitputra export-context https://github.com/user/repo --remote --branch dev --use-ai --ai gemini --key YOUR_API_KEY

# Scan current directory
gitputra export-context

# Path with spaces — wrap in quotes
gitputra export-context "C:\Users\you\My Project"

Output saved to ./output/context_<project_name>_<timestamp>.md

How to use the exported file:

  1. Open the .md file
  2. Paste it into any AI chat (ChatGPT, Gemini…)
  3. Say: "Here is my codebase context. Read it and help me continue."

Other Commands

# Wipe the local ChromaDB index
gitputra clear-db

# Show all commands, supported AIs, languages, and file extensions
gitputra info

# Check version
gitputra --version

🤖 AI Providers

Flag Provider Text Model Embedding Model
--ai gemini Google Gemini gemini-2.5-flash gemini-embedding-001
--ai openai OpenAI gpt-4o-mini text-embedding-3-large

Setting up your API Key

Option 1 — .env file (recommended):

API_KEY=your_api_key_here

Option 2 — CLI flag:

gitputra analyze https://github.com/user/repo --key YOUR_API_KEY

Avoid Option 2 in shared environments — CLI flags appear in shell history.


🌍 Supported Languages (PDF Output)

GitPutra can generate PDF reports in ~110 languages across 3 scripts:

Latin Script (~100 languages)

English, French, Spanish, Portuguese, Italian, German, Dutch, Swedish, Norwegian, Danish, Finnish, Polish, Czech, Slovak, Hungarian, Romanian, Croatian, Serbian (Latin), Slovenian, Albanian, Lithuanian, Latvian, Estonian, Turkish, Azerbaijani, Uzbek, Kazakh (Latin), Turkmen, Indonesian, Malay, Filipino, Swahili, Zulu, Xhosa, Afrikaans, Yoruba, Igbo, Hausa, Somali, Kinyarwanda, Welsh, Irish, Basque, Catalan, Galician, Maltese, Icelandic, Faroese, Vietnamese, Hawaiian, Maori, and more.

Bengali Script

Bengali, Assamese

Devanagari Script

Hindi, Marathi, Nepali, Sanskrit, Maithili, Konkani, Bodo, Dogri

The AI response language depends on the chosen model's capability. Use --lang to set the output language.

gitputra analyze https://github.com/user/repo --ai gemini --key KEY --lang Bengali

📁 Supported File Extensions (49 types)

Category Extensions
Python .py, .ipynb
C/C++ .c, .h, .cpp
Web .js, .ts, .jsx, .tsx, .html, .css, .vue
JVM .java, .kt, .kts, .scala, .groovy, .clj, .cljs
Systems .go, .rs, .swift, .dart
Scripting .sh, .bat, .ps1, .pl, .lua, .r, .m, .rb, .php, .coffee, .elm
Config .json, .yaml, .yml, .xml, .ini, .cfg, .conf, .gradle, .makefile
Docs .md, .txt, .log, .sql, .pdf
Special Dockerfile, Makefile

👨‍💻 Author

Adityava Gangopadhyay

Feel free to reach out for any suggestions or issues!


📄 License

MIT License — free to use, modify, and distribute.

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

gitputra-0.2.7.tar.gz (485.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitputra-0.2.7-py3-none-any.whl (483.0 kB view details)

Uploaded Python 3

File details

Details for the file gitputra-0.2.7.tar.gz.

File metadata

  • Download URL: gitputra-0.2.7.tar.gz
  • Upload date:
  • Size: 485.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitputra-0.2.7.tar.gz
Algorithm Hash digest
SHA256 48aace9a1a8de0d7454e67a8dca9fb145753e8eba40445f363632abe15850934
MD5 044912d97368b9036187fe81a98c2a89
BLAKE2b-256 049944d8c3642840458285f78f24deb49648943af034ee1789e1e612dce29ec9

See more details on using hashes here.

File details

Details for the file gitputra-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: gitputra-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 483.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for gitputra-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 806a4c5cb88c65481e6dea5e37b167b2eb069bef1585c86f6af402a6254406f0
MD5 dde2a514508160054c7ff0d4de668e55
BLAKE2b-256 29a393de3f4a7a130ea3fb2044f83d82b663efeccf48b404362de1040272e66a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page