Share and discover Cursor rules β like Gist, but for Cursor IDE rules
cursor.link is a platform for creating, sharing, and discovering Cursor IDE rules. Create custom rules with different application types, share them with the community, and install them directly via CLI using a shadcn-style registry system.
- ποΈ Rich Rule Editor - Create cursor rules with live preview and token counting
- π Rule Types - Support for Always Apply, Intelligent, File-specific, and Manual rules
- π Easy Sharing - Share rules with unique URLs and public/private visibility
- π¦ CLI Integration - Install rules directly via
npx shadcn addcommand - π€ User Dashboard - Manage all your rules in one place
- π Public Discovery - Browse and discover community-shared rules in Hot/New feeds
- π± CLI Tool - Full-featured CLI for syncing rules between local and cloud
- π Lists & Collections - Organize rules into custom lists
- π¨ Modern UI - Beautiful dark theme with Tailwind CSS and Radix components
- Next.js 15.2.4 - App Router with React 19
- TypeScript 5 - Full type safety
- Tailwind CSS 4.1.9 - Modern styling system
- Radix UI - Accessible component primitives
- React Hook Form + Zod - Form handling and validation
- Geist Font - Modern typography
- PostgreSQL - Primary database (via Neon.tech)
- Drizzle ORM 0.44.5 - Type-safe database queries
- Better Auth 1.3.8-beta.9 - Modern authentication with magic links
- Inbound Email 4.0.0 - Transactional email service
- Vercel - Deployment and hosting
- React Scan 0.4.3 - Performance monitoring
- Sonner 2.0.7 - Toast notifications
- Vercel Analytics - Usage analytics
- GPT Tokenizer - Token counting for rules
- Node.js 18+
- PostgreSQL database (we recommend Neon)
- Inbound Email account (get your API key from inbound.new)
Create a .env.local file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@host/database"
# Email Service (get from inbound.new)
INBOUND_API_KEY="your_inbound_api_key"
# Auth (automatically generated)
BETTER_AUTH_SECRET="your_auth_secret"
BETTER_AUTH_URL="http://localhost:3000"-
Clone the repository
git clone https://github.com/your-username/cursor.link.git cd cursor.link -
Install dependencies
# Using bun (recommended) bun install # Or using npm npm install
-
Set up the database
# Generate migrations bun run db:generate # Apply migrations bun run db:migrate
-
Start the development server
bun run dev
-
Open your browser Navigate to http://localhost:3000
cursor.link/
βββ app/ # Next.js app directory
β βββ [userId]/[ruleId]/ # Public rule viewer pages
β βββ api/ # API routes
β β βββ auth/ # Authentication endpoints
β β βββ cursor-rules/ # CRUD operations for rules
β β βββ feed/ # Hot/New feed endpoints
β β βββ lists/ # Lists management
β β βββ my-rules/ # User's personal rules
β β βββ public-rule/ # Public rule access
β β βββ registry/ # shadcn-style CLI registry
β βββ dashboard/ # User dashboard
β βββ feed/ # Public feed/discovery page
β βββ login/ # Authentication pages
β βββ page.tsx # Homepage/editor
βββ components/ # Reusable UI components
β βββ auth/ # Authentication components
β βββ dashboard/ # Dashboard components
β βββ lists/ # Lists management components
β βββ ui/ # Base UI components
β βββ header.tsx # Site header
βββ cursor-link-cli/ # CLI tool package
β βββ src/ # CLI source code
β β βββ commands/ # CLI commands (auth, push, pull, get)
β β βββ utils/ # CLI utilities
β βββ package.json # CLI package configuration
βββ lib/ # Shared utilities
β βββ auth.ts # Authentication configuration
β βββ db.ts # Database connection
β βββ schema.ts # Database schema
β βββ utils.ts # Helper utilities
βββ drizzle/ # Database migrations
GET /api/cursor-rules
GET /api/cursor-rules?ruleId=<id>Fetch all accessible rules or a specific rule by ID.
POST /api/cursor-rules
Content-Type: application/json
{
"title": "my-rule",
"content": "Rule content...",
"ruleType": "always|intelligent|specific|manual",
"isPublic": false
}PUT /api/cursor-rules
Content-Type: application/json
{
"id": "rule-id",
"title": "updated-title",
"content": "Updated content...",
"ruleType": "always",
"isPublic": true
}npx shadcn add https://cursor.link/api/registry/[ruleId]GET /api/registry/[ruleId]Returns a shadcn-compatible registry item for CLI installation.
GET /api/public-rule/[userId]/[ruleId]Access a public rule and increment view count.
GET /api/my-rulesGet all rules belonging to the authenticated user.
GET /api/feed/hot
GET /api/feed/hot?q=search_queryGet popular rules sorted by views and engagement.
GET /api/feed/new
GET /api/feed/new?q=search_queryGet recently created rules.
GET /api/listsGet all lists for the authenticated user.
POST /api/lists
Content-Type: application/json
{
"title": "My List Name"
}POST /api/lists/[listId]/rules
Content-Type: application/json
{
"ruleIds": ["rule-id-1", "rule-id-2"]
}- Visit the homepage - Start creating immediately without login
- Choose rule type - Select from Always Apply, Intelligent, File-specific, or Manual
- Write your rule - Use the built-in editor with syntax highlighting and token counting
- Save and share - Login to save privately or share publicly
- Visit the Feed - Browse popular and new rules from the community
- Search rules - Use the search bar to find rules by title, content, or author
- View details - Click on any rule to see full content and metadata
- Copy or download - Use the action buttons to copy content or download as
.mdcfile
- Create lists - Organize your rules into custom collections
- Add to lists - Select multiple rules and add them to lists
- Manage collections - Edit, delete, and organize your lists from the dashboard
- Always Apply - Applied to every chat and cmd-k session
- Apply Intelligently - Applied when AI determines relevance
- Apply to Specific Files - Applied when file matches specified patterns
- Apply Manually - Applied only when @-mentioned
Share your rules with the community by making them public, then others can install them directly:
npx shadcn add https://cursor.link/api/registry/your-rule-idThis installs the rule to ~/.cursor/rules/ automatically.
cursor.link includes a powerful CLI tool for syncing rules between your local development environment and the cloud platform.
Install the CLI globally:
npm install -g cursor-link
# or
pnpm add -g cursor-link
# or run directly with npx
npx cursor-link --help-
Authenticate with cursor.link:
cursor-link auth login
This opens your browser for device authorization.
-
Push your local cursor rules:
cursor-link push
-
Pull rules from cursor.link:
cursor-link pull
cursor-link auth login- Sign in using device authorizationcursor-link auth logout- Sign outcursor-link auth status- Check authentication status
cursor-link push [options]- Push local cursor rules to cursor.link--public- Make rules public (default: private)--force- Overwrite existing rules without confirmation
cursor-link pull [options]- Pull cursor rules from cursor.link--list- List available rules without downloading--all- Include public rules from other users (default: only your rules)
cursor-link get <identifier>- Get a specific rule by slug or ID
- Scans your
.cursor/rules/directory for.mdcfiles - Parses each file to extract title, content, and settings
- Uploads rules to your cursor.link account
- Handles conflicts by asking for your preference
- Fetches available rules from cursor.link
- Shows an interactive selection interface
- Downloads selected rules to
.cursor/rules/ - Preserves frontmatter settings like
alwaysApply
The CLI works with cursor rule files in the .cursor/rules/ directory. Each file should be a .mdc file with this format:
---
alwaysApply: true
---
# My Rule Title
Your rule content here...We welcome contributions! Here's how to get started:
- Fork the repository on GitHub
- Clone your fork
git clone https://github.com/your-username/cursor.link.git
- Create a feature branch
git checkout -b feature/amazing-feature
- Follow the setup instructions above to get the project running locally
- TypeScript - All new code should be typed
- ESLint - Run
npm run lintbefore committing - Prettier - Code formatting is enforced
- Conventional Commits - Use conventional commit messages
- π Bug fixes - Help improve stability
- β¨ New features - Add functionality users want
- π Documentation - Improve guides and API docs
- π¨ UI/UX - Enhance the user experience
- β‘ Performance - Optimize loading and responsiveness
- π§ Tooling - Improve developer experience
- Update documentation for any new features
- Add tests for new functionality
- Ensure CI passes - All checks must be green
- Request review from maintainers
- Address feedback and iterate
- Hot reload - Changes reflect immediately in development
- Database changes - Run migrations after schema updates
- Email testing - Set up Inbound for magic link testing
- API testing - Use the built-in API routes for testing
- Fork the repository
- Import to Vercel from your GitHub account
- Add environment variables in Vercel dashboard
- Deploy - Automatic deployments on every push
# Database (production)
DATABASE_URL="postgresql://prod_user:password@host/database"
# Email Service
INBOUND_API_KEY="your_production_api_key"
# Auth
BETTER_AUTH_SECRET="your_secure_random_string"
BETTER_AUTH_URL="https://your-domain.com"The app is a standard Next.js application and can be deployed to any platform that supports Node.js:
- Vercel (recommended)
- Netlify
- Railway
- Digital Ocean App Platform
- AWS Amplify
This project is open source and available under the MIT License.
- Cursor - For creating an amazing AI-powered IDE
- shadcn/ui - For the incredible component library
- v0.dev - For rapid prototyping assistance
- Vercel - For seamless deployment
- Neon - For serverless PostgreSQL
Built with β€οΈ for the Cursor community. Share your rules today!