# Core Extension for VS Code

A powerful VS Code extension that integrates CrewAI functionality for enhanced development workflows.

## Features

### 🤖 CrewAI Integration
- **Project Analysis**: Analyze your project structure and get AI-powered recommendations
- **Extension Development**: Create VS Code extensions with AI assistance
- **UI Enhancement**: Improve your web applications with AI-guided UI development
- **Full Development Cycle**: Orchestrate multiple AI agents for comprehensive development tasks

### 🛠️ Developer Tools
- **Status Monitoring**: Real-time status of CrewAI operations
- **Configuration Management**: Easy setup and configuration of API keys and settings
- **Tree View**: Quick access to all Core operations from the Explorer panel

## Getting Started

### Prerequisites
- VS Code 1.85.0 or higher
- Python 3.8 or higher
- Core CLI tool installed in your project

### Installation
1. Install the extension from the VS Code marketplace
2. Open a workspace containing the Core project
3. Configure your OpenAI API key: `Ctrl+Shift+P` → "Core: Configure" → "Set OpenAI API Key"

### Quick Start
1. Open the Command Palette (`Ctrl+Shift+P`)
2. Run "Core: CrewAI Status" to check your setup
3. Try "Core: Analyze Project" to get AI insights about your codebase

## Commands

| Command | Description |
|---------|-------------|
| `Core: Analyze Project` | Analyze project structure and provide recommendations |
| `Core: CrewAI Status` | Check CrewAI configuration and agent status |
| `Core: Full Development Cycle` | Execute comprehensive development workflow |
| `Core: Develop Extension` | Create VS Code extensions with AI assistance |
| `Core: Enhance UI` | Improve web application interfaces |
| `Core: Configure` | Setup and configure extension settings |

## Configuration

### Settings
- `core.crewai.apiKey`: Your OpenAI API key for CrewAI operations
- `core.crewai.model`: OpenAI model to use (default: gpt-4)
- `core.crewai.verbose`: Enable verbose output for debugging
- `core.cli.path`: Custom path to core-cli executable
- `core.app.port`: Port for Gradio application (default: 7860)

### Environment Variables
You can also set these environment variables:
- `OPENAI_API_KEY`: Your OpenAI API key
- `CORE_CLI_PATH`: Path to the Core CLI executable

## Usage Examples

### Analyzing a Project
1. Open your project in VS Code
2. Click the Core icon in the status bar or run "Core: Analyze Project"
3. View the analysis results in a new document

### Developing an Extension
1. Run "Core: Develop Extension"
2. Describe the features you want
3. Provide an extension name
4. Review the generated extension structure

### Enhancing UI
1. Run "Core: Enhance UI"
2. Describe your UI requirements
3. Select your preferred framework (Gradio, Streamlit, Flask)
4. Review the enhancement suggestions

## Tree View

The Core Operations tree view in the Explorer panel provides quick access to:
- Project Analysis
- CrewAI Operations
  - Status checking
  - Full development cycle
  - Configuration
- Extension Development
- UI Enhancement

## Status Bar

The Core status indicator shows:
- ✅ Ready: Extension is ready for use
- 🔄 Working: AI agents are processing
- ❌ Error: Configuration or execution error

Click the status bar item to quickly check CrewAI status.

## Troubleshooting

### Common Issues

**"CrewAI not available"**
- Ensure the Core CLI is installed and accessible
- Check that Python and required dependencies are installed
- Verify your OpenAI API key is configured

**"No workspace folder found"**
- Open a folder or workspace in VS Code
- Ensure you're working within a project directory

**"CLI execution failed"**
- Check the CLI path configuration
- Verify the Core CLI tool is properly installed
- Review the verbose output for detailed error information

### Getting Help
- Check the [Core project documentation](https://core.spikingneurons.com)
- Report issues on [GitHub](https://github.com/SpikingNeurons/Core)
- Review VS Code output panel for detailed logs

## Contributing

Contributions are welcome! Please see the [Core project repository](https://github.com/SpikingNeurons/Core) for contribution guidelines.

## License

This extension is part of the Core project and follows the same license terms.

---

**Enjoy using Core Extension! 🚀**
