Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning
npm install polydev-perspectives-mcpAdvanced Model Context Protocol platform with comprehensive multi-LLM integration, subscription-based CLI access, OAuth bridges, and advanced tooling for AI development.
1. Clone the repository
``bash`
git clone
cd polydev-website
2. Install dependencies
`bash`
npm install
3. Set up environment variables (see Environment Variables section)
4. Start development server
`bash`
npm run dev
5. Open the application
Navigate to http://localhost:3000 to view the application.
1. API Key Setup: Go to Settings ā API Keys tab to configure traditional API access
2. CLI Setup: Go to Settings ā CLI Subscriptions tab to set up subscription-based access
3. Provider Selection: Choose your preferred LLM provider from the dropdown
4. Test Integration: Use the chat interface to test your configuration
Create a .env.local file with the following variables:
`envSupabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key
CLI Provider Setup
$3
1. Install Codex CLI:
- Download from OpenAI's official repository
- Ensure you have an active ChatGPT Plus subscription
2. Authentication:
`bash
codex auth
`3. Verify Installation:
`bash
codex --version
`$3
1. Install Claude Code CLI:
- Follow instructions at Claude Code Documentation
- Requires active Claude Pro subscription
2. Authentication:
`bash
claude login
`3. Verify Installation:
`bash
claude --version
`$3
1. Install Google Cloud CLI:
`bash
# macOS
brew install google-cloud-sdk
# Windows
# Download from https://cloud.google.com/sdk/docs/install
# Linux
curl https://sdk.cloud.google.com | bash
`2. Authentication:
`bash
gcloud auth login
gcloud auth application-default login
`$3
1. Install VS Code with GitHub Copilot extension
2. Authentication: Sign in with your GitHub account that has Copilot access
3. Verification: The application will detect VS Code and Copilot availability automatically
API Provider Configuration
$3
1. Navigate to Settings ā API Keys tab
2. Select your preferred provider from the dropdown
3. Enter your API key (encrypted automatically)
4. Choose your preferred model
5. Test the configuration
$3
| Provider | Models | Context Window | Features |
|----------|--------|---------------|----------|
| Anthropic | Claude 3.5 Sonnet, Haiku, Opus | 200K tokens | Best for reasoning and code |
| OpenAI | GPT-4o, GPT-4 Turbo, GPT-3.5 | 128K tokens | Versatile, widely adopted |
| Google Gemini | Gemini 1.5 Pro, Flash | 1M+ tokens | Large context window |
| OpenRouter | 100+ models | Varies | Access to multiple providers |
| Groq | Open-source models | Varies | Ultra-fast inference |
| Perplexity | Search-optimized models | Varies | AI search and reasoning |
| DeepSeek | Reasoning models | Varies | Advanced reasoning capabilities |
| Mistral AI | European AI models | Varies | Strong performance, EU-based |
Usage Examples
$3
1. Configure your preferred provider (API key or CLI)
2. Select a model from the dropdown
3. Start chatting in the main interface
4. Switch providers anytime without losing conversation history
$3
`typescript
// The application automatically detects CLI availability
// Users can configure custom paths if needed// Example: Using Codex CLI for high reasoning
const response = await llmService.createCliMessage(
'codex',
'You are a helpful AI assistant',
[{ role: 'user', content: 'Explain quantum computing' }],
{ temperature: 0.7 }
)
`$3
`typescript
// Standard API key usage
const response = await llmService.createMessage(
'You are a helpful AI assistant',
[{ role: 'user', content: 'Write a Python function' }],
{ provider: 'anthropic', model: 'claude-3-5-sonnet-20241022' }
)
`Architecture Overview
$3
`
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā Frontend UI āāāāāā Process Utils āāāāāā CLI Tools ā
ā (React/TS) ā ā (Node.js) ā ā (External) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā ā ā
ā ā ā
ā¼ ā¼ ā¼
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
ā LLM Service ā ā CLI Handlers ā ā Subscriptions ā
ā (Unified API) ā ā (Per Provider) ā ā (ChatGPT+, etc) ā
āāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāā
`$3
- API Keys: Encrypted using browser SubtleCrypto API
- Local Storage: Keys never leave your device
- CLI Authentication: Uses existing subscription authentication
- Process Isolation: CLI processes run in isolated environments
Troubleshooting
$3
Codex CLI not detected:
1. Verify ChatGPT Plus subscription is active
2. Check installation path:
which codex
3. Re-run authentication: codex auth
4. Configure custom path in Settings ā CLI SubscriptionsClaude Code CLI authentication failed:
1. Ensure Claude Pro subscription
2. Run
claude login manually
3. Check network connectivity
4. Verify CLI version compatibilityGemini CLI setup issues:
1. Install Google Cloud SDK completely
2. Run both
gcloud auth commands
3. Enable required APIs in Google Cloud Console
4. Check quota limitsGitHub Copilot not available:
1. Install VS Code with Copilot extension
2. Sign in to GitHub account with Copilot access
3. Restart the application
4. Check VS Code Language Model API availability
$3
API key validation failed:
1. Verify the key is correctly copied (no extra spaces)
2. Check if the key has required permissions
3. Ensure sufficient account credits/quota
4. Try regenerating the API key
Connection timeout:
1. Check internet connectivity
2. Verify firewall settings
3. Try different model/provider
4. Increase timeout in settings
Model not available:
1. Check provider documentation for model availability
2. Verify your account tier supports the model
3. Try alternative models from the same provider
Development
$3
1. Create handler in
src/lib/llm/handlers/
2. Update types in src/types/api-configuration.ts
3. Add configuration to CLI_PROVIDERS constant
4. Update UI in CliProviderConfiguration.tsx
5. Register handler in LLMService$3
1. Create handler implementing
ApiHandler interface
2. Update ApiProvider type and PROVIDERS configuration
3. Add API key fields to ApiConfiguration
4. Update UI components for new provider
5. Add authentication logicPerformance Optimization
$3
- CLI processes are cached and reused when possible
- Streaming responses reduce perceived latency
- Process timeouts prevent hanging connections
- Cross-platform path detection minimizes setup time$3
- Server-Sent Events for real-time streaming
- Connection pooling for API requests
- Response caching for repeated queries
- Automatic retry logic with exponential backoffHealth Check
The application includes a health check endpoint at
/api/health` for monitoring purposes.