Overview Version History Q & A Rating & Review
PromptForgeAI VS Code Extension
A lightweight, robust VS Code extension that connects your development environment to the PromptForgeAI Brain & Demon engines for intelligent prompt enhancement and code suggestions.
🚀 Features
Device Flow Authentication - Secure OAuth2 device flow login
Circuit Breaker Pattern - Resilient API client with automatic failure handling
Quick Prompt Upgrade - Fast enhancement using Brain Engine
Deep Prompt Upgrade - Advanced multi-variant upgrades via Demon Engine
Contextual Suggestions - Smart code and text suggestions
Real-time Status - Live connection status in status bar
Feature Flags - Dynamic feature toggling
📦 Installation
From Source
Clone this repository
npm install
npm run compile
Press F5 in VS Code to run in Extension Development Host
Configuration
Configure the extension in your VS Code settings:
{
"promptforge.apiBase": "http://localhost:8080",
"promptforge.clientId": "pfa_vscode_ext",
"promptforge.enableAutoSuggestions": true
}
Or set environment variables:
PFA_API_BASE_URL
- Base URL for PromptForgeAI API
PFA_CLIENT_ID
- Client ID for device authentication
🎯 Commands
Command
Description
PromptForgeAI: Login
Authenticate via device flow
PromptForgeAI: Logout
Sign out and clear tokens
PromptForgeAI: Show User Info
Display current user info
PromptForgeAI: Quick Prompt Upgrade
Fast prompt enhancement
PromptForgeAI: Deep Prompt Upgrade (Demon Engine)
Advanced multi-variant upgrades
PromptForgeAI: Get Contextual Suggestions
Smart context-aware suggestions
🔧 Usage
Authentication
Run PromptForgeAI: Login
Visit the provided URL and enter the device code
Extension will automatically authenticate once approved
Quick Upgrade
Select text in any file (or leave empty to upgrade entire file)
Run PromptForgeAI: Quick Prompt Upgrade
Enhanced text replaces selection
Deep Upgrade
Select text for enhancement
Run PromptForgeAI: Deep Prompt Upgrade (Demon Engine)
Choose from multiple upgrade variants
Selected variant replaces your text
Contextual Suggestions
Open any file with content
Run PromptForgeAI: Get Contextual Suggestions
Choose from intelligent suggestions
Suggestion is inserted at cursor or replaces selection
🏗️ Architecture
Core Components
ApiClient - HTTP client with circuit breaker and keep-alive
AuthManager - OAuth2 device flow and token management
StatusBar - Real-time connection status indicator
FeatureFlags - Dynamic feature configuration
Commands - Individual command implementations
Security Features
Secure token storage using VS Code Secrets API
Automatic token refresh handling
Circuit breaker prevents API spam during outages
Input sanitization and validation
🔒 Security
All tokens stored securely via VS Code's built-in secrets management
No credentials stored in plain text
Automatic token refresh with fallback to re-authentication
Request timeout and circuit breaker prevent hanging connections
🛠️ Development
Build
npm run compile
Watch Mode
npm run watch
Test
npm test
Package
npm run vscode:prepublish
📋 Requirements
VS Code 1.70.0 or higher
Node.js 16+ for development
PromptForgeAI backend service
🤝 Contributing
Fork the repository
Create your feature branch
Make your changes
Add tests for new functionality
Submit a pull request
📄 License
MIT License - see LICENSE file for details
🔗 Links
Made with 💙 by the PromptForgeAI team