1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "vrcli")]
#[command(about = "A simple CLI tool for VRChat API")]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand)]
pub enum Commands {
/// Manage friends
Friends {
#[command(subcommand)]
action: FriendsAction,
},
/// Manage users
Users {
#[command(subcommand)]
action: UsersAction,
},
/// Manage worlds
Worlds {
#[command(subcommand)]
action: WorldsAction,
},
/// Authentication management
Auth {
#[command(subcommand)]
action: AuthAction,
},
/// Send invites or request invites from friends
Invite {
#[command(subcommand)]
action: InviteAction,
},
}
#[derive(Subcommand)]
pub enum AuthAction {
/// Set authentication credentials
Login,
/// Show current authentication status
Status,
/// Logout and remove stored credentials
Logout,
}
#[derive(Subcommand)]
pub enum FriendsAction {
/// List all friends
#[command(disable_help_flag = true)]
List {
/// Show only offline friends
#[arg(long, conflicts_with = "online")]
offline: bool,
/// Show only online friends
#[arg(long, conflicts_with = "offline")]
online: bool,
/// Number of friends to fetch
#[arg(short = 'n', long)]
limit: Option<i32>,
/// Offset for pagination
#[arg(short, long)]
offset: Option<i32>,
/// Show user IDs
#[arg(long)]
show_id: bool,
/// Show user status
#[arg(long)]
show_status: bool,
/// Show platform information
#[arg(long)]
show_platform: bool,
/// Show location information
#[arg(long)]
show_location: bool,
/// Show last activity
#[arg(long)]
show_activity: bool,
/// Output in JSON format
#[arg(long)]
json: bool,
/// Sort method: name, status, activity, platform, id
#[arg(short = 's', long, default_value = "name")]
sort: String,
/// Reverse sort order
#[arg(short = 'r', long)]
reverse: bool,
/// Show additional details (status, platform, etc.) [DEPRECATED: use -l instead]
#[arg(short = 'a', long, hide = true)]
all: bool,
/// Print help
#[arg(long, action = clap::ArgAction::Help)]
help: (),
},
/// Get friend details by username
Get {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Output in JSON format
#[arg(long)]
json: bool,
},
/// Send a friend request to a user
Add {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
},
/// Remove a friend or cancel outgoing friend request
Remove {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
},
/// Check friend status with a user
Status {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
},
}
#[derive(Subcommand)]
pub enum InviteAction {
/// Send an invite to a friend
Send {
/// User identifier (display name or user ID)
user: String,
/// Instance ID to invite to
instance_id: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Message slot (0-7)
#[arg(short = 'm', long)]
message_slot: Option<i32>,
},
/// Request an invite from a friend
Request {
/// User identifier (display name or user ID)
user: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Message slot (0-7)
#[arg(short = 'm', long)]
message_slot: Option<i32>,
/// Force traditional invite request (disable auto location join)
#[arg(long)]
force_request: bool,
},
}
#[derive(Subcommand)]
pub enum UsersAction {
/// Search users by display name
Search {
/// Search query (display name)
query: String,
/// Number of results to return
#[arg(short = 'n', long, default_value = "20")]
limit: i32,
/// Offset for pagination
#[arg(short, long, default_value = "0")]
offset: i32,
/// Developer type filter (none, internal)
#[arg(long)]
developer_type: Option<String>,
/// Output in JSON format
#[arg(long)]
json: bool,
/// Show detailed information
#[arg(short = 'l', long)]
long: bool,
},
/// Get user information by ID or display name
Get {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Output in JSON format
#[arg(long)]
json: bool,
/// Show detailed information
#[arg(short = 'l', long)]
long: bool,
},
/// Get user information by username
GetByName {
/// Username (not display name)
username: String,
/// Output in JSON format
#[arg(long)]
json: bool,
/// Show detailed information
#[arg(short = 'l', long)]
long: bool,
},
/// Note actions
Note {
#[command(subcommand)]
action: NoteAction,
},
/// List all notes
Notes {
/// Output in JSON format
#[arg(long)]
json: bool,
/// Show detailed information
#[arg(short = 'l', long)]
long: bool,
},
/// Feedback actions
Feedback {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Output in JSON format
#[arg(long)]
json: bool,
},
/// Diagnose user access issues
Diagnose {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
},
}
#[derive(Subcommand)]
pub enum WorldsAction {
/// Search worlds
Search {
/// Search query
query: String,
/// Number of results to return
#[arg(short = 'n', long, default_value = "20")]
limit: i32,
/// Offset for pagination
#[arg(short, long, default_value = "0")]
offset: i32,
/// Output in JSON format
#[arg(long)]
json: bool,
/// Show detailed information
#[arg(short = 'l', long)]
long: bool,
},
/// Get world information by ID
Get {
/// World ID
world_id: String,
/// Output in JSON format
#[arg(long)]
json: bool,
},
}
#[derive(Subcommand)]
pub enum NoteAction {
/// Get note for a user
Get {
/// User identifier (display name or user ID)
identifier: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
/// Output in JSON format
#[arg(long)]
json: bool,
},
/// Set note for a user
Set {
/// User identifier (display name or user ID)
identifier: String,
/// Note text
note: String,
/// Use direct user ID instead of resolving display name
#[arg(long)]
id: bool,
},
}