|
| 1 | +import Global from '/docs/cmd/_global.mdx'; |
| 2 | +import Tabs from '@theme/Tabs'; |
| 3 | +import TabItem from '@theme/TabItem'; |
| 4 | + |
| 5 | +# spo agent add |
| 6 | + |
| 7 | +Adds a new SharePoint agent |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +```sh |
| 12 | +m365 spo agent add [options] |
| 13 | +``` |
| 14 | + |
| 15 | +## Options |
| 16 | + |
| 17 | +```md definition-list |
| 18 | +`-u, --webUrl <webUrl>` |
| 19 | +: URL of the site where the agent should be added. |
| 20 | + |
| 21 | +`-n, --name <name>` |
| 22 | +: The name of the agent. |
| 23 | + |
| 24 | +`-a, --agentInstructions <agentInstructions>` |
| 25 | +: The definition of the agent's role, tone, and limitations. |
| 26 | + |
| 27 | +`-w, --welcomeMessage <welcomeMessage>` |
| 28 | +: The welcome message. |
| 29 | + |
| 30 | +`-s, --sourceUrls <sourceUrls>` |
| 31 | +: Comma-separated list of URLs of the SharePoint sites, libraries, or files that are the sources of information. |
| 32 | + |
| 33 | +`-d, --description <description>` |
| 34 | +: The brief description of the agent's objective. |
| 35 | + |
| 36 | +`-i, --icon [icon]` |
| 37 | +: The URL of the icon. |
| 38 | + |
| 39 | +`-c, --conversationStarters [conversationStarters]` |
| 40 | +: Starter prompts. Please provide each prompt separated by a comma. |
| 41 | +``` |
| 42 | + |
| 43 | +<Global /> |
| 44 | + |
| 45 | +## Examples |
| 46 | + |
| 47 | +Add a SharePoint agent with site and library sources. |
| 48 | + |
| 49 | +```sh |
| 50 | +m365 spo agent add --webUrl https://contoso.sharepoint.com/sites/projectSite --name "Project Assistant" --agentInstructions "You are a helpful assistant for project management tasks. Be professional and concise." --welcomeMessage "Hello! I'm here to help you with project management tasks." --sourceUrls "https://contoso.sharepoint.com/sites/projectSite,https://contoso.sharepoint.com/sites/projectSite/Shared Documents/Forms/AllItems.aspx" --description "A helpful agent for project management assistance" |
| 51 | +``` |
| 52 | + |
| 53 | +Add a SharePoint agent with icon and conversation starters. |
| 54 | + |
| 55 | +```sh |
| 56 | +m365 spo agent add --webUrl https://contoso.sharepoint.com/sites/projectSite --name "HR Assistant" --agentInstructions "You are an HR assistant. Help with HR policies and procedures." --welcomeMessage "Welcome! I can help you with HR-related questions." --sourceUrls "https://contoso.sharepoint.com/sites/hr" --icon "https://contoso.sharepoint.com/sites/projectSite/SiteAssets/hr-icon.png" --conversationStarters "What are the vacation policies?,How do I submit a timesheet?,Where can I find the employee handbook?" --description "A helpful agent for project management assistance" |
| 57 | +``` |
| 58 | + |
| 59 | +Add a basic SharePoint agent with minimal configuration. |
| 60 | + |
| 61 | +```sh |
| 62 | +m365 spo agent add --webUrl https://contoso.sharepoint.com/sites/marketing --name "Marketing Bot" --agentInstructions "Assist with marketing campaign information and resources." --welcomeMessage "Hi! I can help you find marketing resources." --sourceUrls "https://contoso.sharepoint.com/sites/marketing/Campaigns" --description "A helpful agent for project management assistance" |
| 63 | +``` |
| 64 | + |
| 65 | +## Response |
| 66 | + |
| 67 | +<Tabs> |
| 68 | + <TabItem value="JSON"> |
| 69 | + |
| 70 | + ```json |
| 71 | + { |
| 72 | + "CheckInComment": "", |
| 73 | + "CheckOutType": 2, |
| 74 | + "ContentTag": "{95784749-23D7-410D-BAEF-E694328F89AB},1,1", |
| 75 | + "CustomizedPageStatus": 0, |
| 76 | + "ETag": "\"{95784749-23D7-410D-BAEF-E694328F89AB},1\"", |
| 77 | + "Exists": true, |
| 78 | + "ExistsAllowThrowForPolicyFailures": true, |
| 79 | + "ExistsWithException": true, |
| 80 | + "IrmEnabled": false, |
| 81 | + "Length": "4543", |
| 82 | + "Level": 1, |
| 83 | + "LinkingUri": null, |
| 84 | + "LinkingUrl": "", |
| 85 | + "MajorVersion": 1, |
| 86 | + "MinorVersion": 0, |
| 87 | + "Name": "Test Agent (4).agent", |
| 88 | + "ServerRelativeUrl": "/sites/TestSite/SiteAssets/Copilots/Test Agent.agent", |
| 89 | + "TimeCreated": "2025-08-19T06:49:03Z", |
| 90 | + "TimeLastModified": "2025-08-19T06:49:03Z", |
| 91 | + "Title": null, |
| 92 | + "UIVersion": 512, |
| 93 | + "UIVersionLabel": "1.0", |
| 94 | + "UniqueId": "95784749-23d7-410d-baef-e694328f89ab" |
| 95 | + } |
| 96 | + ``` |
| 97 | + |
| 98 | + </TabItem> |
| 99 | + <TabItem value="Text"> |
| 100 | + |
| 101 | + ```text |
| 102 | + CheckOutType : 2 |
| 103 | + ContentTag : {802D355C-0917-44D9-A51C-6FD873572700},1,1 |
| 104 | + CustomizedPageStatus : 0 |
| 105 | + ETag : "{802D355C-0917-44D9-A51C-6FD873572700},1" |
| 106 | + Exists : true |
| 107 | + ExistsAllowThrowForPolicyFailures: true |
| 108 | + ExistsWithException : true |
| 109 | + IrmEnabled : false |
| 110 | + Length : 4543 |
| 111 | + Level : 1 |
| 112 | + LinkingUri : null |
| 113 | + LinkingUrl : |
| 114 | + MajorVersion : 1 |
| 115 | + MinorVersion : 0 |
| 116 | + Name : Test Agent.agent |
| 117 | + ServerRelativeUrl : /sites/TestSite/SiteAssets/Copilots/Test Agent.agent |
| 118 | + TimeCreated : 2025-08-19T06:48:26Z |
| 119 | + TimeLastModified : 2025-08-19T06:48:26Z |
| 120 | + Title : null |
| 121 | + UIVersion : 512 |
| 122 | + UIVersionLabel : 1.0 |
| 123 | + UniqueId : 802d355c-0917-44d9-a51c-6fd873572700 |
| 124 | + ``` |
| 125 | + |
| 126 | + </TabItem> |
| 127 | + <TabItem value="CSV"> |
| 128 | + |
| 129 | + ```csv |
| 130 | + CheckInComment,CheckOutType,ContentTag,CustomizedPageStatus,ETag,Exists,ExistsAllowThrowForPolicyFailures,ExistsWithException,IrmEnabled,Length,Level,Linkin |
| 131 | + gUri,LinkingUrl,MajorVersion,MinorVersion,Name,ServerRelativeUrl,TimeCreated,TimeLastModified,Title,UIVersion,UIVersionLabel,UniqueId |
| 132 | + ,2,"{A8541C6C-163E-48B9-AD8C-33D9669C148A},1,1",0,"""{A8541C6C-163E-48B9-AD8C-33D9669C148A},1""",1,1,1,0,4543,1,,,1,0,Test Agent.agent,/sites/TestSite/SiteAssets/Copilots/Test Agent.agent,2025-08-19T06:47:57Z,2025-08-19T06:47:57Z,,512,1.0,a8541c6c-163e-48b9-ad8c-33d9669c148a |
| 133 | + ``` |
| 134 | + |
| 135 | + </TabItem> |
| 136 | + <TabItem value="Markdown"> |
| 137 | + |
| 138 | + ```md |
| 139 | + # spo agent add --debug "false" --verbose "false" --webUrl "https://contoso.sharepoint.com/sites/TestSite/" --name "Test Agent" -- |
| 140 | +agentInstructions "You are a comprehensive test agent" --welcomeMessage "Welcome to the comprehensive test agent" --sourceUrls "https://contoso.sharepoint.com/sites/TestSite/Shared%20Documents/Forms/AllItems" --description "A comprehensive test agent" |
| 141 | + Date: 19/08/2025 |
| 142 | + |
| 143 | + ## Test Agent.agent (ad6f7a4e-4582-4cc4-bae6-65ade97e5e71) |
| 144 | + |
| 145 | + Property | Value |
| 146 | + ---------|------- |
| 147 | + CheckInComment | |
| 148 | + CheckOutType | 2 |
| 149 | + ContentTag | {AD6F7A4E-4582-4CC4-BAE6-65ADE97E5E71},1,1 |
| 150 | + CustomizedPageStatus | 0 |
| 151 | + ETag | "{AD6F7A4E-4582-4CC4-BAE6-65ADE97E5E71},1" |
| 152 | + Exists | true |
| 153 | + ExistsAllowThrowForPolicyFailures | true |
| 154 | + ExistsWithException | true |
| 155 | + IrmEnabled | false |
| 156 | + Length | 4543 |
| 157 | + Level | 1 |
| 158 | + LinkingUrl | |
| 159 | + MajorVersion | 1 |
| 160 | + MinorVersion | 0 |
| 161 | + Name | Test Agent.agent |
| 162 | + ServerRelativeUrl | /sites/TestSite/SiteAssets/Copilots/Test Agent.agent |
| 163 | + TimeCreated | 2025-08-19T06:46:30Z |
| 164 | + TimeLastModified | 2025-08-19T06:46:30Z |
| 165 | + UIVersion | 512 |
| 166 | + UIVersionLabel | 1.0 |
| 167 | + UniqueId | ad6f7a4e-4582-4cc4-bae6-65ade97e5e71 |
| 168 | + ``` |
| 169 | + |
| 170 | + </TabItem> |
| 171 | +</Tabs> |
0 commit comments