Skip to main content

OSCAR - GitHub-Specialized AI Coding Assistant

Project description

OSCAR — GitHub-Specialized AI Coding Assistant

A VS Code extension and CLI powered by the Asterix agentic framework and Gemini 2.5 Flash via Vertex AI. Specialized for GitHub workflows: branch comparison, PR review, diff analysis, and git automation.

Architecture

┌─────────────────────────────────────────────────────┐
│ VS Code Extension (TypeScript)                       │
│  ├── Sidebar WebviewViewProvider (chat UI)            │
│  ├── Branch comparison widget                        │
│  └── HTTP/SSE client → FastAPI backend               │
├─────────────────────────────────────────────────────┤
│ FastAPI Server (Python)                              │
│  ├── /chat, /branches, /compare, /review, /history   │
│  └── SSE streaming for real-time progress            │
├─────────────────────────────────────────────────────┤
│ OSCAR Agent Layer (Python)                           │
│  ├── Asterix Agent (ReAct loop, memory, state)       │
│  ├── asterix_patch.py (Vertex AI Gemini integration) │
│  ├── Safety callbacks (on_before_tool_call)           │
│  └── Audit logging (on_after_tool_call)              │
├─────────────────────────────────────────────────────┤
│ Tools (registered via @agent.tool())                 │
│  ├── git_* (status, compare, review, log, diff, ...) │
│  ├── shell (subprocess with safety checks)           │
│  ├── web_search (Tavily with dual-key fallback)      │
│  └── browser (Playwright: navigate, extract, search) │
├─────────────────────────────────────────────────────┤
│ LLM: Gemini 2.5 Flash via Vertex AI (ADC auth)      │
│  Project: oscar-490517 | Region: us-central1         │
└─────────────────────────────────────────────────────┘

Features

  • Git-specialized tools — status, branch compare, PR review, log, diff, checkout, commit, push
  • Browser automation — navigate, search, extract content, download files (Playwright)
  • Web search — Tavily-based with dual API key fallback
  • Shell execution — cross-platform command runner with safe-command allowlist
  • Human-in-the-loop safety — auto-approve low risk, confirm medium/high, typed CONFIRM for dangerous ops
  • Persistent memory — session context, knowledge base, user preferences via Asterix memory blocks
  • Streaming progress — Server-Sent Events through FastAPI for real-time updates
  • VS Code sidebar — chat UI with branch comparison widget (in development)

Installation

Prerequisites

Python Backend

git clone https://github.com/adityasarade/OSCAR.git
cd OSCAR
pip install -e .
playwright install chromium

Vertex AI Authentication

gcloud auth application-default login

Environment Variables

cp .env.example .env

Edit .env and set:

Variable Required Description
TAVILY_API_KEY1 Optional Tavily web search API key
TAVILY_API_KEY2 Optional Fallback Tavily key for rate-limit rotation

Vertex AI auth uses Application Default Credentials — no API key needed if gcloud auth is configured.

VS Code Extension (in development)

cd vscode-oscar
npm install
npm run compile
# Press F5 in VS Code to launch Extension Development Host

Usage

CLI

oscar                  # Start interactive session
oscar --debug          # Debug mode
oscar --dry-run        # Dry run (no destructive ops)
oscar --config-check   # Verify configuration

Example session:

OSCAR> git status
OSCAR> compare main and feature-branch
OSCAR> review feature-branch against main
OSCAR> search for Python async best practices
OSCAR> navigate to https://docs.python.org

VS Code (in development)

Open the OSCAR sidebar from the activity bar to chat with the agent. The extension communicates with the FastAPI backend over HTTP/SSE.

Project Structure

src/oscar/
├── cli/main.py              # CLI entry point
├── config/settings.py       # Configuration and safety patterns
├── core/
│   ├── agent.py             # Asterix agent orchestrator
│   ├── asterix_patch.py     # Vertex AI + Gemini runtime bridge
│   └── safety.py            # Human-in-the-loop safety callbacks
└── tools/
    ├── git_tool.py          # Git operations (9 functions)
    ├── shell.py             # Shell command execution
    ├── web_search.py        # Tavily web search
    └── browser.py           # Playwright browser automation

Built With

  • Asterix — Agentic framework (ReAct loop, memory, tool management)
  • Gemini 2.5 Flash — LLM via Google Vertex AI
  • FastAPI — HTTP backend with SSE streaming
  • Playwright — Headless browser automation
  • Tavily — Web search API
  • Rich — Terminal UI and formatting
  • Click — CLI framework
  • TypeScript — VS Code extension

License

MIT

Author

Built by Aditya Sarade — Final year AI & Data Science, AISSMS IOIT, Pune.

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

oscar_agent-0.5.1.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

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

oscar_agent-0.5.1-py3-none-any.whl (41.3 kB view details)

Uploaded Python 3

File details

Details for the file oscar_agent-0.5.1.tar.gz.

File metadata

  • Download URL: oscar_agent-0.5.1.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for oscar_agent-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4fb01cff571903c38cb63614d44bda94ac09c5c98891a0aee0a8dc0df28a51d1
MD5 da0ccb23e15ae5ba1543749343097c55
BLAKE2b-256 26f1e383d4f39400353d7ee60421edd9be5464913427302675b328e45ecbbd60

See more details on using hashes here.

File details

Details for the file oscar_agent-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: oscar_agent-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 41.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for oscar_agent-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 27edf456f54874063bde7eb50a7f7b7e7e40a043894f9a20eb9c37a637c45961
MD5 05a3f502ec66cf607e98f2d43041aba4
BLAKE2b-256 fad27a9133c21df17be757f761da91109749aa84f4532b6c5fdff9129f5ee332

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