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.4.0.tar.gz (35.0 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.4.0-py3-none-any.whl (40.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: oscar_agent-0.4.0.tar.gz
  • Upload date:
  • Size: 35.0 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.4.0.tar.gz
Algorithm Hash digest
SHA256 a1d07833404676406a268a4b25dba24244255a7489eb94f6af25d4a407c06cd2
MD5 0df0ab73082d6dd58883432235f6499f
BLAKE2b-256 e27a1b94b4ff76d2094d3dc617f4440c3d313de0951941eaaf0eba41369ee432

See more details on using hashes here.

File details

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

File metadata

  • Download URL: oscar_agent-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 40.5 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5ed8d70f60c3e9c03c983f17d5d3dd0abd035c8f62f37c9b6bf68495908df6
MD5 f28c3ac8078f6a8ba563a5f3b03459be
BLAKE2b-256 9d91faf164ca51a46cc3c68365c926b74acde371a566641f0db4764c14b379dc

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