🎉 Exciting news! CursorLens Now supports Caching for AnthropicCheck out the guide

Installation and Quick Start Guide

A comprehensive guide to install, configure, and start using CursorLens

This guide will walk you through the process of setting up CursorLens, configuring it with Cursor, and getting started with AI-assisted coding.

Prerequisites

  • Node.js (v14 or later)
  • pnpm
  • PostgreSQL server
  • ngrok
  • Cursor IDE installed

Installation

  1. Clone the repository:

    git clone https://github.com/HamedMP/CursorLens.git
    cd CursorLens
    
  2. Install dependencies:

    pnpm install
    
  3. Set up environment variables: Create a .env file in the root directory and add the following:

    DATABASE_URL="postgresql://username:password@localhost:5432/cursorlens"
    OPENAI_API_KEY="your_openai_api_key"
    ANTHROPIC_API_KEY="your_anthropic_api_key"
    # Add other API keys as needed (e.g., GROQ_API_KEY, MISTRAL_API_KEY, etc.)
    
  4. Set up the database:

    pnpm prisma migrate dev
    
  5. Build the project:

    pnpm build
    

Configuration

  1. Start the development server:

    pnpm dev
    
  2. Set up ngrok:

    • Install ngrok: https://ngrok.com/download
    • Start ngrok on the same port as your CursorLens server:
      ngrok http 3000
      
    • Copy the ngrok URL (e.g., https://1234abcd.ngrok.io)
  3. Configure Cursor:

    • Open Cursor settings
    • Set the API endpoint to your ngrok URL
    • Set the toggle to use OpenAI Key on

Start Using CursorLens

  1. Begin coding with Cursor:

    • Use AI-assisted features like Cmd+i, Cmd+k, or Cmd+L
    • Requests will now be routed through your local CursorLens server
    • The model you choose in Configuration as default model will be used for your requests
  2. Access the CursorLens dashboard:

    • Open http://localhost:3000 in your browser
    • Explore analytics, view request logs, and monitor real-time interactions

Supported Providers and Models

CursorLens supports a wide range of AI models through various providers:

  • OpenAI: GPT-4o, GPT-4o mini
  • Anthropic: Claude 3 Opus, Claude 3.5 Sonnet
  • Groq: LLaMA 3.1 (405B, 70B, 8B), Mixtral 8x7B
  • Mistral: Mistral Large, Mistral Small, Mistral Medium
  • Cohere: Command, Command-r, Command-r-plus
  • Ollama: Various open-source models (CodeLlama, Llama 2, Llama 3, Mistral, Mixtral, Phi-2, Gemma, and more)

For a complete list of Ollama-supported models, refer to the Ollama model library.

Optimizing Your Workflow

  • Use the insights gained from the CursorLens dashboard to improve your AI-assisted coding efficiency
  • Experiment with different models to find the best fit for your coding tasks
  • Keep your CursorLens server running whenever you want to use these features

You're now ready to leverage the power of CursorLens to enhance your AI-assisted coding experience!