byterover-cli 2.1.4 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ import { Command } from '@oclif/core';
2
+ import { type AuthLogoutResponse } from '../../shared/transport/events/auth-events.js';
3
+ import { type DaemonClientOptions } from '../lib/daemon-client.js';
4
+ export default class Logout extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ format: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ };
10
+ protected performLogout(options?: DaemonClientOptions): Promise<AuthLogoutResponse>;
11
+ run(): Promise<void>;
12
+ }
@@ -0,0 +1,59 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { AuthEvents } from '../../shared/transport/events/auth-events.js';
3
+ import { formatConnectionError, withDaemonRetry } from '../lib/daemon-client.js';
4
+ import { writeJsonResponse } from '../lib/json-response.js';
5
+ export default class Logout extends Command {
6
+ static description = 'Disconnect from ByteRover cloud and clear stored credentials';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %>',
9
+ '',
10
+ '# JSON output (for automation)',
11
+ '<%= config.bin %> <%= command.id %> --format json',
12
+ ];
13
+ static flags = {
14
+ format: Flags.string({
15
+ default: 'text',
16
+ description: 'Output format (text or json)',
17
+ options: ['text', 'json'],
18
+ }),
19
+ };
20
+ async performLogout(options) {
21
+ return withDaemonRetry(async (client) => client.requestWithAck(AuthEvents.LOGOUT), options);
22
+ }
23
+ async run() {
24
+ const { flags } = await this.parse(Logout);
25
+ const format = flags.format ?? 'text';
26
+ try {
27
+ if (format === 'text') {
28
+ this.log('Logging out...');
29
+ }
30
+ const response = await this.performLogout();
31
+ if (response.success) {
32
+ if (format === 'json') {
33
+ writeJsonResponse({ command: 'logout', data: {}, success: true });
34
+ }
35
+ else {
36
+ this.log('Logged out successfully');
37
+ }
38
+ }
39
+ else {
40
+ const errorMessage = response.error ?? 'Logout failed';
41
+ if (format === 'json') {
42
+ writeJsonResponse({ command: 'logout', data: { error: errorMessage }, success: false });
43
+ }
44
+ else {
45
+ this.log(errorMessage);
46
+ }
47
+ }
48
+ }
49
+ catch (error) {
50
+ const errorMessage = error instanceof Error ? error.message : 'Logout failed';
51
+ if (format === 'json') {
52
+ writeJsonResponse({ command: 'logout', data: { error: errorMessage }, success: false });
53
+ }
54
+ else {
55
+ this.log(formatConnectionError(error));
56
+ }
57
+ }
58
+ }
59
+ }
@@ -33,6 +33,7 @@ export interface AuthLoginWithApiKeyResponse {
33
33
  userEmail?: string;
34
34
  }
35
35
  export interface AuthLogoutResponse {
36
+ error?: string;
36
37
  success: boolean;
37
38
  }
38
39
  export interface AuthRefreshResponse {
@@ -124,6 +124,46 @@
124
124
  "login.js"
125
125
  ]
126
126
  },
127
+ "logout": {
128
+ "aliases": [],
129
+ "args": {},
130
+ "description": "Disconnect from ByteRover cloud and clear stored credentials",
131
+ "examples": [
132
+ "<%= config.bin %> <%= command.id %>",
133
+ "",
134
+ "# JSON output (for automation)",
135
+ "<%= config.bin %> <%= command.id %> --format json"
136
+ ],
137
+ "flags": {
138
+ "format": {
139
+ "description": "Output format (text or json)",
140
+ "name": "format",
141
+ "default": "text",
142
+ "hasDynamicHelp": false,
143
+ "multiple": false,
144
+ "options": [
145
+ "text",
146
+ "json"
147
+ ],
148
+ "type": "option"
149
+ }
150
+ },
151
+ "hasDynamicHelp": false,
152
+ "hiddenAliases": [],
153
+ "id": "logout",
154
+ "pluginAlias": "byterover-cli",
155
+ "pluginName": "byterover-cli",
156
+ "pluginType": "core",
157
+ "strict": true,
158
+ "enableJsonFlag": false,
159
+ "isESM": true,
160
+ "relativePath": [
161
+ "dist",
162
+ "oclif",
163
+ "commands",
164
+ "logout.js"
165
+ ]
166
+ },
127
167
  "main": {
128
168
  "aliases": [],
129
169
  "args": {},
@@ -997,104 +1037,6 @@
997
1037
  "switch.js"
998
1038
  ]
999
1039
  },
1000
- "space:list": {
1001
- "aliases": [],
1002
- "args": {},
1003
- "description": "List all teams and spaces",
1004
- "examples": [
1005
- "<%= config.bin %> space list",
1006
- "<%= config.bin %> space list --format json"
1007
- ],
1008
- "flags": {
1009
- "format": {
1010
- "char": "f",
1011
- "description": "Output format",
1012
- "name": "format",
1013
- "default": "text",
1014
- "hasDynamicHelp": false,
1015
- "multiple": false,
1016
- "options": [
1017
- "text",
1018
- "json"
1019
- ],
1020
- "type": "option"
1021
- }
1022
- },
1023
- "hasDynamicHelp": false,
1024
- "hiddenAliases": [],
1025
- "id": "space:list",
1026
- "pluginAlias": "byterover-cli",
1027
- "pluginName": "byterover-cli",
1028
- "pluginType": "core",
1029
- "strict": true,
1030
- "enableJsonFlag": false,
1031
- "isESM": true,
1032
- "relativePath": [
1033
- "dist",
1034
- "oclif",
1035
- "commands",
1036
- "space",
1037
- "list.js"
1038
- ]
1039
- },
1040
- "space:switch": {
1041
- "aliases": [],
1042
- "args": {},
1043
- "description": "Switch to a different space",
1044
- "examples": [
1045
- "<%= config.bin %> space switch --team acme --name my-space",
1046
- "<%= config.bin %> space switch --team acme --name my-space --format json"
1047
- ],
1048
- "flags": {
1049
- "format": {
1050
- "char": "f",
1051
- "description": "Output format",
1052
- "name": "format",
1053
- "default": "text",
1054
- "hasDynamicHelp": false,
1055
- "multiple": false,
1056
- "options": [
1057
- "text",
1058
- "json"
1059
- ],
1060
- "type": "option"
1061
- },
1062
- "name": {
1063
- "char": "n",
1064
- "description": "Name of the space to switch to",
1065
- "name": "name",
1066
- "required": true,
1067
- "hasDynamicHelp": false,
1068
- "multiple": false,
1069
- "type": "option"
1070
- },
1071
- "team": {
1072
- "char": "t",
1073
- "description": "Team name",
1074
- "name": "team",
1075
- "required": true,
1076
- "hasDynamicHelp": false,
1077
- "multiple": false,
1078
- "type": "option"
1079
- }
1080
- },
1081
- "hasDynamicHelp": false,
1082
- "hiddenAliases": [],
1083
- "id": "space:switch",
1084
- "pluginAlias": "byterover-cli",
1085
- "pluginName": "byterover-cli",
1086
- "pluginType": "core",
1087
- "strict": true,
1088
- "enableJsonFlag": false,
1089
- "isESM": true,
1090
- "relativePath": [
1091
- "dist",
1092
- "oclif",
1093
- "commands",
1094
- "space",
1095
- "switch.js"
1096
- ]
1097
- },
1098
1040
  "providers:connect": {
1099
1041
  "aliases": [],
1100
1042
  "args": {
@@ -1335,6 +1277,104 @@
1335
1277
  "switch.js"
1336
1278
  ]
1337
1279
  },
1280
+ "space:list": {
1281
+ "aliases": [],
1282
+ "args": {},
1283
+ "description": "List all teams and spaces",
1284
+ "examples": [
1285
+ "<%= config.bin %> space list",
1286
+ "<%= config.bin %> space list --format json"
1287
+ ],
1288
+ "flags": {
1289
+ "format": {
1290
+ "char": "f",
1291
+ "description": "Output format",
1292
+ "name": "format",
1293
+ "default": "text",
1294
+ "hasDynamicHelp": false,
1295
+ "multiple": false,
1296
+ "options": [
1297
+ "text",
1298
+ "json"
1299
+ ],
1300
+ "type": "option"
1301
+ }
1302
+ },
1303
+ "hasDynamicHelp": false,
1304
+ "hiddenAliases": [],
1305
+ "id": "space:list",
1306
+ "pluginAlias": "byterover-cli",
1307
+ "pluginName": "byterover-cli",
1308
+ "pluginType": "core",
1309
+ "strict": true,
1310
+ "enableJsonFlag": false,
1311
+ "isESM": true,
1312
+ "relativePath": [
1313
+ "dist",
1314
+ "oclif",
1315
+ "commands",
1316
+ "space",
1317
+ "list.js"
1318
+ ]
1319
+ },
1320
+ "space:switch": {
1321
+ "aliases": [],
1322
+ "args": {},
1323
+ "description": "Switch to a different space",
1324
+ "examples": [
1325
+ "<%= config.bin %> space switch --team acme --name my-space",
1326
+ "<%= config.bin %> space switch --team acme --name my-space --format json"
1327
+ ],
1328
+ "flags": {
1329
+ "format": {
1330
+ "char": "f",
1331
+ "description": "Output format",
1332
+ "name": "format",
1333
+ "default": "text",
1334
+ "hasDynamicHelp": false,
1335
+ "multiple": false,
1336
+ "options": [
1337
+ "text",
1338
+ "json"
1339
+ ],
1340
+ "type": "option"
1341
+ },
1342
+ "name": {
1343
+ "char": "n",
1344
+ "description": "Name of the space to switch to",
1345
+ "name": "name",
1346
+ "required": true,
1347
+ "hasDynamicHelp": false,
1348
+ "multiple": false,
1349
+ "type": "option"
1350
+ },
1351
+ "team": {
1352
+ "char": "t",
1353
+ "description": "Team name",
1354
+ "name": "team",
1355
+ "required": true,
1356
+ "hasDynamicHelp": false,
1357
+ "multiple": false,
1358
+ "type": "option"
1359
+ }
1360
+ },
1361
+ "hasDynamicHelp": false,
1362
+ "hiddenAliases": [],
1363
+ "id": "space:switch",
1364
+ "pluginAlias": "byterover-cli",
1365
+ "pluginName": "byterover-cli",
1366
+ "pluginType": "core",
1367
+ "strict": true,
1368
+ "enableJsonFlag": false,
1369
+ "isESM": true,
1370
+ "relativePath": [
1371
+ "dist",
1372
+ "oclif",
1373
+ "commands",
1374
+ "space",
1375
+ "switch.js"
1376
+ ]
1377
+ },
1338
1378
  "hub:registry:add": {
1339
1379
  "aliases": [],
1340
1380
  "args": {
@@ -1534,5 +1574,5 @@
1534
1574
  ]
1535
1575
  }
1536
1576
  },
1537
- "version": "2.1.4"
1577
+ "version": "2.1.5"
1538
1578
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "byterover-cli",
3
3
  "description": "ByteRover's CLI",
4
- "version": "2.1.4",
4
+ "version": "2.1.5",
5
5
  "author": "ByteRover",
6
6
  "bin": {
7
7
  "brv": "./bin/run.js"