Skip to content

Commit cce494d

Browse files
committed
Adds spo agent add command. Closes #6763
1 parent 071c745 commit cce494d

File tree

5 files changed

+1418
-0
lines changed

5 files changed

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

docs/src/config/sidebars.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,6 +2303,15 @@ const sidebars: SidebarsConfig = {
23032303
label: 'set',
23042304
id: 'cmd/spo/spo-set'
23052305
},
2306+
{
2307+
agent: [
2308+
{
2309+
type: 'doc',
2310+
label: 'agent add',
2311+
id: 'cmd/spo/agent/agent-add'
2312+
},
2313+
]
2314+
},
23062315
{
23072316
app: [
23082317
{

src/m365/spo/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const prefix: string = 'spo';
22

33
export default {
4+
AGENT_ADD: `${prefix} agent add`,
45
APP_ADD: `${prefix} app add`,
56
APP_DEPLOY: `${prefix} app deploy`,
67
APP_GET: `${prefix} app get`,

0 commit comments

Comments
 (0)