A simple JS script for the browser console that allows users to manage spending limits and toggle usage-based pricing for AI code editor Cursor.
This script was developed in response to an issue reported with the Cursor.com frontend UI, which prevented users from updating their spending limit after hitting a hard cap. This utility allows users to manage their spending limits and toggle usage-based pricing directly from the browser console, providing a temporary solution while waiting for an official update from the Cursor team.
- Manage spending limits easily.
- Toggle usage-based pricing as needed.
- Clear instructions for obtaining the required session token.
- User-friendly command options for enhanced interaction.
- A web browser with developer tools (e.g., Chrome, Firefox).
- Open your browser's console (F12).
- Copy and paste the script into the console.
Here are the available commands you can use after initializing the script:
- Initialize the Script:
init('your_token_here');
Replace 'your_token_here'
with your actual session token.
- Set Spending Limit:
setLimit(amount);
Example:
setLimit(100); // Sets the spending limit to $100
- Set Spending Limit with Usage-Based Pricing Disabled:
setLimit(amount, true);
Example:
setLimit(100, true); // Sets the spending limit to $100 and disables usage-based pricing
- Get Token Help:
getToken();
This command will display instructions on how to obtain your session token.
To get your session token, follow these steps:
- Open DevTools (F12).
- Go to Application → Cookies.
- Find
cursor.com
→WorkosCursorSessionToken
. - Copy the Value.
- Run:
init('paste_token_here')
.
- Open DevTools (F12).
- Go to Storage → Cookies.
- Find
cursor.com
→WorkosCursorSessionToken
. - Copy the Value.
- Run:
init('paste_token_here')
.
This project is open-source and available under the MIT License.
If you have suggestions for improvements or encounter issues, feel free to open an issue or submit a pull request.
Made with ❤️ by @RMNCLDYO.