Skip to main content

Cursor Provider

Cursor AI assistant provider implementation.

Overview

This module implements the AssistantProvider ABC for Cursor AI-powered code editor, providing configuration, injection values, validation, and setup instructions. The CursorProvider class encapsulates all Cursor-specific logic including: - Configuration management using Pydantic models - Template injection point values - Setup validation and instructions - Integration with Cursor editor and MDC rule files

Classes

CursorProvider

Cursor AI assistant provider implementation.

Inherits from: AssistantProvider

Methods

format_import
format_import(self, current_dir: pathlib.Path, target_file: pathlib.Path) -> str

Format file import for Cursor using @ syntax with relative paths.

Parameters:

  • current_dir (Path, required)
  • target_file (Path, required)

Returns: str

Cursor uses @ syntax similar to Claude but in .mdc files.

get_injection_values
get_injection_values(self) -> Dict[specify_cli.assistants.injection_points.InjectionPointMeta, str]

Return Cursor-specific injection point values.

Returns: Dict

get_setup_instructions
get_setup_instructions(self) -> List[str]

Return step-by-step setup instructions for Cursor.

Returns: List

validate_setup
validate_setup(self) -> specify_cli.assistants.interfaces.ValidationResult

Validate that Cursor is properly set up.

Returns: ValidationResult

Properties

  • config
  • imports_supported