11#! /bin/bash
22
3- function cursor_start(){
4- # Start cursor after running the proxy
3+
4+ # ###########################################################
5+ # cursor.sh - Functions for integrating Cursor editor with LiteLLM Service
6+ # Provides automation and health-check utilities for Cursor.
7+ # ###########################################################
8+
9+ # Start Cursor after running the LiteLLM proxy
10+ function cursor_start() {
511 source ./src/common.sh
612 source ./src/litellm.sh
713 class_LiteLLMProxy proxy
814
9- proxy.check_status " $customModelName " || proxy.start_bg " $customModelName "
15+ local model_name=" $CUSTOM_MODEL_NAME "
16+ proxy.check_status " $model_name " || proxy.start_bg " $model_name "
1017
11- # Launch Cursor
18+ # Launch Cursor editor
1219 " C:\Users\<you>\AppData\Local\Programs\cursor\Cursor.exe"
1320}
1421
15- function cursor_scheduler(){
16- # Create a scheduled task that runs at user login
17- $ PATH_TO_PROJECT =" C:\path\to\your\project"
18- bash -lc ' cd $PATH_TO_PROJECT && ./src/menu.sh --auto-start'
22+ # Create a scheduled task that runs at user login to auto-start the service
23+ function cursor_scheduler() {
24+ local PATH_TO_PROJECT=" C:\path\to\your\project"
25+ bash -lc " cd $PATH_TO_PROJECT && ./src/menu.sh --auto-start"
1926}
2027
2128# Proxy health-check in Cursor
22- function cursor_health_check(){
29+ function cursor_health_check() {
2330 source ./src/common.sh
2431 source ./src/litellm.sh
25-
2632 class_LiteLLMProxy proxy
2733
28- proxy.check_status " $customModelName " || proxy.start_bg " $customModelName "
34+ local model_name=" $CUSTOM_MODEL_NAME "
35+ proxy.check_status " $model_name " || proxy.start_bg " $model_name "
2936
30- # Launch Cursor
37+ # Launch Cursor editor
3138 " C:\Users\<you>\AppData\Local\Programs\cursor\Cursor.exe"
3239}
40+
3341# Note: Cursor does not support custom ports or hosts for LLM API.
3442# It always calls localhost:4000.
35-
36- # To change the port, you must modify the LiteLLM proxy to listen on port 4000.
37- # This can be done by changing the LITELLM_PORT variable in src/common.sh to 4000
38- # and restarting the proxy.
43+ # To change the port, modify LITELLM_PORT in src/common.sh and restart the proxy.
0 commit comments