企業設定

你可以透過裝置管理解決方案集中管理 Cursor 的特定功能,確保符合你的組織需求。當你指定 Cursor 原則時,其值會覆寫使用者裝置上對應的 Cursor 設定。 設定編輯器顯示「Extensions: Allowed」設定由組織管理。 Cursor 目前提供以下由管理員控管的功能原則:
PolicyDescriptionCursor settingAvailable since
AllowedExtensions控制哪些擴充功能可被安裝。extensions.allowed1.2
AllowedTeamId控制允許登入的 team ID。擁有未授權 team ID 的使用者會被強制登出。cursorAuth.allowedTeamId1.3

設定允許的擴充功能

extensions.allowed 是 Cursor 的一項設定,用來控制哪些擴充功能可以安裝。這個設定接受一個 JSON 物件,key 為發行者(publisher)名稱,value 為布林值,用來表示是否允許該發行者的擴充功能。 例如,將 extensions.allowed 設為 {"anysphere": true, "github": true} 會允許 Anysphere 和 GitHub 這兩個發行者的擴充功能;而設為 {"anysphere": false} 則會封鎖 Anysphere 的擴充功能。 如果想在組織層級集中管理允許的擴充功能,請透過你的裝置管理解決方案設定 AllowedExtensions 原則。這個原則會覆寫使用者裝置上的 extensions.allowed 設定。原則的值是一個 JSON 字串,用來定義允許的發行者。 想更了解 Cursor 的擴充功能,請參考 extensions 文件。

設定允許的團隊 ID

cursorAuth.allowedTeamId 這個 Cursor 設定會控制哪些團隊 ID 可以登入 Cursor。此設定接受以逗號分隔的已授權團隊 ID 清單。 例如,將 cursorAuth.allowedTeamId 設為 "1,3,7",就只允許這些特定團隊 ID 的使用者登入。 當使用者嘗試使用不在允許清單中的團隊 ID 登入時:
  • 會立刻被強制登出
  • 會顯示錯誤訊息
  • 應用程式會阻擋後續的驗證嘗試,直到使用有效的團隊 ID 為止
若要集中管理組織的允許團隊 ID,請透過裝置管理解決方案設定 AllowedTeamId 原則。此原則會覆寫使用者裝置上的 cursorAuth.allowedTeamId 設定。該原則的值是一個字串,內容為以逗號分隔的已授權團隊 ID 清單。

Windows 的群組原則

Cursor 支援以 Windows 登錄為基礎的群組原則。安裝原則定義後,管理員可以使用本機群組原則編輯器管理原則值。 要新增原則:
  1. AppData\Local\Programs\cursor\policies 複製 ADMX 和 ADML 原則檔案。
  2. 將 ADMX 檔案貼到 C:\Windows\PolicyDefinitions 目錄,並將 ADML 檔案貼到 C:\Windows\PolicyDefinitions\<your-locale>\ 目錄。
  3. 重新啟動本機群組原則編輯器。
  4. 在本機群組原則編輯器中設定適當的原則值(例如在 AllowedExtensions 原則中設定 {"anysphere": true, "github": true})。
原則可以在電腦層級和使用者層級設定。若兩者皆已設定,電腦層級優先。當原則值被設定後,該值會覆寫在任何層級(default、user、workspace 等)所設定的 Cursor 設定。

macOS 上的組態描述檔

組態描述檔用來管理 macOS 裝置上的設定。描述檔是含有鍵/值配對的 XML 檔案,對應到可用的政策。這些描述檔可以透過行動裝置管理(MDM)解決方案部署,或手動安裝。
下方示範一個 macOS 的 .mobileconfig 檔案:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>PayloadContent</key>
		<array>
			<dict>
				<key>PayloadDisplayName</key>
				<string>Cursor</string>
				<key>PayloadIdentifier</key>
				<string>com.todesktop.230313mzl4w4u92.J6B5723A-6539-4F31-8A4E-3CC96E51F48C</string>
				<key>PayloadType</key>
				<string>com.todesktop.230313mzl4w4u92</string>
				<key>PayloadUUID</key>
				<string>J6B5723A-6539-4F31-8A4E-3CC96E51F48C</string>
				<key>PayloadVersion</key>
				<integer>1</integer>
				<key>AllowedExtensions</key>
				<string>{"anysphere":true}</string>
				<key>AllowedTeamId</key>
				<string>1,2</string>
			</dict>
		</array>
		<key>PayloadDescription</key>
		<string>This profile manages Cursor.</string>
		<key>PayloadDisplayName</key>
		<string>Cursor</string>
		<key>PayloadIdentifier</key>
		<string>com.todesktop.230313mzl4w4u92</string>
		<key>PayloadOrganization</key>
		<string>Anysphere</string>
		<key>PayloadType</key>
		<string>Configuration</string>
		<key>PayloadUUID</key>
		<string>F2C1A7B3-9D4E-4B2C-8E1F-7A6C5D4B3E2F</string>
		<key>PayloadVersion</key>
		<integer>1</integer>
		<key>TargetDeviceType</key>
		<integer>5</integer>
	</dict>
</plist>

字串型政策

下面的範例示範如何設定 AllowedExtensions 政策。範例檔案中該政策的初始值為空(不允許任何擴充功能)。
<key>允許的副檔名</key>
<string></string>
<string> 標籤之間加入定義你政策的適當 JSON 字串。
<key>AllowedExtensions</key>
<string>{"anysphere": true, "github": true}</string>
對於 AllowedTeamId 原則,加入以逗號分隔的團隊 ID 清單:
<key>允許的團隊ID</key>
<string>1,3,7</string>
重要: 提供的 .mobileconfig 檔案會初始化該版本 Cursor 中可用的「所有」政策。請刪除任何不需要的政策。 如果不從範例 .mobileconfig 中編輯或移除某個政策,該政策就會以其預設(較為嚴格)的值強制生效。 手動安裝組態描述檔的方式是,在 Finder 中按兩下 .mobileconfig 檔案,然後在「系統設定」的「一般」>「裝置管理」中啟用它。從「系統設定」移除該描述檔,將會從 Cursor 中移除這些政策。 如需了解更多關於組態描述檔的資訊,請參考 Apple 的文件。

其他政策

目標是把目前的 Cursor 設定提升為政策,並盡量貼近既有設定,確保命名與行為一致。如果想新增更多政策,請到 Cursor 的 GitHub 儲存庫建立 issue。團隊會判斷該行為是否已有對應設定,或是否需要新增設定來控制預期的行為。

常見問題

Cursor 是否支援在 Linux 上使用設定檔?

目前 Linux 不在規劃支援範圍內。若你想在 Linux 上使用設定檔,請到 Cursor 的 GitHub 儲存庫提出 issue,並分享你的使用情境細節。