Cursor AI开发辅助工具

2025/1/13 工具Cursor

# Cursor 下载

  1. 访问Cursor官方网站
  • 打开您的浏览器,访问 Cursor 的官方网站:https://www.cursor.com
  1. 开始下载
  • 点击"Download for free"

image-20250107101042615

# 在Windows安装Cursor

  1. 找到下载的安装文件(通常是 .exe 格式)

  2. 选中安装文件,点击右键选择以管理员身份运行,选择,启动安装向导

  3. 开始安装

  4. 安装完成后,自动启动软件,按照屏幕上的指示进行操作。

image-20250107104110773

image-20250107104120168

image-20250107104127887

image-20250107104136858

# Cursor登录或注册账户

  • 点击右上角的设置按钮

    image-20250107104151535

  • Cursor Settings 如下图,点击Sign in

    image-20250107104202919

  • 然后点击Sign Up - 注册

    image-20250107104217202

  • 填入你的用户名和邮箱,推荐使用163邮箱,QQ邮箱收到验证邮件的时候无法显示验证码

  • 邮箱收到验证码后,填入即可

  • 登录完成后,回到Cursor软件

    image-20250107104238073

# Cursor配置

# 配置Cursor语言为中文

  1. Ctrl+shift+X,扩展快捷键,输入Chinese,选择简体中文点击Install`

    image-20250107104255535

  2. 安装完成后,点击Change Language and Restart

    image-20250107104307574

# 配置composer

  1. 点击右上角的设置按钮

  2. 点击Features

  3. 找到composer,选择enabled

    image-20250107104326443

# 绕过本机机器码教程

# 问题

当在本机登录过3个账号后,就会报这个“Too many free trial accounts used on this machine.”提示,就算有免费体验额度也无法继续体验。

# 原因

Cursor 会通过机器码(machineId)来限制每台机器只能绑定 3 次账号,超出次数后,删除账号、使用新邮箱、重装cursor等方法都无法恢复免费试用期,原因在于这个机器ID依然存在,导致我们无法使用。

其实这就很简单了,我们只要把这个机器ID改掉,从而来“欺骗”Cursor,让他认为我们是一个全新的设备,就可以解决了!!!

# 解决方案

# 1. 找到storage.json配置文件

C:\Users\Administrator\AppData\Roaming\Cursor\User\globalStorage

注意:这里的Administrator为管理员用户目录,可能不一样,需要改成你自己的

# 2、关闭Cursor程序

这一点很重要,一定要关掉 Cursor !!!

# 3、运行Pythone脚本

这里我们可以写一个python脚本 change_machine_id.py 来给我们自动生成一个新的machineId,并写入storage.json

import os
import json
import uuid
from datetime import datetime
import shutil
 
 
# 配置文件路径,适配 Windows 的路径格式
# storage_file = os.path.expanduser(r"~\AppData\Local\Cursor\User\globalStorage\storage.json")
# win11 专用
storage_file = os.path.expanduser(r"C:\Users\yuzijun\AppData\Roaming\Cursor\User\globalStorage\storage.json")
 
# 生成随机 ID
def generate_random_id():
    return uuid.uuid4().hex
 
# 获取新的 ID(从命令行参数或自动生成)
def get_new_id():
    import sys
    return sys.argv[1] if len(sys.argv) > 1 else generate_random_id()
 
# 创建备份
def backup_file(file_path):
    if os.path.exists(file_path):
        backup_path = f"{file_path}.backup_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
        shutil.copy(file_path, backup_path)
        print(f"已创建备份文件: {backup_path}")
    else:
        print("未找到需要备份的文件,跳过备份步骤。")
 
# 更新或创建 JSON 文件
def update_machine_id(file_path, new_id):
    # 确保目录存在
    os.makedirs(os.path.dirname(file_path), exist_ok=True)
 
    # 如果文件不存在,创建一个空的 JSON 文件
    if not os.path.exists(file_path):
        with open(file_path, "w", encoding="utf-8") as f:
            json.dump({}, f)
 
    # 读取 JSON 数据
    with open(file_path, "r", encoding="utf-8") as f:
        try:
            data = json.load(f)
        except json.JSONDecodeError:
            data = {}
 
    # 更新或添加 machineId
    data["telemetry.machineId"] = new_id
 
    # 写回更新后的 JSON 文件
    with open(file_path, "w", encoding="utf-8") as f:
        json.dump(data, f, indent=4, ensure_ascii=False)
 
    print(f"已成功修改 machineId 为: {new_id}")
 
# 主函数
if __name__ == "__main__":
    new_id = get_new_id()
 
    # 创建备份
    backup_file(storage_file)
 
    # 更新 JSON 文件
    update_machine_id(storage_file, new_id)": new_id = get_new_id()  # 创建备份 backup_file(storage_file)  # 更新 JSON 文件 update_machine_id(storage_file, new_id)

运行完成后,有如下提示

image-20250107104834720

文件也会进行备份

image-20250107104858630

# python安装教程

某些人的电脑可能没有安装python 或者不会python的运行方式

# 1、下载python

下载地址:https://www.python.org/downloads/release/python-3131/

# 2、安装教程

1、运行安装程序: 双击下载的Python安装包文件(通常是.exe格式),这将启动Python安装向导

勾选绿色

image-20250107110311703

# 3、安装后验证

cmd进入后,输入python

image-20250107110415164

image-20250107110428338

# 4、运行脚本

image-20250107110524373