# thalluritharun/gini architecture

> Architecture diagram of the GitHub repository thalluritharun/gini, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thalluritharun/gini
- Repository: https://github.com/thalluritharun/gini

## Overview

Gini is a VS Code AI development assistant. A developer submits a chat message in the webview; the extension-side sidebar handles the message exchange, and Gemini generates a response for display. The README also documents code explanation, optimization, transpilation, and annotation, while editor helpers support reading, copying, and replacing code. The sidebar and extension entry point were not excerpted, so their runtime connections are shown only as unverified; the documented feature set and Gemini methods are preserved.

Main entry points: [`src/services/gemini.ts`](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts) (Gemini client), [`src/sidebar/SidebarProvider.ts`](https://github.com/thalluritharun/gini/blob/main/src/sidebar/SidebarProvider.ts) (Sidebar provider), [`webview/main.js`](https://github.com/thalluritharun/gini/blob/main/webview/main.js) (Chat webview), [`src/extension.ts`](https://github.com/thalluritharun/gini/blob/main/src/extension.ts) (Extension activation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_webview["Chat webview<br/>[main.js]"]
end

subgraph group_extension["VS Code extension"]
  node_extension_entry["Extension activation<br/>[extension.ts]"]
  node_sidebar["Sidebar provider<br/>[SidebarProvider.ts]"]
  node_commands["Command identifiers<br/>[commands.ts]"]
  node_config["Gemini key config<br/>[getConfig.ts]"]
end

subgraph group_ai["Gemini assistance"]
  node_gemini["Gemini client<br/>[gemini.ts]"]
  node_prompts["AI prompts and languages<br/>[constants.ts]"]
  node_chat["Multi-chat assistant<br/>[gemini.ts]"]
  node_explain["Code explanation<br/>[gemini.ts]"]
  node_optimize["Code optimization<br/>[gemini.ts]"]
  node_transpile["Code transpilation<br/>[gemini.ts]"]
  node_annotate["Code annotation<br/>[gemini.ts]"]
end

subgraph group_editor["Editor utilities"]
  node_editor_text["Read editor text<br/>[helpers.ts]"]
  node_clipboard["Clipboard operations<br/>[helpers.ts]"]
end

node_developer(("Developer"))
node_gemini_api["Gemini API"]
node_vscode["VS Code editor"]

node_developer -->|"submits chat"| node_webview
node_webview -.->|"posts message"| node_sidebar
node_sidebar -.->|"routes request"| node_gemini
node_gemini -.->|"returns response"| node_sidebar
node_sidebar -.->|"posts result"| node_webview
node_gemini -->|"sends prompts"| node_gemini_api
node_gemini -->|"uses prompt constants"| node_prompts
node_gemini -->|"handles conversation"| node_chat
node_gemini -->|"generates explanation"| node_explain
node_gemini -->|"optimizes code"| node_optimize
node_gemini -->|"transpiles code"| node_transpile
node_gemini -->|"annotates code"| node_annotate
node_extension_entry -.->|"registers provider"| node_sidebar
node_extension_entry -.->|"uses identifiers"| node_commands
node_config -.->|"provides API key"| node_gemini
node_editor_text -->|"reads document"| node_vscode
node_clipboard -->|"reads and edits"| node_vscode

click node_webview "https://github.com/thalluritharun/gini/blob/main/webview/main.js"
click node_extension_entry "https://github.com/thalluritharun/gini/blob/main/src/extension.ts"
click node_sidebar "https://github.com/thalluritharun/gini/blob/main/src/sidebar/SidebarProvider.ts"
click node_commands "https://github.com/thalluritharun/gini/blob/main/src/utils/commands.ts"
click node_config "https://github.com/thalluritharun/gini/blob/main/src/utils/getConfig.ts"
click node_gemini "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_prompts "https://github.com/thalluritharun/gini/blob/main/src/utils/constants.ts"
click node_chat "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_explain "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_optimize "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_transpile "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_annotate "https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts"
click node_editor_text "https://github.com/thalluritharun/gini/blob/main/src/utils/helpers.ts"
click node_clipboard "https://github.com/thalluritharun/gini/blob/main/src/utils/helpers.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webview toneBlue
class node_extension_entry,node_sidebar,node_commands,node_config toneAmber
class node_gemini,node_prompts,node_chat,node_explain,node_optimize,node_transpile,node_annotate,node_gemini_api toneMint
class node_editor_text,node_clipboard toneRose
class node_developer,node_vscode toneIndigo
```

## Components

### Chat interface

- [Chat webview](https://github.com/thalluritharun/gini/blob/main/webview/main.js): `webview/main.js`

### VS Code extension

- [Extension activation](https://github.com/thalluritharun/gini/blob/main/src/extension.ts): `src/extension.ts`
- [Sidebar provider](https://github.com/thalluritharun/gini/blob/main/src/sidebar/SidebarProvider.ts): `src/sidebar/SidebarProvider.ts`
- [Command identifiers](https://github.com/thalluritharun/gini/blob/main/src/utils/commands.ts): `src/utils/commands.ts`
- [Gemini key config](https://github.com/thalluritharun/gini/blob/main/src/utils/getConfig.ts): `src/utils/getConfig.ts`

### Gemini assistance

- [Gemini client](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [AI prompts and languages](https://github.com/thalluritharun/gini/blob/main/src/utils/constants.ts): `src/utils/constants.ts`
- [Multi-chat assistant](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Code explanation](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Code optimization](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Code transpilation](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`
- [Code annotation](https://github.com/thalluritharun/gini/blob/main/src/services/gemini.ts): `src/services/gemini.ts`

### Editor utilities

- [Read editor text](https://github.com/thalluritharun/gini/blob/main/src/utils/helpers.ts): `src/utils/helpers.ts`
- [Clipboard operations](https://github.com/thalluritharun/gini/blob/main/src/utils/helpers.ts): `src/utils/helpers.ts`

### Other components

- **Developer**
- **Gemini API**
- **VS Code editor**

## Connections

- Developer → Chat webview: submits chat (evidence: `webview/main.js`)
- Chat webview → Sidebar provider: posts message
- Sidebar provider → Gemini client: routes request
- Gemini client → Sidebar provider: returns response
- Sidebar provider → Chat webview: posts result
- Gemini client → Gemini API: sends prompts (evidence: `src/services/gemini.ts`)
- Gemini client → AI prompts and languages: uses prompt constants (evidence: `src/services/gemini.ts`)
- Gemini client → Multi-chat assistant: handles conversation (evidence: `src/services/gemini.ts`)
- Gemini client → Code explanation: generates explanation (evidence: `src/services/gemini.ts`)
- Gemini client → Code optimization: optimizes code (evidence: `src/services/gemini.ts`)
- Gemini client → Code transpilation: transpiles code (evidence: `src/services/gemini.ts`)
- Gemini client → Code annotation: annotates code (evidence: `src/services/gemini.ts`)
- Extension activation → Sidebar provider: registers provider
- Extension activation → Command identifiers: uses identifiers
- Gemini key config → Gemini client: provides API key
- Read editor text → VS Code editor: reads document (evidence: `src/utils/helpers.ts`)
- Clipboard operations → VS Code editor: reads and edits (evidence: `src/utils/helpers.ts`)
