@bytevion/cli 0.2.0 → 0.4.0

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.
Files changed (61) hide show
  1. package/dist/base.js +8 -1
  2. package/dist/commands/opt/preset.js +8 -5
  3. package/dist/commands/opt/show.js +20 -6
  4. package/dist/commands/providers/add.js +10 -2
  5. package/dist/commands/run.js +1 -1
  6. package/dist/commands/setup.d.ts +1 -0
  7. package/dist/commands/setup.js +210 -39
  8. package/dist/commands/usage.js +32 -8
  9. package/dist/hooks/init/home.js +41 -5
  10. package/dist/lib/api.d.ts +1 -0
  11. package/dist/lib/api.js +6 -0
  12. package/dist/lib/friendly.d.ts +8 -0
  13. package/dist/lib/friendly.js +86 -0
  14. package/dist/lib/home.d.ts +16 -0
  15. package/dist/lib/home.js +97 -0
  16. package/dist/lib/output.d.ts +3 -0
  17. package/dist/lib/output.js +43 -0
  18. package/dist/lib/presets.d.ts +9 -0
  19. package/dist/lib/presets.js +40 -0
  20. package/dist/lib/tui.d.ts +105 -0
  21. package/dist/lib/tui.gate.test.d.ts +1 -0
  22. package/dist/lib/tui.gate.test.js +96 -0
  23. package/dist/lib/tui.js +62 -0
  24. package/dist/lib/ui.js +13 -1
  25. package/dist/tui/__tests__/home.render.test.d.ts +1 -0
  26. package/dist/tui/__tests__/home.render.test.js +59 -0
  27. package/dist/tui/__tests__/state.test.d.ts +1 -0
  28. package/dist/tui/__tests__/state.test.js +88 -0
  29. package/dist/tui/components/App.d.ts +7 -0
  30. package/dist/tui/components/App.js +129 -0
  31. package/dist/tui/components/Brand.d.ts +9 -0
  32. package/dist/tui/components/Brand.js +13 -0
  33. package/dist/tui/components/Card.d.ts +11 -0
  34. package/dist/tui/components/Card.js +12 -0
  35. package/dist/tui/components/DoneScreen.d.ts +11 -0
  36. package/dist/tui/components/DoneScreen.js +30 -0
  37. package/dist/tui/components/Home.d.ts +12 -0
  38. package/dist/tui/components/Home.js +144 -0
  39. package/dist/tui/components/KeyStep.d.ts +13 -0
  40. package/dist/tui/components/KeyStep.js +44 -0
  41. package/dist/tui/components/Panel.d.ts +11 -0
  42. package/dist/tui/components/Panel.js +12 -0
  43. package/dist/tui/components/Picker.d.ts +19 -0
  44. package/dist/tui/components/Picker.js +68 -0
  45. package/dist/tui/components/PresetStep.d.ts +12 -0
  46. package/dist/tui/components/PresetStep.js +26 -0
  47. package/dist/tui/components/ProviderStep.d.ts +20 -0
  48. package/dist/tui/components/ProviderStep.js +159 -0
  49. package/dist/tui/components/Stepper.d.ts +9 -0
  50. package/dist/tui/components/Stepper.js +29 -0
  51. package/dist/tui/contract.d.ts +99 -0
  52. package/dist/tui/contract.js +5 -0
  53. package/dist/tui/index.d.ts +3 -0
  54. package/dist/tui/index.js +78 -0
  55. package/dist/tui/package.json +1 -0
  56. package/dist/tui/state.d.ts +77 -0
  57. package/dist/tui/state.js +84 -0
  58. package/dist/tui/theme.d.ts +23 -0
  59. package/dist/tui/theme.js +49 -0
  60. package/oclif.manifest.json +152 -150
  61. package/package.json +13 -3
@@ -0,0 +1,84 @@
1
+ // Pure wizard state machine. No react, no ink, no Date.now / Math.random — every transition
2
+ // is a deterministic function of (state, action) so the whole flow is unit-testable without a
3
+ // terminal. The App component owns the side effects (calling ports) and dispatches results
4
+ // back in here. Errors are NON-FATAL: an ERROR action records what broke and keeps the current
5
+ // step mounted so the user can retry, never unwinding the wizard.
6
+ export const STEPS = ['welcome', 'signin', 'provider', 'model', 'key', 'preset', 'integrate', 'done'];
7
+ export function initialState(initial) {
8
+ return {
9
+ step: 'welcome',
10
+ busy: false,
11
+ signedIn: initial.signedIn,
12
+ email: initial.email,
13
+ providerStatus: 'pending',
14
+ models: [],
15
+ preset: 'maximum',
16
+ byteKey: initial.byteKey,
17
+ byteKeyRevealed: false,
18
+ };
19
+ }
20
+ function advance(step) {
21
+ const i = STEPS.indexOf(step);
22
+ return i >= 0 && i < STEPS.length - 1 ? STEPS[i + 1] : step;
23
+ }
24
+ export function reducer(state, action) {
25
+ switch (action.type) {
26
+ case 'BUSY':
27
+ return { ...state, busy: action.busy };
28
+ // Non-fatal: surface the message, drop the busy flag, stay on the same step.
29
+ case 'ERROR':
30
+ return { ...state, busy: false, error: { from: action.from, message: action.message } };
31
+ case 'CLEAR_ERROR':
32
+ return { ...state, error: undefined };
33
+ case 'NEXT':
34
+ return { ...state, step: advance(state.step), error: undefined };
35
+ case 'GOTO':
36
+ return { ...state, step: action.step, error: undefined };
37
+ case 'SIGNED_IN':
38
+ return { ...state, busy: false, signedIn: true, email: action.email ?? state.email, error: undefined, step: 'provider' };
39
+ case 'PICK_PROVIDER':
40
+ return { ...state, providerChoice: action.id, baseUrl: action.baseUrl, error: undefined };
41
+ case 'PROVIDER_RESULT': {
42
+ const models = action.models ?? [];
43
+ // Connected with models → go pick one. Saved/connected without models → skip the model
44
+ // step and move on; the summary will say "saved" so we never over-claim success.
45
+ const next = action.status === 'connected' && models.length ? 'model' : 'key';
46
+ return {
47
+ ...state,
48
+ busy: false,
49
+ error: undefined,
50
+ providerStatus: action.status,
51
+ models,
52
+ connId: action.connId,
53
+ step: next,
54
+ };
55
+ }
56
+ case 'PROVIDER_SKIP':
57
+ return { ...state, busy: false, error: undefined, providerStatus: 'skipped', models: [], step: 'key' };
58
+ // Stay on the provider step so the key entry remounts for another attempt.
59
+ case 'PROVIDER_RETRY':
60
+ return { ...state, busy: false, error: undefined, providerStatus: 'pending', step: 'provider' };
61
+ case 'PICK_MODEL':
62
+ return { ...state, model: action.model, error: undefined, step: 'key' };
63
+ case 'KEY_CREATED':
64
+ return { ...state, busy: false, byteKey: action.key, byteKeyRevealed: true, error: undefined };
65
+ case 'REVEAL_KEY':
66
+ return { ...state, byteKeyRevealed: true };
67
+ case 'PICK_PRESET':
68
+ return { ...state, preset: action.preset, error: undefined, step: 'integrate' };
69
+ case 'PICK_CONNECT':
70
+ return { ...state, connect: action.connect, error: undefined, step: 'done' };
71
+ default:
72
+ return state;
73
+ }
74
+ }
75
+ export function selectSummary(state) {
76
+ const provider = state.providerStatus === 'pending' ? 'skipped' : state.providerStatus;
77
+ return {
78
+ model: state.model,
79
+ provider,
80
+ preset: state.preset,
81
+ byteKeyCreated: Boolean(state.byteKey),
82
+ connect: state.connect && state.connect !== 'skip' ? state.connect : undefined,
83
+ };
84
+ }
@@ -0,0 +1,23 @@
1
+ export declare function hex(t: number): string;
2
+ export declare function gradient(count: number): string[];
3
+ export interface Glyphs {
4
+ filled: string;
5
+ check: string;
6
+ empty: string;
7
+ arrow: string;
8
+ bullet: string;
9
+ border: 'round' | 'classic';
10
+ spark: string[];
11
+ brand: string[];
12
+ divider: string;
13
+ }
14
+ export declare function glyphs(ascii: boolean): Glyphs;
15
+ export interface Tone {
16
+ accent: string | undefined;
17
+ ok: string | undefined;
18
+ warn: string | undefined;
19
+ bad: string | undefined;
20
+ muted: string | undefined;
21
+ brandMid: string | undefined;
22
+ }
23
+ export declare function tones(plainColor: boolean): Tone;
@@ -0,0 +1,49 @@
1
+ // Byte's terminal palette. The signature is a cyan→blue per-character gradient (no library
2
+ // does true gradients in a terminal, so we interpolate the RGB ramp ourselves and hand Ink a
3
+ // hex per glyph). Everything degrades cleanly: under plainColor the colors collapse to a
4
+ // single accent, under ascii the unicode glyph sets swap for 7-bit equivalents.
5
+ const A = [0x22, 0xd3, 0xee]; // cyan-300 #22d3ee
6
+ const B = [0x3b, 0x82, 0xf6]; // blue-500 #3b82f6
7
+ // Interpolate a single channel/color t∈[0,1] across the cyan→blue ramp → "#rrggbb".
8
+ export function hex(t) {
9
+ const clamped = t < 0 ? 0 : t > 1 ? 1 : t;
10
+ return ('#' +
11
+ A.map((a, i) => Math.round(a + (B[i] - a) * clamped).toString(16).padStart(2, '0')).join(''));
12
+ }
13
+ // Spread N glyphs evenly across the gradient. A single glyph sits at the cyan end.
14
+ export function gradient(count) {
15
+ if (count <= 1)
16
+ return [hex(0)];
17
+ return Array.from({ length: count }, (_, i) => hex(i / (count - 1)));
18
+ }
19
+ const UNICODE = {
20
+ filled: '●',
21
+ check: '✓',
22
+ empty: '○',
23
+ arrow: '›',
24
+ bullet: '•',
25
+ border: 'round',
26
+ spark: ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'],
27
+ brand: ['›', 'b', '_'],
28
+ divider: '─',
29
+ };
30
+ const ASCII = {
31
+ filled: '[*]',
32
+ check: '[x]',
33
+ empty: '[ ]',
34
+ arrow: '>',
35
+ bullet: '-',
36
+ border: 'classic',
37
+ spark: ['.', ':', '-', '=', '+', '*', '#'],
38
+ brand: ['>', 'b', '_'],
39
+ divider: '-',
40
+ };
41
+ export function glyphs(ascii) {
42
+ return ascii ? ASCII : UNICODE;
43
+ }
44
+ export function tones(plainColor) {
45
+ if (plainColor) {
46
+ return { accent: undefined, ok: undefined, warn: undefined, bad: undefined, muted: 'gray', brandMid: undefined };
47
+ }
48
+ return { accent: 'cyan', ok: 'green', warn: 'yellow', bad: 'red', muted: 'gray', brandMid: hex(0.5) };
49
+ }
@@ -514,9 +514,9 @@
514
514
  "type": "option"
515
515
  },
516
516
  "model": {
517
- "description": "Model or Byte alias",
517
+ "description": "Model or Byte alias (default: auto — routes to your enabled model)",
518
518
  "name": "model",
519
- "default": "byte-default",
519
+ "default": "auto",
520
520
  "hasDynamicHelp": false,
521
521
  "multiple": false,
522
522
  "type": "option"
@@ -609,12 +609,13 @@
609
609
  "type": "option"
610
610
  },
611
611
  "preset": {
612
- "description": "Optimization preset",
612
+ "description": "Optimization mode",
613
613
  "name": "preset",
614
- "default": "balanced",
614
+ "default": "maximum",
615
615
  "hasDynamicHelp": false,
616
616
  "multiple": false,
617
617
  "options": [
618
+ "maximum",
618
619
  "balanced",
619
620
  "max_savings",
620
621
  "lowest_latency",
@@ -1198,10 +1199,14 @@
1198
1199
  "rotate.js"
1199
1200
  ]
1200
1201
  },
1201
- "sessions": {
1202
+ "providers:add": {
1202
1203
  "aliases": [],
1203
1204
  "args": {},
1204
- "description": "List active terminal sessions (CLI tokens) for the org.",
1205
+ "description": "Connect an upstream provider key (BYOK). Byte stores it encrypted and imports models.",
1206
+ "examples": [
1207
+ "<%= config.bin %> providers add --provider deepseek --api-key sk-...",
1208
+ "<%= config.bin %> providers add --provider custom --provider-base-url https://api.example.com/v1 --api-key ..."
1209
+ ],
1205
1210
  "flags": {
1206
1211
  "json": {
1207
1212
  "description": "Format output as json.",
@@ -1225,11 +1230,53 @@
1225
1230
  "hasDynamicHelp": false,
1226
1231
  "multiple": false,
1227
1232
  "type": "option"
1233
+ },
1234
+ "provider": {
1235
+ "description": "Provider preset id (openai, deepseek, anthropic, …)",
1236
+ "name": "provider",
1237
+ "hasDynamicHelp": false,
1238
+ "multiple": false,
1239
+ "type": "option"
1240
+ },
1241
+ "api-key": {
1242
+ "description": "Upstream provider API key",
1243
+ "env": "BYTE_PROVIDER_KEY",
1244
+ "name": "api-key",
1245
+ "hasDynamicHelp": false,
1246
+ "multiple": false,
1247
+ "type": "option"
1248
+ },
1249
+ "provider-base-url": {
1250
+ "description": "Custom base URL (for --provider custom or to override)",
1251
+ "name": "provider-base-url",
1252
+ "hasDynamicHelp": false,
1253
+ "multiple": false,
1254
+ "type": "option"
1255
+ },
1256
+ "mode": {
1257
+ "description": "Gateway mode (byte_compatible/byte_messages/byte_generative)",
1258
+ "name": "mode",
1259
+ "hasDynamicHelp": false,
1260
+ "multiple": false,
1261
+ "type": "option"
1262
+ },
1263
+ "label": {
1264
+ "description": "Label for this connection",
1265
+ "name": "label",
1266
+ "hasDynamicHelp": false,
1267
+ "multiple": false,
1268
+ "type": "option"
1269
+ },
1270
+ "no-fetch": {
1271
+ "description": "Skip auto-importing the model list",
1272
+ "name": "no-fetch",
1273
+ "allowNo": false,
1274
+ "type": "boolean"
1228
1275
  }
1229
1276
  },
1230
1277
  "hasDynamicHelp": false,
1231
1278
  "hiddenAliases": [],
1232
- "id": "sessions",
1279
+ "id": "providers:add",
1233
1280
  "pluginAlias": "@bytevion/cli",
1234
1281
  "pluginName": "@bytevion/cli",
1235
1282
  "pluginType": "core",
@@ -1239,20 +1286,14 @@
1239
1286
  "relativePath": [
1240
1287
  "dist",
1241
1288
  "commands",
1242
- "sessions",
1243
- "index.js"
1289
+ "providers",
1290
+ "add.js"
1244
1291
  ]
1245
1292
  },
1246
- "sessions:revoke": {
1293
+ "providers:list": {
1247
1294
  "aliases": [],
1248
- "args": {
1249
- "id": {
1250
- "description": "Session id (see `byte sessions`)",
1251
- "name": "id",
1252
- "required": true
1253
- }
1254
- },
1255
- "description": "Revoke a terminal session (CLI token) by id.",
1295
+ "args": {},
1296
+ "description": "List upstream provider connections for the current org.",
1256
1297
  "flags": {
1257
1298
  "json": {
1258
1299
  "description": "Format output as json.",
@@ -1280,7 +1321,7 @@
1280
1321
  },
1281
1322
  "hasDynamicHelp": false,
1282
1323
  "hiddenAliases": [],
1283
- "id": "sessions:revoke",
1324
+ "id": "providers:list",
1284
1325
  "pluginAlias": "@bytevion/cli",
1285
1326
  "pluginName": "@bytevion/cli",
1286
1327
  "pluginType": "core",
@@ -1290,26 +1331,20 @@
1290
1331
  "relativePath": [
1291
1332
  "dist",
1292
1333
  "commands",
1293
- "sessions",
1294
- "revoke.js"
1334
+ "providers",
1335
+ "list.js"
1295
1336
  ]
1296
1337
  },
1297
- "opt:preset": {
1338
+ "providers:rotate": {
1298
1339
  "aliases": [],
1299
1340
  "args": {
1300
- "preset": {
1301
- "description": "Preset to apply",
1302
- "name": "preset",
1303
- "options": [
1304
- "balanced",
1305
- "max_savings",
1306
- "lowest_latency",
1307
- "reliability_first"
1308
- ],
1341
+ "id": {
1342
+ "description": "Connection id (see `byte providers list`)",
1343
+ "name": "id",
1309
1344
  "required": true
1310
1345
  }
1311
1346
  },
1312
- "description": "Apply an optimization preset for the whole org.",
1347
+ "description": "Replace the upstream API key on a provider connection (keeps imported models).",
1313
1348
  "flags": {
1314
1349
  "json": {
1315
1350
  "description": "Format output as json.",
@@ -1333,11 +1368,19 @@
1333
1368
  "hasDynamicHelp": false,
1334
1369
  "multiple": false,
1335
1370
  "type": "option"
1371
+ },
1372
+ "api-key": {
1373
+ "description": "New upstream provider API key",
1374
+ "env": "BYTE_PROVIDER_KEY",
1375
+ "name": "api-key",
1376
+ "hasDynamicHelp": false,
1377
+ "multiple": false,
1378
+ "type": "option"
1336
1379
  }
1337
1380
  },
1338
1381
  "hasDynamicHelp": false,
1339
1382
  "hiddenAliases": [],
1340
- "id": "opt:preset",
1383
+ "id": "providers:rotate",
1341
1384
  "pluginAlias": "@bytevion/cli",
1342
1385
  "pluginName": "@bytevion/cli",
1343
1386
  "pluginType": "core",
@@ -1347,35 +1390,20 @@
1347
1390
  "relativePath": [
1348
1391
  "dist",
1349
1392
  "commands",
1350
- "opt",
1351
- "preset.js"
1393
+ "providers",
1394
+ "rotate.js"
1352
1395
  ]
1353
1396
  },
1354
- "opt:set": {
1397
+ "providers:test": {
1355
1398
  "aliases": [],
1356
1399
  "args": {
1357
- "flag": {
1358
- "description": "Optimization field name",
1359
- "name": "flag",
1360
- "required": true
1361
- },
1362
- "value": {
1363
- "description": "on or off",
1364
- "name": "value",
1365
- "options": [
1366
- "on",
1367
- "off",
1368
- "true",
1369
- "false"
1370
- ],
1400
+ "id": {
1401
+ "description": "Connection id (see `byte providers list`)",
1402
+ "name": "id",
1371
1403
  "required": true
1372
1404
  }
1373
1405
  },
1374
- "description": "Toggle a single optimization layer on or off. See field names with `byte opt show --json`.",
1375
- "examples": [
1376
- "<%= config.bin %> opt set compression_enabled off",
1377
- "<%= config.bin %> opt set response_cache_enabled on"
1378
- ],
1406
+ "description": "Verify a provider connection by re-fetching its model list.",
1379
1407
  "flags": {
1380
1408
  "json": {
1381
1409
  "description": "Format output as json.",
@@ -1403,7 +1431,7 @@
1403
1431
  },
1404
1432
  "hasDynamicHelp": false,
1405
1433
  "hiddenAliases": [],
1406
- "id": "opt:set",
1434
+ "id": "providers:test",
1407
1435
  "pluginAlias": "@bytevion/cli",
1408
1436
  "pluginName": "@bytevion/cli",
1409
1437
  "pluginType": "core",
@@ -1413,14 +1441,14 @@
1413
1441
  "relativePath": [
1414
1442
  "dist",
1415
1443
  "commands",
1416
- "opt",
1417
- "set.js"
1444
+ "providers",
1445
+ "test.js"
1418
1446
  ]
1419
1447
  },
1420
- "opt:show": {
1448
+ "sessions": {
1421
1449
  "aliases": [],
1422
1450
  "args": {},
1423
- "description": "Show the current optimization preset and layer states for the org.",
1451
+ "description": "List active terminal sessions (CLI tokens) for the org.",
1424
1452
  "flags": {
1425
1453
  "json": {
1426
1454
  "description": "Format output as json.",
@@ -1448,7 +1476,7 @@
1448
1476
  },
1449
1477
  "hasDynamicHelp": false,
1450
1478
  "hiddenAliases": [],
1451
- "id": "opt:show",
1479
+ "id": "sessions",
1452
1480
  "pluginAlias": "@bytevion/cli",
1453
1481
  "pluginName": "@bytevion/cli",
1454
1482
  "pluginType": "core",
@@ -1458,18 +1486,20 @@
1458
1486
  "relativePath": [
1459
1487
  "dist",
1460
1488
  "commands",
1461
- "opt",
1462
- "show.js"
1489
+ "sessions",
1490
+ "index.js"
1463
1491
  ]
1464
1492
  },
1465
- "providers:add": {
1493
+ "sessions:revoke": {
1466
1494
  "aliases": [],
1467
- "args": {},
1468
- "description": "Connect an upstream provider key (BYOK). Byte stores it encrypted and imports models.",
1469
- "examples": [
1470
- "<%= config.bin %> providers add --provider deepseek --api-key sk-...",
1471
- "<%= config.bin %> providers add --provider custom --provider-base-url https://api.example.com/v1 --api-key ..."
1472
- ],
1495
+ "args": {
1496
+ "id": {
1497
+ "description": "Session id (see `byte sessions`)",
1498
+ "name": "id",
1499
+ "required": true
1500
+ }
1501
+ },
1502
+ "description": "Revoke a terminal session (CLI token) by id.",
1473
1503
  "flags": {
1474
1504
  "json": {
1475
1505
  "description": "Format output as json.",
@@ -1493,53 +1523,11 @@
1493
1523
  "hasDynamicHelp": false,
1494
1524
  "multiple": false,
1495
1525
  "type": "option"
1496
- },
1497
- "provider": {
1498
- "description": "Provider preset id (openai, deepseek, anthropic, …)",
1499
- "name": "provider",
1500
- "hasDynamicHelp": false,
1501
- "multiple": false,
1502
- "type": "option"
1503
- },
1504
- "api-key": {
1505
- "description": "Upstream provider API key",
1506
- "env": "BYTE_PROVIDER_KEY",
1507
- "name": "api-key",
1508
- "hasDynamicHelp": false,
1509
- "multiple": false,
1510
- "type": "option"
1511
- },
1512
- "provider-base-url": {
1513
- "description": "Custom base URL (for --provider custom or to override)",
1514
- "name": "provider-base-url",
1515
- "hasDynamicHelp": false,
1516
- "multiple": false,
1517
- "type": "option"
1518
- },
1519
- "mode": {
1520
- "description": "Gateway mode (byte_compatible/byte_messages/byte_generative)",
1521
- "name": "mode",
1522
- "hasDynamicHelp": false,
1523
- "multiple": false,
1524
- "type": "option"
1525
- },
1526
- "label": {
1527
- "description": "Label for this connection",
1528
- "name": "label",
1529
- "hasDynamicHelp": false,
1530
- "multiple": false,
1531
- "type": "option"
1532
- },
1533
- "no-fetch": {
1534
- "description": "Skip auto-importing the model list",
1535
- "name": "no-fetch",
1536
- "allowNo": false,
1537
- "type": "boolean"
1538
1526
  }
1539
1527
  },
1540
1528
  "hasDynamicHelp": false,
1541
1529
  "hiddenAliases": [],
1542
- "id": "providers:add",
1530
+ "id": "sessions:revoke",
1543
1531
  "pluginAlias": "@bytevion/cli",
1544
1532
  "pluginName": "@bytevion/cli",
1545
1533
  "pluginType": "core",
@@ -1549,14 +1537,27 @@
1549
1537
  "relativePath": [
1550
1538
  "dist",
1551
1539
  "commands",
1552
- "providers",
1553
- "add.js"
1540
+ "sessions",
1541
+ "revoke.js"
1554
1542
  ]
1555
1543
  },
1556
- "providers:list": {
1544
+ "opt:preset": {
1557
1545
  "aliases": [],
1558
- "args": {},
1559
- "description": "List upstream provider connections for the current org.",
1546
+ "args": {
1547
+ "preset": {
1548
+ "description": "Mode to apply",
1549
+ "name": "preset",
1550
+ "options": [
1551
+ "maximum",
1552
+ "max_savings",
1553
+ "balanced",
1554
+ "lowest_latency",
1555
+ "reliability_first"
1556
+ ],
1557
+ "required": true
1558
+ }
1559
+ },
1560
+ "description": "Apply an optimization mode for the whole org (maximum, balanced, max_savings, lowest_latency, reliability_first).",
1560
1561
  "flags": {
1561
1562
  "json": {
1562
1563
  "description": "Format output as json.",
@@ -1584,7 +1585,7 @@
1584
1585
  },
1585
1586
  "hasDynamicHelp": false,
1586
1587
  "hiddenAliases": [],
1587
- "id": "providers:list",
1588
+ "id": "opt:preset",
1588
1589
  "pluginAlias": "@bytevion/cli",
1589
1590
  "pluginName": "@bytevion/cli",
1590
1591
  "pluginType": "core",
@@ -1594,20 +1595,35 @@
1594
1595
  "relativePath": [
1595
1596
  "dist",
1596
1597
  "commands",
1597
- "providers",
1598
- "list.js"
1598
+ "opt",
1599
+ "preset.js"
1599
1600
  ]
1600
1601
  },
1601
- "providers:rotate": {
1602
+ "opt:set": {
1602
1603
  "aliases": [],
1603
1604
  "args": {
1604
- "id": {
1605
- "description": "Connection id (see `byte providers list`)",
1606
- "name": "id",
1605
+ "flag": {
1606
+ "description": "Optimization field name",
1607
+ "name": "flag",
1608
+ "required": true
1609
+ },
1610
+ "value": {
1611
+ "description": "on or off",
1612
+ "name": "value",
1613
+ "options": [
1614
+ "on",
1615
+ "off",
1616
+ "true",
1617
+ "false"
1618
+ ],
1607
1619
  "required": true
1608
1620
  }
1609
1621
  },
1610
- "description": "Replace the upstream API key on a provider connection (keeps imported models).",
1622
+ "description": "Toggle a single optimization layer on or off. See field names with `byte opt show --json`.",
1623
+ "examples": [
1624
+ "<%= config.bin %> opt set compression_enabled off",
1625
+ "<%= config.bin %> opt set response_cache_enabled on"
1626
+ ],
1611
1627
  "flags": {
1612
1628
  "json": {
1613
1629
  "description": "Format output as json.",
@@ -1631,19 +1647,11 @@
1631
1647
  "hasDynamicHelp": false,
1632
1648
  "multiple": false,
1633
1649
  "type": "option"
1634
- },
1635
- "api-key": {
1636
- "description": "New upstream provider API key",
1637
- "env": "BYTE_PROVIDER_KEY",
1638
- "name": "api-key",
1639
- "hasDynamicHelp": false,
1640
- "multiple": false,
1641
- "type": "option"
1642
1650
  }
1643
1651
  },
1644
1652
  "hasDynamicHelp": false,
1645
1653
  "hiddenAliases": [],
1646
- "id": "providers:rotate",
1654
+ "id": "opt:set",
1647
1655
  "pluginAlias": "@bytevion/cli",
1648
1656
  "pluginName": "@bytevion/cli",
1649
1657
  "pluginType": "core",
@@ -1653,20 +1661,14 @@
1653
1661
  "relativePath": [
1654
1662
  "dist",
1655
1663
  "commands",
1656
- "providers",
1657
- "rotate.js"
1664
+ "opt",
1665
+ "set.js"
1658
1666
  ]
1659
1667
  },
1660
- "providers:test": {
1668
+ "opt:show": {
1661
1669
  "aliases": [],
1662
- "args": {
1663
- "id": {
1664
- "description": "Connection id (see `byte providers list`)",
1665
- "name": "id",
1666
- "required": true
1667
- }
1668
- },
1669
- "description": "Verify a provider connection by re-fetching its model list.",
1670
+ "args": {},
1671
+ "description": "Show the current optimization mode and every layer running on your requests.",
1670
1672
  "flags": {
1671
1673
  "json": {
1672
1674
  "description": "Format output as json.",
@@ -1694,7 +1696,7 @@
1694
1696
  },
1695
1697
  "hasDynamicHelp": false,
1696
1698
  "hiddenAliases": [],
1697
- "id": "providers:test",
1699
+ "id": "opt:show",
1698
1700
  "pluginAlias": "@bytevion/cli",
1699
1701
  "pluginName": "@bytevion/cli",
1700
1702
  "pluginType": "core",
@@ -1704,10 +1706,10 @@
1704
1706
  "relativePath": [
1705
1707
  "dist",
1706
1708
  "commands",
1707
- "providers",
1708
- "test.js"
1709
+ "opt",
1710
+ "show.js"
1709
1711
  ]
1710
1712
  }
1711
1713
  },
1712
- "version": "0.2.0"
1714
+ "version": "0.4.0"
1713
1715
  }