AI-powered GitHub repo analyzer CLI โ analyze, chat, and visualize any codebase. Run 'gitputra info' to see all commands and features.
Project description
๐ GitPutra
โ Analyze โ Visualize โ Synthesize โ
Clone any repo, generate a structured analysis report, visualize architecture, and chat with your codebase โ all from the terminal.
Turn any online Repository or local codebase into AI memory
โจ Features
-
๐ See Beyond the Code โ Turn any repository into a fully mapped system โ architecture, patterns, flaws, and opportunities laid bare.
-
๐ง Export the Brain of Your Project โ Switched AI tools? No need to re-explain your entire codebase. Export the full project context โ with a function inventory, module dependency graph, and function-level call graph โ into a single Markdown file, ready to paste into any AI chat.
-
๐ฌ Talk to Your Codebase โ Ask anything. Get answers grounded in context, not guesses, powered by RAG and semantic search.
-
๐ค Choose Your Intelligence โ Switch effortlessly between Google Gemini & OpenAI.
-
๐ Watch Structure Come Alive โ Transform raw code into interactive HTML graphs (full call graph, cross-module graph, module dependency graph) powered by pyvis, plus Mermaid diagrams in multiple types (architecture, sequence, class, flowchart) โ all saved to your
output/folder. -
๐ Reports That Speak Your Language โ Export analysis as a styled PDF in ~110 languages.
-
๐ Context Export without Internet โ No API key required for a full context export. The functionality graph, call map, and file tree are built entirely offline using Tree-sitter AST parsing.
-
๐ฟ Every Branch Has a Story โ Analyze or chat with any specific branch of a repo.
-
๐๏ธ Memory That Doesn't Waste Time โ Skips re-embedding if a repo is already indexed; run
clear-dbto reset. -
๐ Understands Almost Every File Type โ From Python to Rust, configs to notebooks โ your entire stack, decoded (50+ file types supported).
-
๐๏ธ Chat Memory That Remembers What You Said โ Conversations don't reset into oblivion. Context is preserved across interactions, allowing deeper, more coherent discussions with your codebase over time.
๐ฆ Installation
pip install gitputra
Requires Python 3.10+
๐บ๏ธ Show all commands, supported AIs, languages, and file extensions
gitputra info
๐ Usage & Examples
Analyze a Repository
# Remote repo
gitputra analyze https://github.com/user/repo --ai gemini --key YOUR_API_KEY
# API key stored in .env or entered at prompt
gitputra analyze https://github.com/user/repo --ai gemini
# 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
# Local codebase โ API key stored in .env or entered at prompt
gitputra analyze ./my-project --local --ai gemini
With options:
# Use OpenAI, output in Bangla, skip diagram
gitputra analyze https://github.com/user/repo --ai openai --key YOUR_KEY --lang Bangla --no-diagram
# Analyze a specific branch
gitputra analyze https://github.com/user/repo --branch dev --ai gemini --key YOUR_API_KEY
# Skip PDF generation
gitputra analyze https://github.com/user/repo --ai gemini --key YOUR_API_KEY --no-pdf
# API key stored in .env or entered at prompt
gitputra analyze https://github.com/user/repo --branch dev --ai gemini
Outputs saved to ./output/:
report.pdfโ Full analysis reportdiagram_full.htmlโ Interactive full call graph (every intra-project function call)diagram_crossmodule.htmlโ Interactive cross-module call graph (only edges that cross module boundaries)diagram_modules.htmlโ Interactive module dependency graph (one node per file, edge weight = call count)mermaid_<type>.txtโ Mermaid diagram source (graph, flowchart, flowchart LR, architecture, sequence, class)
Chat with a Repository
# Remote repo
gitputra chat https://github.com/user/repo --ai gemini --key YOUR_API_KEY
# API key stored in .env or entered at prompt
gitputra chat https://github.com/user/repo --ai gemini
# Local codebase
gitputra chat ./my-project --local --ai gemini --key YOUR_API_KEY
# Local codebase โ API key stored in .env or entered at prompt
gitputra chat ./my-project --local --ai gemini
๐ฌ 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
analyzewas already run on the repo,chatreuses 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 API key is stored in .env
gitputra chat https://github.com/user/repo --branch feature/my-branch --ai gemini
If
--branchis 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, Claudeโฆ) to continue work without re-explaining the project.
The export includes:
- File tree of the project
- Tech stack detection (languages, infra, package files)
- Function inventory โ all functions extracted per module
- Module dependency graph โ Mermaid + plain-text fallback
- Function-level call graph โ cross-module calls, Mermaid + full call map
- Per-file summaries โ AI-generated (with
--use-ai) or function-list stats (offline) - Source snapshot โ truncated source for each file
# Local codebase โ fast, no API key needed (no AI summaries)
gitputra export-context ./my-project
gitputra export-context "location"
# With AI summaries (requires --use-ai and an API key)
gitputra export-context ./my-project --use-ai --ai gemini --key YOUR_API_KEY
# If API key is stored in .env
gitputra export-context "location" --use-ai --ai gemini
# Remote GitHub repo
gitputra export-context https://github.com/user/repo --remote --ai gemini --key YOUR_API_KEY
# Remote repo โ API key stored in .env or entered at prompt
gitputra export-context https://github.com/user/repo --remote --ai gemini
# 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
# If API key is stored in .env
gitputra export-context https://github.com/user/repo --remote --branch dev --use-ai --ai gemini
# 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:
- Open the
.mdfile - Paste it into any AI chat (ChatGPT, Gemini, Claudeโฆ)
- Say: "Here is my codebase context. Read it and help me continue."
Other Commands
# Wipe the local ChromaDB index
gitputra clear-db
# 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 โ Secure Interactive Prompt
If no key is provided, GitPutra will securely prompt you at runtime โ keeping your key out of shell history and config files.
Option 3 โ CLI flag:
gitputra analyze https://github.com/user/repo --key YOUR_API_KEY
Avoid Option 3 in shared environments โ CLI flags appear in shell history.
๐งฌ Call Graph Extraction (Tree-sitter AST)
The functionality graph and context export use a shared call_extractor module powered by Tree-sitter for precise AST-based extraction โ no regex guessing for supported languages.
| Method | Languages |
|---|---|
| Tree-sitter (AST) | Python, JavaScript, TypeScript, JSX, TSX, C, C++ (.cc, .cxx), Go, Rust, Java |
| Regex fallback | Ruby, PHP, Swift, Kotlin, Scala, Lua, C#, Groovy, Perl, Shell/Bash |
For Python specifically, the stdlib ast module is used for maximum accuracy, with Tree-sitter as a fallback on syntax errors.
๐ 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, Tok Pisin, Tswana, Shona, Sesotho, and more.
Bangla Script
Bangla, Assamese
Devanagari Script
Hindi, Marathi, Nepali, Sanskrit, Maithili, Konkani, Bodo, Dogri
The AI response language depends on the chosen model's capability. Use
--langto set the output language.
gitputra analyze https://github.com/user/repo --ai gemini --key KEY --lang Bangla
# API key stored in .env or entered at prompt
gitputra analyze https://github.com/user/repo --ai gemini --lang Bangla
๐ Supported File Extensions (50+ 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, .toml, .ini, .cfg, .conf, .gradle, .makefile |
| Docs | .md, .txt, .log, .sql, .pdf |
| Special | Dockerfile, Makefile |
๐จโ๐ป Author
Adityava Gangopadhyay
- ๐ง Email: adityava49cse@gmail.com
- ๐ LinkedIn: adityava-gangopadhyay
- ๐ฆ PyPI: pypi.org/project/gitputra
Feel free to reach out for any suggestions or issues!
AI is ARTIFICIALLY Intelligent, YOU are NATURALLY WISE โ use the tool but keep track on the correctness of the results produced.
THANK YOU
๐ License
MIT License โ free to use, modify, and distribute.
Project details
Release history Release notifications | RSS feed
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 gitputra-0.2.9.tar.gz.
File metadata
- Download URL: gitputra-0.2.9.tar.gz
- Upload date:
- Size: 510.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ae080ad97f2c287c1f068d7d7cf337da1cf6fbea6122d3e4aeb394df52dafe8
|
|
| MD5 |
23aaa763163809c350f6fbb49646a719
|
|
| BLAKE2b-256 |
a71b5e5b24acde9b53600427f910e6b25f4d424385bd70c37a19f35cf6a920eb
|
File details
Details for the file gitputra-0.2.9-py3-none-any.whl.
File metadata
- Download URL: gitputra-0.2.9-py3-none-any.whl
- Upload date:
- Size: 505.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a05a94c04adb6a99a0054642bc6a60cbd91d01fb695bdb81ed618822cf07504
|
|
| MD5 |
d2efab7336727efb7ce15cb7ed635c2d
|
|
| BLAKE2b-256 |
85d8550901c098af88dcb4de308c53b5d323e9183a222abf737df8916c2b0164
|