关于 Cursor 中 AI 的配置规则如下:
You can add custom instructions to Cursor by modifying the Rules for AI section under Cursor Settings > General > Rules for AI.您可以通过修改Cursor Settings下的Rules for AI部分来向Cursor添加自定义指令> General > Rules for AI。This custom instruction will be included for features such as Cursor Chat and Ctrl/⌘ K.此自定义说明将包含在Cursor Chat和Ctrl/⌘ K等功能中。[heading3][heading3].cursorrules[content]For project-specific instructions,you can include the instructions in a.cursorrules file in the root of your project.对于特定于项目的说明,您可以将说明包含在项目根目录的.cursorrules文件中。As the same as the “Rules for AI” section,the instructions in the.cursorrules file will be included for features such as Cursor Chat and Ctrl/⌘ K.与“AI规则”部分相同,.cursorrules文件中的说明将包含在Cursor Chat和Ctrl/⌘ K等功能中。
By default,Cursor will index all files in your codebase if privacy mode is not enabled.默认情况下,如果未启用隐私模式,Cursor将索引代码库中的所有文件。You can also expand the Show Settings section to access more advanced options.Here,you can decide whether you want to enable automatic indexing for new repositories and configure the files that Cursor will ignore during repository indexing,in addition to your.gitignore settings.您还可以展开Show Settings(显示设置)部分以访问更多高级选项。在这里,除了.gitignore设置之外,您还可以决定是否要为新存储库启用自动索引,并配置Cursor在存储库索引期间将忽略的文件。If you have any large content files in your project that the AI definitely doesn’t need to read,[ignoring those files](https://docs.cursor.com/context/ignore-files)could improve the accuracy of the answers.如果您的项目中有任何AI绝对不需要读取的大型内容文件,[则忽略这些文件](https://docs.cursor.com/context/ignore-files)可以提高答案的准确性。
Cursor lets you input your own OpenAI API key to send as many AI messages as you want at your own cost.Cursor允许您输入自己的OpenAI API密钥,以自费发送任意数量的AI消息。You can get your own API key from[here](https://platform.openai.com/account/api-keys).To use your own API key,go to Cursor Settings > Models > OpenAI API Key and enter your API key.Then,click on the “Verify” button.Once your key is validated,your OpenAI API key will be enabled.您可以从[此处](https://platform.openai.com/account/api-keys)获取自己的API密钥。要使用您自己的API密钥,请转到OpenAI API密钥>模型的光标设置并输入您的API密钥。然后,单击“验证”按钮。验证密钥后,您的OpenAI API密钥将被启用。[heading3][heading3]Anthropic API Keys Anthropic API密钥[content]Similar to OpenAI,you can also set your own Anthropic API key so that you will be using claude-based models at your own cost.与OpenAI类似,您还可以设置自己的Anthropic API密钥,以便自费使用基于claude的模型。[heading3][heading3]Google API Keys Google API密钥[content]For Google API keys,you can set your own API key so that you will be using Google models such as gemini-1.5-flash-500k at your own cost.对于Google API密钥,您可以设置自己的API密钥,以便自费使用gemini-1.5-flash-500k等Google模型。[heading3]