AI development environment optimized for Gemini API, focused on professional C#/.NET development with low resource consumption.
- Gemini API: Setup optimized for maximum performance with Google API
- OpenHands V1: Latest web UI with official V1 configuration standards
- VS Code + Copilot: Perfect integration for day-to-day development
- GPU Support: Complete NVIDIA GPU support with optimizations
- Docker Sandbox: Official Docker sandbox provider with workspace mounting
This project transforms your environment into a powerful AI development station with Gemini API, with specific focus on C# and .NET. Uses Google's Gemini 3.1 Flash Lite Preview, a fast and efficient model that works on any hardware.
- Maximum productivity with Gemini API (minimum cost)
- Universal setup with optional GPU support
- Focus on C#/.NET Enterprise development
- Simplified configuration with automatic validation
- Multi-architecture: CPU-only or GPU-accelerated
- API Optimized: Gemini 3.1 Flash Lite Preview for maximum performance
- GPU Acceleration: NVIDIA support with optimized runtime
- Universal: Works on any hardware (CPU or GPU)
- VS Code Integration: Copilot for native workflow
- Docker Simplified: OpenHands optimized with config.toml
- MCP Integration: Model Context Protocol for extensibility
.
├── agents/ # GitHub Copilot Agents & Skills
│ ├── AGENTS.md # Master agents guide
│ ├── skills/ # Specialized .NET skills
│ │ ├── dotnet-best-practices/ # SOLID, modern C#, patterns
│ │ ├── csharp-async-patterns/ # async/await, performance
│ │ ├── entity-framework-core/ # EF Core, optimization, migrations
│ │ ├── aspnet-core-api/ # REST APIs, JWT, OpenAPI
│ │ ├── testing-xunit/ # Unit testing, mocking, coverage
│ │ ├── blazor-components/ # Blazor UI, state management
│ │ ├── design-patterns/ # SOLID, GoF, architectural patterns
│ │ ├── security-jwt/ # Authentication, authorization
│ │ └── performance-optimization/ # Profiling, caching, optimization
│ └── rules/ # Context-aware rules
│ ├── csharp-coding-standards.md # Conventions and formatting
│ ├── dotnet-project-structure.md # Architecture and organization
│ ├── api-design-guidelines.md # REST API design and HTTP
│ ├── database-conventions.md # Database design and EF Core
│ └── git-workflow.md # Git workflow and version control
├── openhands/ # OpenHands AI Configuration
│ ├── settings.json # Gemini API Configuration (JSON)
│ ├── config.json # LLM Configuration (JSON)
│ ├── config.toml # OpenHands V1 Configuration (TOML)
│ └── README.md # Complete documentation
├── workspace/ # Shared workspace
│ └── README.md # Structure and organization
├── vscode/ # VS Code Configuration
│ ├── settings.json # Optimized settings
│ ├── extensions.json # Recommended extensions
│ └── README.md # Complete VS Code setup
├── docker-compose.yml # Optimized Docker Configuration (GPU)
├── docker-compose.low-resource.yml # CPU-only Configuration
├── MCP-README.md # Complete MCP Guide
├── MCP-QUICKSTART.md # MCP Quick Setup
├── configure.sh # Advanced configuration script
├── start.sh # Intelligent deployment script
└── README.md # This file
Complete set of skills and rules for GitHub Copilot specialized in .NET.
- Skills: 9 comprehensive skills for modern .NET development
- Rules: 5 context-aware rules for patterns and conventions
- Coverage: SOLID, EF Core, APIs, Blazor, Security, Performance, Testing
- Usage: Configure in VS Code/Windsurf for complete automation
Autonomous AI environment for complex development tasks.
- Configuration:
settings.jsonwith Gemini API - Data: Conversations, workspaces, and tools
- Logs: Monitoring and troubleshooting
- Access: http://localhost:3000
- MCP: Integration with specialized servers
Shared workspace with OpenHands.
- Projects: Structure for C#/.NET development
- Shared: Accessible by OpenHands
- Persistence: Data survives restarts
- Organization: Reusable templates and scripts
💻 VS Code
Optimized settings for AI development.
- Settings: Global settings and optimizations
- Extensions: Recommended list for C#/.NET + AI
- Copilot: Complete integration with GitHub Copilot
- Complete Setup: See specific guide for installation
- OpenHands uses Gemini API for development tasks
- Workspace shares files between services (8GB max)
- VS Code integrates with Copilot for local development
- MCP Servers extend capabilities with specialized tools
# OpenHands (reduced memory)
volumes:
- ./workspace:/workspace # Workspace (8GB max)
- ./openhands:/.openhands # Configuration and data
# Low-Resource (ultra light)
volumes:
- ./workspace:/workspace # Workspace (2GB max)
- ./openhands:/.openhands # Configuration and data- memory: Persistent memory and context
- filesystem: Optimized file access
- git: Automated Git operations
- sqlite: Lightweight database
- fetch: HTTP requests
- External API: Heavy processing
| Directory | Main Use | Estimated Size | Backup |
|---|---|---|---|
openhands/ |
AI Configuration | ~50MB | Important |
workspace/ |
Projects | Variable (max 8GB) | Essential |
vscode/ |
Editor Configuration | ~10MB | Optional |
- Optimized Memory: 1.5GB limit, 768MB reservation
- Optimized API: Gemini 3.1 Flash Lite Preview integration
- Optimized Python:
PYTHONUNBUFFERED=1,PYTHONDONTWRITEBYTECODE=1 - Reduced Logs:
LOG_ALL_EVENTS: falsefor less I/O - Optimized Timeouts: Sandbox 180s, workspace 300s
- Compatibility: Windows, Linux, macOS
- Minimum Memory: 512MB limit, 256MB reservation
- Reduced CPU: 0.5 core limit, 0.2 core reservation
- Reduced Context: 1024 tokens for economy
- Fast Timeouts: Sandbox 120s, workspace 180s
- Limited Workspace: 2GB max
- Bridge driver: Better local network performance
- Host Gateway: Optimized access to Gemini API
For detailed information about each component:
- GitHub Copilot Agents: Skills and rules for .NET automation
- MCP Setup Guide: Complete MCP server configuration
- MCP QuickStart: Quick setup to get started
- OpenHands: Advanced AI agent configuration
- OpenHands Repository: Official GitHub repository
- OpenHands Documentation: Official documentation
- VS Code: Complete development environment setup
- Workspace: Project organization and collaboration
# Execute complete script with automatic validation
./start.sh
# Script checks:
# - Docker and docker-compose
# - Gemini API Key (configures automatically)
# - System resources (memory, CPU, GPU)
# - Chooses appropriate configuration (standard vs low-resource)# Complete configuration with GPU
docker-compose up -d
# Low-resource configuration (for limited hardware)
docker-compose -f docker-compose.low-resource.yml up -d
# Access OpenHands
http://localhost:3000docker run -it --rm --pull=always \
-e AGENT_SERVER_IMAGE_REPOSITORY=ghcr.io/openhands/agent-server \
-e AGENT_SERVER_IMAGE_TAG=1.15.0-python \
-e LOG_ALL_EVENTS=true \
-e LLM_API_KEY="$GEMINI_API_KEY" \
-e LLM_MODEL="gemini/gemini-3.1-flash-lite-preview" \
-e RUNTIME=docker \
-e OH_PERSISTENCE_DIR=/.openhands \
-e SANDBOX_VOLUMES="$PWD:/workspace:rw" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands:/.openhands \
-v $PWD:/workspace \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
docker.openhands.dev/openhands/openhands:1.6With GPU (NVIDIA):
docker run -it --rm --pull=always \
-e AGENT_SERVER_IMAGE_REPOSITORY=ghcr.io/openhands/agent-server \
-e AGENT_SERVER_IMAGE_TAG=1.15.0-python \
-e LOG_ALL_EVENTS=true \
-e LLM_API_KEY="$GEMINI_API_KEY" \
-e LLM_MODEL="gemini/gemini-3.1-flash-lite-preview" \
-e RUNTIME=docker \
-e OH_PERSISTENCE_DIR=/.openhands \
-e SANDBOX_VOLUMES="$PWD:/workspace:rw" \
-e CUDA_VISIBLE_DEVICES=all \
-e NVIDIA_VISIBLE_DEVICES=all \
-e SANDBOX_DOCKER_RUNTIME=nvidia \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ~/.openhands:/.openhands \
-v $PWD:/workspace \
-p 3000:3000 \
--add-host host.docker.internal:host-gateway \
--name openhands-app \
--runtime nvidia \
docker.openhands.dev/openhands/openhands:1.6# Start complete environment
docker-compose up -d
# Check logs
docker-compose logs openhands
# Configuration example (already applied)
{
"llm_model": "gemini/gemini-3.1-flash-lite-preview",
"llm_api_key": "${GEMINI_API_KEY}",
"llm_base_url": "https://generativelanguage.googleapis.com/v1beta"
}
# TOML configuration (for OpenHands V1)
[llm]
provider = "google"
model = "gemini-3.1-flash-lite-preview"
api_key = "your-api-key-here"
temperature = 0.35
max_iterations = 30Configure GitHub Copilot to use Gemini API:
// In VS Code settings.json
{
"github.copilot.chat.provider": "copilot",
"github.copilot.enable": {
"*": true,
"csharp": true
}
}# Install MCP servers
./install-mcp-servers.bat
# Check configuration
cat mcp-config.json
# Restart OpenHands
docker-compose restart openhands| Configuration | OpenHands (Standard) | OpenHands (Low-Resource) | Savings |
|---|---|---|---|
| Memory | 2GB | 768MB | 62% |
| CPU | 1.5 cores | 0.8 cores | 47% |
| Parallelism | 3 requests | 2 requests | 200% |
| Temperature | 0.35 | 0.30 | Optimized |
| Hardware | Any | Any | Universal |
- 85% savings in total memory consumption
- Universal setup works on any hardware
- Fast startup with automatic configuration
- Reduced I/O with disabled logs
- API validation ensures correct configuration
- Multi-platform Windows, Linux, macOS
✅ 62% savings in resource consumption (no local dependencies)
✅ Universal setup works on any hardware (no GPU required)
✅ 200% increase in throughput with optimized parallelism
✅ Reduced I/O with optimized logs
✅ API validation ensures correct Gemini configuration
✅ Multi-platform Windows, Linux, macOS
✅ Automated scripts for easy deployment
✅ Complete documentation in English and Portuguese
✅ MCP Integration for full extensibility
✅ Optimized temperature for better performance with Gemini
- GitHub Copilot Agents: Skills and rules for .NET automation
- MCP-README.md: Complete MCP server guide
- MCP-QUICKSTART.md: Quick setup to get started
- OpenHands Documentation: Advanced configuration
- VS Code Setup: Development environment setup
- OpenHands: http://localhost:3000
- VS Code + Copilot: Native integration in editor
- MCP Servers: Configured via OpenHands
- Gemini API: https://aistudio.google.com/app/apikey
- GitHub Copilot Agents: Configure in VS Code/Windsurf (see below)
With this setup, your environment becomes a powerful AI development station with Gemini API, specialized in C#/.NET. Gemini 3.1 Flash Lite Preview offers professional performance for code, with simplified configuration and low cost.
Ready to revolutionize your C# development? 🚀
// In VS Code settings.json
{
"github.copilot.enable": {
"*": true,
"csharp": true,
"javascript": true,
"typescript": true
},
"github.copilot.chat.provider": "copilot",
"github.copilot.editor.enableAutoAcceptSuggestions": true,
"github.copilot.editor.enableCodeActions": true
}# In your .NET project
cp -r /path/dev-tools-ia/agents ./agents
# Or clone the agents repository
git clone https://github.com/afonsoft/ai-studio-workspace.git temp-agents
cp -r temp-agents/agents ./agents
rm -rf temp-agents# Add to your project's .vscode/settings.json
{
"github.copilot.enable": {
"*": true,
"csharp": true
},
"github.copilot.chat.provider": "copilot",
"github.copilot.advanced": {
"useCopilotAgents": true,
"agentsPath": "./agents"
}
}// In Windsurf settings.json
{
"github.copilot.enable": {
"*": true,
"csharp": true
},
"github.copilot.chat.provider": "copilot",
"github.copilot.advanced": {
"useCopilotAgents": true,
"agentsPath": "./agents"
}
}# In your .NET project
mkdir -p agents
cp -r /path/dev-tools-ia/agents/* ./agents/
# Commit to repository
git add agents/
git commit -m "feat: add GitHub Copilot agents for .NET development"
git push origin main# In shared workspace
cd /workspace/your-project
cp -r /path/dev-tools-ia/agents ./agents
# OpenHands will use agents automatically# In OpenHands, agents will be available automatically
# Use prompts like:
# "Use the dotnet-best-practices skill to refactor this code"
# "Apply testing-xunit skill to create unit tests"
# "Use security-jwt skill to implement authentication"Use the design-patterns skill to refactor this class following SOLID principles:
Use the entity-framework-core skill to optimize this database query:
Use the aspnet-core-api skill to create RESTful endpoints with proper validation:
Use the testing-xunit skill to create comprehensive unit tests for this service:
Use the security-jwt skill to implement JWT authentication and authorization:
Ctrl+L: Chat with CopilotCtrl+I: Edit selected code@Codebase: Context of entire project
Use the design-patterns skill to refactor this method following SOLID principles and LINQ
Use the entity-framework-core skill to create a Repository pattern for Entity Framework Core with async methods
Use the testing-xunit skill to generate xUnit tests following Arrange-Act-Assert pattern with Moq
Use the aspnet-core-api skill to create RESTful API endpoints with proper validation and error handling
Use the blazor-components skill to create reusable Blazor components with proper state management
Use the security-jwt skill to implement JWT authentication and authorization with best practices
Use the performance-optimization skill to optimize this code for better performance and memory usage
- Main Model: Gemini 3.1 Flash Lite Preview
- Specialization: C#/.NET Development
- Provider: Google Gemini API
- Cost: Pay-per-use (low consumption)
- Extension: GitHub Copilot
- Context Length: 32768 tokens
- Autocomplete: Complete project context
- Temperature: 0.2 (deterministic)
- Agents Integration: Specialized .NET skills and rules
- Version: 1.5 (with integrated agent)
- API: Gemini 3.1 Flash Lite Preview integration
- Temperature: 0.35 (performance) / 0.3 (low-resource)
- Parallelism: 3 (performance) / 2 (low-resource)
- Memory: 2GB (performance) / 768MB (low-resource)
- Max Iterations: 30 (performance) / 20 (low-resource)
- MCP: Integration with 9 specialized servers
- Agents: GitHub Copilot agents available in workspace
# Default in docker-compose.yml
RUNTIME=docker
# Complete host isolation
# Maximum security
# Limited resources# For quick development
RUNTIME=process
# No container isolation
# Maximum performance
# Security risk# For managed deployments
RUNTIME=remote
# Remote environment
# Cloud deployment
# Multi-tenant# 1. Get your API Key
# Visit: https://aistudio.google.com/app/apikey
# 2. Configure in files
# openhands/settings.json
{
"llm_model": "gemini/gemini-3.1-flash-lite-preview",
"llm_api_key": "YOUR_API_KEY_HERE",
"llm_base_url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent"
}
# openhands/config.json
{
"llm": {
"provider": "gemini",
"base_url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-3.1-flash-lite-preview:generateContent",
"model": "gemini-3.1-flash-lite-preview",
"api_key": "YOUR_API_KEY_HERE"
}
}# The start.sh script validates automatically
./start.sh
# If API Key is not configured:
# - Offers interactive configuration
# - Updates both files
# - Ensures correct setupAlternatively to configuring in JSON/TOML files, you can configure the API Key as an environment variable. The docker-compose.yml uses ${GEMINI_API_KEY} to read this variable.
Method 1: System Environment Variable (Permanent)
# Via PowerShell (Administrator)
[System.Environment]::SetEnvironmentVariable('GEMINI_API_KEY', 'your-api-key-here', 'User')
# Or via graphical interface:
# 1. Press Win + R, type "sysdm.cpl"
# 2. Go to "Advanced" > "Environment Variables"
# 3. In "User Variables", click "New"
# 4. Variable name: GEMINI_API_KEY
# 5. Variable value: your-api-key-here
# 6. Click OK on all windows
# 7. Restart terminal to apply changesMethod 2: Temporary Variable (Current session)
# In PowerShell
$env:GEMINI_API_KEY="your-api-key-here"
# In CMD
set GEMINI_API_KEY=your-api-key-hereMethod 1: ~/.bashrc or ~/.zshrc (Permanent)
# Add to end of ~/.bashrc (or ~/.zshrc)
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.bashrc
# Reload file
source ~/.bashrc
# Or for Zsh
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.zshrc
source ~/.zshrcMethod 2: ~/.profile (Universal)
# Add to ~/.profile (works in all shells)
echo 'export GEMINI_API_KEY="your-api-key-here"' >> ~/.profile
source ~/.profileMethod 3: Temporary Variable (Current session)
# In current terminal
export GEMINI_API_KEY="your-api-key-here"Windows
# PowerShell
echo $env:GEMINI_API_KEY
# CMD
echo %GEMINI_API_KEY%Linux/macOS
echo $GEMINI_API_KEYAfter configuring the environment variable, docker-compose.yml will read it automatically:
environment:
LLM_API_KEY: "${GEMINI_API_KEY}" # Reads from environment variableIf the variable is not configured, the start.sh script will try to read from configuration files (settings.json, config.json, config.toml).
- Use specific prompts for better performance
- Configure appropriate timeouts for complex tasks
- Monitor Gemini API consumption
- New: Automatic validation avoids configuration errors
- Use low-resource mode for limited hardware
# Check container status
docker-compose ps
# Check OpenHands logs
docker-compose logs openhands
# Check health check
docker-compose exec openhands curl -f http://localhost:3000/health
# Check MCP logs
docker-compose logs openhands | grep -i mcp
# Restart environment
docker-compose restart
# Stop environment
docker-compose down- Model Loading: ~5 seconds (instant API)
- Token Generation: ~50 tokens/second (optimized API)
- Memory Usage: 2GB (performance) / 768MB (low-resource)
- CPU Usage: Minimal during processing
- Startup Time: Automatic configuration with validation
- Parallel Processing: 2-3 simultaneous requests
- Temperature: 0.35 (performance) / 0.3 (low-resource)
| Feature | Gemini API + OpenHands | Local LLM (Ollama) |
|---|---|---|
| Cost | $$ (low) | Free |
| Latency | ~50ms | ~200ms |
| Setup | Universal | Specific hardware |
| C# Specialization | ✅ Excellent | ❌ Generic |
| Customization | ✅ API settings | ❌ Limited |
| MCP Extensibility | ✅ Yes | ✅ Yes |
| Sandbox Control | ✅ Docker | ✅ Docker |
# Check configuration in files
cat openhands/settings.json | grep llm_api_key
cat openhands/config.json | grep api_key
# Reconfigure if necessary
./start.sh- Check your API Key at https://aistudio.google.com/app/apikey
- Confirm available quota
- Check internet connection
# Use low-resource mode
docker-compose -f docker-compose.low-resource.yml up -d
# Or manually adjust limits
# In docker-compose.yml- Use more specific prompts
- Avoid very large files
- Configure appropriate timeouts
- Use low-resource mode if necessary
// Input: Simple DbContext class
// Prompt: "Create Repository pattern for Entity Framework Core with async methods"
// Output: Complete Repository with:
// - Async CRUD operations
// - Error handling
// - Unit testing support
// - Dependency injection ready// Input: Method with multiple responsibilities
// Prompt: "Refactor using SOLID principles and LINQ"
// Output: Refactored code with:
// - Single Responsibility
// - LINQ optimization
// - Better separation of concerns
// - Improved testabilityContributions are welcome! Areas of interest:
- New specialized C# prompts
- Performance optimizations for Gemini API
- Improved documentation
- Automation scripts
- New MCP servers
This project is licensed under the MIT License - see the LICENSE file for details.
With this setup, your environment becomes a powerful AI development station with Gemini API, specialized in C#/.NET. Gemini 3.1 Flash Lite Preview offers professional performance for code, with simplified configuration and low cost.
With GitHub Copilot Agents, you have:
- 🎯 9 specialized skills for modern .NET development
- 📋 5 context-aware rules for patterns and conventions
- 🤖 Complete automation with SOLID, EF Core, APIs, Blazor, Security, Performance
- 🔄 Full integration with VS Code, Windsurf, and OpenHands
- 📚 Complete documentation with practical examples
Ready to revolutionize your C# development? 🚀