How joselorentelopez/git_cli works
Project type and purpose
• This is a developer tool (an open-source CLI/GUI wrapper) around Git, implemented in Python.
• It provides two “front ends”:
• A terminal-based CLI (src/git_CLI.py)
• A Streamlit-based web GUI (src/front/st_front.py)
• Its purpose is to simplify core Git operations (init, branch, commit, push/pull, etc.) for users.
File structure
• Top-level:
• README.md – project overview, installation, usage
• src/ – all source code
• Inside src/:
• git_CLI.py – main CLI interface that parses commands, invokes Git functionality
• front/ – Streamlit front end
– st_front.py (assumed) – UI definitions, handlers that call the same underlying logic
• No service subfolders, config files, or tests are present; architecture is simple and monolithic in code but bifurcated at runtime into two UIs.
Key architectural insights from the README
• Core logic (repo management, branch ops, file status, commit history, remote sync) is centralized in one Python module.
• Both CLI and Streamlit UI invoke the same core logic functions.
• Under the hood it likely uses either direct system calls to Git or a Python Git library.
• Future features (merge-conflict resolution, SSH, stash) will fit into the same core logic layer.
Components
a. User Interfaces
– Terminal CLI (git_CLI.py)
– Streamlit GUI (st_front.py)
b. Core Logic Layer
– Command parser & dispatcher
– Git operation handlers (init, branch, commit, push/pull, etc.)
c. External Systems & Resources
– Local file system (working directory, .git folder)
– Git executable or Git Python library
– Remote Git server (GitHub, GitLab, etc.)
d. Data Flows & Interactions
– User → UI (CLI or GUI)
– UI → Core Logic (via function calls)
– Core Logic ↔ Git executable/library
– Core Logic ↔ File system (read/write .git, workspace files)
– Core Logic ↔ Remote Git server (over HTTP/SSH)
Architectural patterns and design principles
• Separation of Concerns:
• Presentation (CLI, GUI) is decoupled from core business logic.
• Core logic does not depend on a specific UI.
• Single Responsibility: each module handles one layer (UI vs. logic vs. external integration).
• Future extensibility: new UIs or features plug into the same core logic.