Automatically register a Cursor account and save the account name, password, and token.
- Register Cursor accounts and save account, password and token to .csv locally.
- Register Cursor accounts upload tokens to Chat API.
- Manage Cursor channels with low balance in Chat API.
- The above features all support to run in Github Action environment.
pip install -r requirements.txt
python cursor_register.py register.number=3
register.number: The account number you want to register
The config.yaml describes all the parameters for the account register. If you want to do advanced configuration, like IMAP or Chat-API, please edit the .yaml file for the parameters.
register:
number: 1
max_workers: 1
register.number: The account number you want to registerregister.max_workers: Max worker number in multi-threading
Default setting to get email verification code from temp email server
register:
temp_email_server:
name: Minuteinboxcom
register.temp_email_server.name: Which temp email you are using
When you use IMAP to receive the email verification code, you should edit the parameter for your IMAP account.
register:
email_server:
name: imap_email_server
use_custom_address: true
custom_email_address:
- [email protected]
- [email protected]
imap_email_server:
imap_server: imap.qq.com
imap_port: 993
username: username
password: password
register.email_server.name: Should beimap_email_serverwhen use IMAP receives the emailregister.email_server.use_custom_address: Should betruewhen use IMAP receives the emailregister.email_server.custom_email_address: Email address listregister.imap_email_server: Your IMAP server configuration
Upload the account cookie token into Chat-API
You need to pay attention to the oneapi section. Set the enabled to true and replace the value of url, token, channel_url for your website.
oneapi:
enabled: true
url: http://localhost:3000
token: your_oneapi_token
channel_url: http://localhost:3010
oneapi.enabled: Should betruewhen upload data into Chat-APIoneapi.url: The web address for your chatapi server.oneapi.token: The access token for your chatapi website. See more details in OneAPI APIoneapi.channel_url: The cursor-api reverse proxy server like Cursor-To-OpenAI
Manage low balance Cursor channels in Chat-API
python tokenManager/oneapi_cursor_cleaner.py --oneapi_url {oneapi_url} --oneapi_token {oneapi_token} --disable_low_balance_accounts {disable_low_balance_accounts} --delete_low_balance_accounts {delete_low_balance_accounts}
oneapi_url: The web address for your chatapi server.oneapi_token: The access token for your chatapi website. See more details in OneAPI APIdisable_low_balance_accounts:TrueorFalseto disable the low balance accounts in Chat-APIdelete_low_balance_accounts:TrueorFalseto delete the low balance accounts in Chat-API
The Github Action pipeline Cursor Register provides the following parameter:
number: The account number you want to register.max_workers: Parallelism for threading pool. Suggest to use1in Github Action environment.email_server: SupportTempEmail,IMAP. You need to set your IMAP account via secret in repo you chooseIMAP.Ingest account tokens to OneAPI: Mark as☑to create channel Chat-API service. Mark as☐will skip this step. You need to set your IMAP account via secret in repo you choose to enable this.Upload account infos to artifact: Mark as☑to make Github Action uploead the csv files to artifacts. Then you can download them after workflow succeeds. Mark as☐will skip this step.
If you are new to use secret in Github Action. you can add the secret following Security Guides
If you want to use the token directly or your ChatAPI does not have a public IP, you can manually download token.csv after running the GitHub Action pipeline. Do not forget to delete the artifact after you download it to avoid data leakage.
Please run the Github Action pipeline Cursor Register with the following parameter:
Upload account infos to artifact: Should be☑.
Register accounts. Upload the account cookie token into Chat-API
Please add the following secret in your repo.
CURSOR_ONEAPI_URL: For parameteroneapi.urlCURSOR_ONEAPI_TOKEN: For parameteroneapi.tokenCURSOR_CHANNEL_URL: For parameteroneapi.channel_url
Please run the Github Action pipeline Cursor Register with the following parameter:
Ingest account tokens to OneAPI: Should be☑
Please add the following secret in your repo:
CURSOR_IMAP_SERVER: IMAP serverCURSOR_IMAP_PORT: IMAP portCURSOR_IMAP_USERNAME: IMAP usernameCURSOR_IMAP_PASSWORD: IMAP passowrdCURSOR_CUSTOM_EMAIL_ADDRESS: Email addresses, separated by commas
Please run the Github Action pipeline Cursor Register with the following parameter:
email_server: Should beIMAP
Manage low balance Cursor channels in Chat-API
Before runnign the pipeline, you need to add the following secrets in your repo.
CURSOR_ONEAPI_URL: For parameteroneapi.urlCURSOR_ONEAPI_TOKEN: For parameteroneapi.token
Please run the Github Action pipeline OneAPI Cursor Cleaner.
Disable Low Balance Accounts: Disable low balance accounts or notDelete Low Balance Accounts: Delete low balance accounts or not
- Maybe some bugs when running in multiple threading mode (
max_workers> 1), but not sure. :( - A new Github Action pipeline to automatically maintain the minimum balance of Curosr accounts in ChatAPI, and automatically register if the balance is too low.
- cursor-api for Python code in auto register