switching-projects
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSwitch Project
切换项目
Use this skill when the user wants to switch to a different project, open another codebase, or move the current conversation to a different workspace root.
当用户想要切换到另一个项目、打开其他代码库,或是将当前对话切换到不同的工作区根目录时,可使用此技能。
How It Works
工作原理
Cursor has a built-in MCP server called with a tool called that changes the agent's active workspace directory. This lets you switch projects mid-conversation without opening a new window.
cursor-app-controlmove_agent_to_rootCursor内置了一个名为的MCP服务器,其中包含一个名为的工具,可更改Agent的活动工作区目录。这让你无需打开新窗口,就能在对话过程中切换项目。
cursor-app-controlmove_agent_to_rootSteps
操作步骤
-
Ask or infer the target project — if the user says "switch to my-app", search for it. Common project locations:
~/Documents/development/~/projects/~/code/~/repos/
List directories in the likely parent folder to find the project:bashls ~/Documents/development/If ambiguous, ask the user which project they mean. -
Switch the workspace — call theMCP tool:
cursor-app-controlTool: move_agent_to_root Arguments: { "rootPath": "/Users/<username>/Documents/development/<project-name>" }This updates the visible workspace, file tree, and default working directory for all subsequent commands. -
Orient in the new project — after switching, briefly describe what you see:
- Read the project's ,
package.json, or equivalent to understand the stack.README.md - Run to show the current branch and state.
git status - List the top-level directory structure.
- Read the project's
-
询问或推断目标项目 —— 如果用户说“切换到my-app”,请搜索该项目。常见的项目位置:
~/Documents/development/~/projects/~/code/~/repos/
列出可能的父文件夹中的目录以找到目标项目:bashls ~/Documents/development/如果存在歧义,请询问用户具体指的是哪个项目。 -
切换工作区 —— 调用MCP工具:
cursor-app-controlTool: move_agent_to_root Arguments: { "rootPath": "/Users/<username>/Documents/development/<project-name>" }此操作会更新可见的工作区、文件树以及后续所有命令的默认工作目录。 -
适应新项目 —— 切换完成后,简要描述你看到的内容:
- 读取项目的、
package.json或同类文件以了解技术栈。README.md - 运行以显示当前分支和状态。
git status - 列出顶层目录结构。
- 读取项目的
Creating a New Project
创建新项目并切换
If the user wants to start a new project and switch to it:
- Call with the desired path — this creates the directory and initializes a git repo.
create_project - Call to switch into it.
move_agent_to_root - Begin scaffolding.
如果用户想要创建新项目并切换到该项目:
- 使用指定路径调用—— 此操作会创建目录并初始化git仓库。
create_project - 调用切换到该项目。
move_agent_to_root - 开始搭建项目框架。
Notes
注意事项
- This only works if the MCP server is enabled.
cursor-app-control - The switch happens in the current conversation — no new window is opened.
- All file paths in subsequent tool calls will resolve relative to the new root.
- You can switch back to the original project the same way.
- 仅当MCP服务器启用时,此功能才可使用。
cursor-app-control - 切换操作在当前对话中进行 —— 无需打开新窗口。
- 后续工具调用中的所有文件路径都将相对于新的根目录解析。
- 你可以用同样的方式切换回原项目。