Configuration File (config.ini)
Relevant source files
The following files were used as context for generating this wiki page:
The config.ini file is the central configuration point for the cursor-free-vip tool. It allows users to customize various operational parameters, including browser paths, automation timings, and feature toggles. The file is automatically generated and managed by the config.py script, which ensures that all necessary sections and default values are present.
The configuration file is located in a hidden directory within the user's Documents folder: Documents/.cursor-free-vip/config.ini. This centralized approach allows different modules of the application, such as totally_reset_cursor.py and main.py, to access consistent settings for paths and behavior.
Sources: README.md, config.py:26-31
Configuration Management
The config.py script handles the lifecycle of the config.ini file. The primary function responsible for this is setup_config().
Initialization Flow
When the application starts, the setup_config() function executes the following logic to ensure a valid configuration file is available:
- It determines the user's
Documentspath. If not found, it defaults to the current working directory. - It creates a
.cursor-free-vipdirectory at the determined path if it doesn't exist. - If directory creation fails (e.g., due to permissions), it falls back to using a temporary directory.
- It checks if
config.iniexists.- If it exists, it reads the file and merges it with the default configuration, adding any missing options.
- If it does not exist, it creates a new
config.inifile populated with all default sections and values.
This flow is illustrated by the following diagram:
Sources: config.py:22-100
Configuration Caching
To optimize performance and avoid redundant file I/O, the configuration is cached in a global variable _config_cache after the first read. Subsequent calls to get_config() will return the cached object directly.
This sequence diagram shows the caching mechanism:
Sources: config.py:488-492
Forced Updates
The configuration can be forcibly updated to the latest defaults. This is controlled by the enabled_force_update flag in the [Utils] section. If this is set to True, the force_update_config function will back up the existing config.ini and regenerate it from the defaults.
Sources: config.py:441-486
Configuration Structure
The config.ini file is organized into several sections, each controlling a specific aspect of the tool's functionality.
[Browser]
This section defines paths for supported web browsers and their corresponding WebDriver executables. These paths are auto-detected but can be manually overridden.
| Key | Default Value | Description |
|---|---|---|
default_browser | chrome | The default browser to use for automation tasks. |
chrome_path | (Auto-detected) | Path to the Google Chrome executable. |
chrome_driver_path | (Auto-detected) | Path to the chromedriver.exe. |
edge_path | (Auto-detected) | Path to the Microsoft Edge executable. |
edge_driver_path | (Auto-detected) | Path to the msedgedriver.exe. |
firefox_path | (Auto-detected) | Path to the Firefox executable. |
firefox_driver_path | (Auto-detected) | Path to the geckodriver.exe. |
brave_path | (Auto-detected) | Path to the Brave browser executable. |
brave_driver_path | (Auto-detected) | Path to the chromedriver.exe for Brave. |
opera_path | (Auto-detected) | Path to the Opera browser executable. |
opera_driver_path | (Auto-detected) | Path to the chromedriver.exe for Opera. |
operagx_path | (Auto-detected) | Path to the Opera GX browser executable. |
operagx_driver_path | (Auto-detected) | Path to the chromedriver.exe for Opera GX. |
Sources: config.py:72-88
[Turnstile]
Settings for handling Cloudflare Turnstile challenges during automation.
| Key | Default Value | Description |
|---|---|---|
handle_turnstile_time | 2 | Base wait time (in seconds) for handling the challenge. |
handle_turnstile_random_time | 1-3 | A random time range (in seconds) added to the base wait time. |
Sources: config.py:89-92
[Timing]
This section contains various timing settings to make automation scripts appear more human-like by introducing randomized delays.
| Key | Default Value | Description |
|---|---|---|
min_random_time | 0.1 | Minimum random wait time. |
max_random_time | 0.8 | Maximum random wait time. |
page_load_wait | 0.1-0.8 | Wait time range for page loads. |
input_wait | 0.3-0.8 | Wait time range between input actions. |
submit_wait | 0.5-1.5 | Wait time range after submitting a form. |
verification_code_input | 0.1-0.3 | Wait time range for inputting a verification code. |
verification_success_wait | 2-3 | Wait time range after successful verification. |
verification_retry_wait | 2-3 | Wait time range before retrying verification. |
email_check_initial_wait | 4-6 | Initial wait time before checking for an email. |
email_refresh_wait | 2-4 | Wait time range between email refreshes. |
settings_page_load_wait | 1-2 | Wait time range for the settings page to load. |
failed_retry_time | 0.5-1 | Wait time range before retrying a failed action. |
retry_interval | 8-12 | Interval between major retry attempts. |
max_timeout | 160 | Maximum timeout in seconds for long-running operations. |
Sources: config.py:93-110
[Utils]
General utility flags for controlling tool features.
| Key | Default Value | Description |
|---|---|---|
enabled_update_check | True | If True, checks for new versions of the tool on startup. |
enabled_force_update | False | If True, forces the config file to be overwritten with defaults on startup. |
enabled_account_info | True | If True, displays account information in the main menu. |
Sources: config.py:111-115, main.py:532-533
[OAuth]
Configuration for OAuth authentication flows.
| Key | Default Value | Description |
|---|---|---|
show_selection_alert | False | Whether to show a selection alert pop-up. |
timeout | 120 | Timeout in seconds for the OAuth process. |
max_attempts | 3 | Maximum number of attempts for the OAuth flow. |
Sources: config.py:116-120
[Token]
Settings related to authentication token management.
| Key | Default Value | Description |
|---|---|---|
refresh_server | https://token.cursorpro.com.cn | The server endpoint for refreshing tokens. |
enable_refresh | True | Whether to enable automatic token refreshing. |
Sources: config.py:121-124
[Language]
Controls the localization and language settings for the user interface.
| Key | Default Value | Description |
|---|---|---|
current_language | (Auto-detected) | The current language code (e.g., en, zh_cn). If empty, it's detected from the system. |
fallback_language | en | The language to use if a translation is missing in the current language. |
auto_update_languages | True | Whether to automatically update language files. |
language_cache_dir | (Auto-generated) | The directory to cache language files. |
Sources: config.py:125-130, main.py:101-114
[TempMailPlus]
Configuration for using the TempMail.Plus service for temporary emails.
| Key | Default Value | Description |
|---|---|---|
enabled | false | Enables or disables the use of TempMail.Plus. |
email | (empty) | The TempMail.Plus email address to use. |
epin | (empty) | The PIN for the TempMail.Plus email. |
Sources: config.py:321-325
OS-Specific Path Sections
The setup_config function detects the operating system and creates a corresponding section ([WindowsPaths], [MacPaths], or [LinuxPaths]) to store default paths to Cursor application files. These paths are crucial for scripts like totally_reset_cursor.py to locate and modify Cursor's core files and data.
The following diagram shows how different scripts consume path information from the configuration file.
[WindowsPaths]
| Key | Default Value |
|---|---|
storage_path | %APPDATA%\Cursor\User\globalStorage\storage.json |
sqlite_path | %APPDATA%\Cursor\User\globalStorage\state.vscdb |
machine_id_path | %APPDATA%\Cursor\machineId |
cursor_path | %LOCALAPPDATA%\Programs\Cursor\resources\app |
updater_path | %LOCALAPPDATA%\cursor-updater |
update_yml_path | %LOCALAPPDATA%\Programs\Cursor\resources\app-update.yml |
product_json_path | %LOCALAPPDATA%\Programs\Cursor\resources\app\product.json |
Sources: config.py:137-145
[MacPaths]
| Key | Default Value |
|---|---|
storage_path | ~/Library/Application Support/Cursor/User/globalStorage/storage.json |
sqlite_path | ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb |
machine_id_path | ~/Library/Application Support/Cursor/machineId |
cursor_path | /Applications/Cursor.app/Contents/Resources/app |
updater_path | ~/Library/Application Support/cursor-updater |
update_yml_path | /Applications/Cursor.app/Contents/Resources/app-update.yml |
product_json_path | /Applications/Cursor.app/Contents/Resources/app/product.json |
Sources: config.py:151-159
[LinuxPaths]
The Linux path detection is more complex, checking multiple common installation locations for Cursor. It attempts to find the correct path and provides detailed feedback if it fails.
| Key | Default Value |
|---|---|
storage_path | ~/.config/Cursor/User/globalStorage/storage.json (or cursor) |
sqlite_path | ~/.config/Cursor/User/globalStorage/state.vscdb (or cursor) |
machine_id_path | ~/.config/Cursor/machineid (or cursor) |
cursor_path | (Auto-detected from common locations) |
updater_path | ~/.config/cursor-updater |
update_yml_path | (Relative to cursor_path) |
product_json_path | (Relative to cursor_path) |
Sources: config.py:161-319, locales/en.json:206-224