File size: 1,668 Bytes
c9f4d53
 
 
 
 
 
 
 
 
 
 
bed5cc5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9f4d53
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
title: Cursor Rules Generator
emoji: 🧩
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: "4.13.0"
app_file: app.py
pinned: false
---

# Cursor Rules Generator - Hugging Face Deployment

This repository contains a Cursor Rules Generator application that supports Gemini, OpenRouter, OpenAI API and all their models.

## About

Cursor Rules Generator is a web application that helps you create Cursor Rules in MDC format. Cursor Rules provide system-level guidance to AI models, offering a persistent way to encode context, preferences, or workflows for your projects.

## Features

- Support for multiple LLM providers (Gemini, OpenRouter, OpenAI)
- MDC format generation
- Different rule types (Always, Auto Attached, Agent Requested, Manual)
- Easy export of generated rules
- Responsive design

## Installation

```bash
pip install -r requirements.txt
```

## Usage

```bash
python app.py
```

## Environment Variables

Create a `.env` file with the following variables:

```
# Optional default API keys
GEMINI_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
OPENROUTER_API_KEY=your_openrouter_api_key

# App settings
DEBUG=False
PORT=7860
```

## API Reference

The application provides the following API endpoints:

- `/api/providers`: Get a list of supported LLM providers
- `/api/rule-types`: Get a list of supported rule types
- `/api/validate-api-key`: Validate an API key for a specific provider
- `/api/models`: Get a list of available models for a specific provider
- `/api/generate-rule`: Generate a Cursor Rule

## License

MIT

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference