cursor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCursor Skill
Cursor 使用技巧
Use the CLI to control the Cursor AI-powered code editor (VS Code fork).
cursor使用 CLI来控制由AI驱动的代码编辑器Cursor(VS Code分支版本)。
cursorCLI Location
CLI 位置
bash
/usr/local/bin/cursorbash
/usr/local/bin/cursorOpening Files and Folders
打开文件与文件夹
Open current directory:
bash
cursor .Open specific file:
bash
cursor /path/to/file.tsOpen file at specific line:
bash
cursor /path/to/file.ts:42Open file at line and column:
bash
cursor /path/to/file.ts:42:10Open folder:
bash
cursor /path/to/projectOpen multiple files:
bash
cursor file1.ts file2.ts file3.ts打开当前目录:
bash
cursor .打开指定文件:
bash
cursor /path/to/file.ts打开文件并定位到指定行:
bash
cursor /path/to/file.ts:42打开文件并定位到指定行和列:
bash
cursor /path/to/file.ts:42:10打开文件夹:
bash
cursor /path/to/project打开多个文件:
bash
cursor file1.ts file2.ts file3.tsWindow Options
窗口选项
Open in new window:
bash
cursor -n /path/to/projectOpen in new window (alias):
bash
cursor --new-window /path/to/projectReuse existing window:
bash
cursor -r /path/to/fileReuse existing window (alias):
bash
cursor --reuse-window /path/to/file在新窗口中打开:
bash
cursor -n /path/to/project在新窗口中打开(别名):
bash
cursor --new-window /path/to/project复用现有窗口:
bash
cursor -r /path/to/file复用现有窗口(别名):
bash
cursor --reuse-window /path/to/fileDiff Mode
对比模式
Compare two files:
bash
cursor -d file1.ts file2.tsDiff (alias):
bash
cursor --diff file1.ts file2.ts对比两个文件:
bash
cursor -d file1.ts file2.ts对比(别名):
bash
cursor --diff file1.ts file2.tsWait Mode
等待模式
Wait for file to close (useful in scripts):
bash
cursor --wait /path/to/fileShort form:
bash
cursor -w /path/to/fileUse as git editor:
bash
git config --global core.editor "cursor --wait"等待文件关闭(在脚本中很实用):
bash
cursor --wait /path/to/file简写形式:
bash
cursor -w /path/to/file作为Git编辑器使用:
bash
git config --global core.editor "cursor --wait"Adding to Workspace
添加到工作区
Add folder to current workspace:
bash
cursor --add /path/to/folder将文件夹添加到当前工作区:
bash
cursor --add /path/to/folderExtensions
扩展管理
List installed extensions:
bash
cursor --list-extensionsInstall extension:
bash
cursor --install-extension <extension-id>Uninstall extension:
bash
cursor --uninstall-extension <extension-id>Disable all extensions:
bash
cursor --disable-extensions列出已安装的扩展:
bash
cursor --list-extensions安装扩展:
bash
cursor --install-extension <extension-id>卸载扩展:
bash
cursor --uninstall-extension <extension-id>禁用所有扩展:
bash
cursor --disable-extensionsVerbose and Debugging
详细输出与调试
Show version:
bash
cursor --versionShow help:
bash
cursor --helpVerbose output:
bash
cursor --verbose /path/to/fileOpen developer tools:
bash
cursor --inspect-extensions查看版本:
bash
cursor --version查看帮助:
bash
cursor --help详细输出:
bash
cursor --verbose /path/to/file打开开发者工具:
bash
cursor --inspect-extensionsSettings
设置
User settings location:
~/Library/Application Support/Cursor/User/settings.jsonKeybindings location:
~/Library/Application Support/Cursor/User/keybindings.json用户设置位置:
~/Library/Application Support/Cursor/User/settings.json快捷键设置位置:
~/Library/Application Support/Cursor/User/keybindings.jsonPortable Mode / Profiles
便携模式 / 配置文件
Specify user data directory:
bash
cursor --user-data-dir /path/to/dataSpecify extensions directory:
bash
cursor --extensions-dir /path/to/extensions指定用户数据目录:
bash
cursor --user-data-dir /path/to/data指定扩展目录:
bash
cursor --extensions-dir /path/to/extensionsPiping Input
管道输入
Read from stdin:
bash
echo "console.log('hello')" | cursor -从标准输入读取内容:
bash
echo "console.log('hello')" | cursor -Remote Development
远程开发
Cursor supports remote development similar to VS Code. SSH remotes are configured in:
~/.ssh/configThen use command palette or remote explorer in the GUI.
Cursor支持与VS Code类似的远程开发功能。SSH远程连接配置在:
~/.ssh/config然后可在GUI中使用命令面板或远程资源管理器进行操作。