@bytevion/cli 0.4.0 → 0.4.1

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,58 @@
1
+ #!/usr/bin/env node
2
+ // Friendly, best-effort post-install notice. It must NEVER fail or block the install,
3
+ // so everything is wrapped and falls back to plain output. Its only job is to tell the
4
+ // user how to start — and to warn when another program named `byte` already owns that
5
+ // name on the PATH (a common clash with a stale Python `byte.exe`), pointing them at the
6
+ // collision-proof `bytevion` command, which is the same CLI.
7
+
8
+ function colors() {
9
+ try {
10
+ return require('picocolors')
11
+ } catch {
12
+ const id = (s) => s
13
+ return { cyan: id, bold: id, dim: id, yellow: id }
14
+ }
15
+ }
16
+
17
+ // On Windows, return the path of a `byte.exe` that shadows our `byte.cmd` shim, if any.
18
+ // Our npm shim is always `.cmd`/`.ps1`, never `.exe`, so a first-hit `.exe` means another
19
+ // tool wins when the user types `byte`.
20
+ function shadowingExe() {
21
+ if (process.platform !== 'win32') return null
22
+ try {
23
+ const { execFileSync } = require('node:child_process')
24
+ const out = execFileSync('where', ['byte'], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] })
25
+ const first = out
26
+ .split(/\r?\n/)
27
+ .map((s) => s.trim())
28
+ .filter(Boolean)[0]
29
+ return first && first.toLowerCase().endsWith('.exe') ? first : null
30
+ } catch {
31
+ return null
32
+ }
33
+ }
34
+
35
+ try {
36
+ // Skip the banner in CI / non-interactive installs to keep logs clean.
37
+ if (process.env.CI || process.env.BYTE_NO_POSTINSTALL === '1') process.exit(0)
38
+
39
+ const c = colors()
40
+ const mark = `${c.dim('>')}${c.bold(c.cyan('b'))}${c.dim('_')}`
41
+ const lines = ['']
42
+ lines.push(` ${mark} ${c.bold('Byte')} is installed.`)
43
+ lines.push(` ${c.dim('Get started:')} ${c.cyan('byte login')} ${c.dim('then')} ${c.cyan('byte setup')}`)
44
+
45
+ const shadow = shadowingExe()
46
+ if (shadow) {
47
+ lines.push('')
48
+ lines.push(` ${c.yellow('!')} ${c.dim('Another program already owns')} ${c.bold('byte')} ${c.dim('on your PATH:')}`)
49
+ lines.push(` ${c.dim(shadow)}`)
50
+ lines.push(` ${c.dim('Use the')} ${c.cyan('bytevion')} ${c.dim('command instead — it is the same CLI:')} ${c.cyan('bytevion login')}`)
51
+ } else {
52
+ lines.push(` ${c.dim('(If')} ${c.cyan('byte')} ${c.dim('is taken by another tool, the')} ${c.cyan('bytevion')} ${c.dim('command works too.)')}`)
53
+ }
54
+ lines.push('')
55
+ process.stdout.write(lines.join('\n') + '\n')
56
+ } catch {
57
+ // Never let a notice break an install.
58
+ }
@@ -1199,14 +1199,10 @@
1199
1199
  "rotate.js"
1200
1200
  ]
1201
1201
  },
1202
- "providers:add": {
1202
+ "sessions": {
1203
1203
  "aliases": [],
1204
1204
  "args": {},
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
+ "description": "List active terminal sessions (CLI tokens) for the org.",
1210
1206
  "flags": {
1211
1207
  "json": {
1212
1208
  "description": "Format output as json.",
@@ -1230,53 +1226,11 @@
1230
1226
  "hasDynamicHelp": false,
1231
1227
  "multiple": false,
1232
1228
  "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"
1275
1229
  }
1276
1230
  },
1277
1231
  "hasDynamicHelp": false,
1278
1232
  "hiddenAliases": [],
1279
- "id": "providers:add",
1233
+ "id": "sessions",
1280
1234
  "pluginAlias": "@bytevion/cli",
1281
1235
  "pluginName": "@bytevion/cli",
1282
1236
  "pluginType": "core",
@@ -1286,14 +1240,20 @@
1286
1240
  "relativePath": [
1287
1241
  "dist",
1288
1242
  "commands",
1289
- "providers",
1290
- "add.js"
1243
+ "sessions",
1244
+ "index.js"
1291
1245
  ]
1292
1246
  },
1293
- "providers:list": {
1247
+ "sessions:revoke": {
1294
1248
  "aliases": [],
1295
- "args": {},
1296
- "description": "List upstream provider connections for the current org.",
1249
+ "args": {
1250
+ "id": {
1251
+ "description": "Session id (see `byte sessions`)",
1252
+ "name": "id",
1253
+ "required": true
1254
+ }
1255
+ },
1256
+ "description": "Revoke a terminal session (CLI token) by id.",
1297
1257
  "flags": {
1298
1258
  "json": {
1299
1259
  "description": "Format output as json.",
@@ -1321,7 +1281,7 @@
1321
1281
  },
1322
1282
  "hasDynamicHelp": false,
1323
1283
  "hiddenAliases": [],
1324
- "id": "providers:list",
1284
+ "id": "sessions:revoke",
1325
1285
  "pluginAlias": "@bytevion/cli",
1326
1286
  "pluginName": "@bytevion/cli",
1327
1287
  "pluginType": "core",
@@ -1331,20 +1291,18 @@
1331
1291
  "relativePath": [
1332
1292
  "dist",
1333
1293
  "commands",
1334
- "providers",
1335
- "list.js"
1294
+ "sessions",
1295
+ "revoke.js"
1336
1296
  ]
1337
1297
  },
1338
- "providers:rotate": {
1298
+ "providers:add": {
1339
1299
  "aliases": [],
1340
- "args": {
1341
- "id": {
1342
- "description": "Connection id (see `byte providers list`)",
1343
- "name": "id",
1344
- "required": true
1345
- }
1346
- },
1347
- "description": "Replace the upstream API key on a provider connection (keeps imported models).",
1300
+ "args": {},
1301
+ "description": "Connect an upstream provider key (BYOK). Byte stores it encrypted and imports models.",
1302
+ "examples": [
1303
+ "<%= config.bin %> providers add --provider deepseek --api-key sk-...",
1304
+ "<%= config.bin %> providers add --provider custom --provider-base-url https://api.example.com/v1 --api-key ..."
1305
+ ],
1348
1306
  "flags": {
1349
1307
  "json": {
1350
1308
  "description": "Format output as json.",
@@ -1369,18 +1327,52 @@
1369
1327
  "multiple": false,
1370
1328
  "type": "option"
1371
1329
  },
1330
+ "provider": {
1331
+ "description": "Provider preset id (openai, deepseek, anthropic, …)",
1332
+ "name": "provider",
1333
+ "hasDynamicHelp": false,
1334
+ "multiple": false,
1335
+ "type": "option"
1336
+ },
1372
1337
  "api-key": {
1373
- "description": "New upstream provider API key",
1338
+ "description": "Upstream provider API key",
1374
1339
  "env": "BYTE_PROVIDER_KEY",
1375
1340
  "name": "api-key",
1376
1341
  "hasDynamicHelp": false,
1377
1342
  "multiple": false,
1378
1343
  "type": "option"
1344
+ },
1345
+ "provider-base-url": {
1346
+ "description": "Custom base URL (for --provider custom or to override)",
1347
+ "name": "provider-base-url",
1348
+ "hasDynamicHelp": false,
1349
+ "multiple": false,
1350
+ "type": "option"
1351
+ },
1352
+ "mode": {
1353
+ "description": "Gateway mode (byte_compatible/byte_messages/byte_generative)",
1354
+ "name": "mode",
1355
+ "hasDynamicHelp": false,
1356
+ "multiple": false,
1357
+ "type": "option"
1358
+ },
1359
+ "label": {
1360
+ "description": "Label for this connection",
1361
+ "name": "label",
1362
+ "hasDynamicHelp": false,
1363
+ "multiple": false,
1364
+ "type": "option"
1365
+ },
1366
+ "no-fetch": {
1367
+ "description": "Skip auto-importing the model list",
1368
+ "name": "no-fetch",
1369
+ "allowNo": false,
1370
+ "type": "boolean"
1379
1371
  }
1380
1372
  },
1381
1373
  "hasDynamicHelp": false,
1382
1374
  "hiddenAliases": [],
1383
- "id": "providers:rotate",
1375
+ "id": "providers:add",
1384
1376
  "pluginAlias": "@bytevion/cli",
1385
1377
  "pluginName": "@bytevion/cli",
1386
1378
  "pluginType": "core",
@@ -1391,19 +1383,13 @@
1391
1383
  "dist",
1392
1384
  "commands",
1393
1385
  "providers",
1394
- "rotate.js"
1386
+ "add.js"
1395
1387
  ]
1396
1388
  },
1397
- "providers:test": {
1389
+ "providers:list": {
1398
1390
  "aliases": [],
1399
- "args": {
1400
- "id": {
1401
- "description": "Connection id (see `byte providers list`)",
1402
- "name": "id",
1403
- "required": true
1404
- }
1405
- },
1406
- "description": "Verify a provider connection by re-fetching its model list.",
1391
+ "args": {},
1392
+ "description": "List upstream provider connections for the current org.",
1407
1393
  "flags": {
1408
1394
  "json": {
1409
1395
  "description": "Format output as json.",
@@ -1431,7 +1417,7 @@
1431
1417
  },
1432
1418
  "hasDynamicHelp": false,
1433
1419
  "hiddenAliases": [],
1434
- "id": "providers:test",
1420
+ "id": "providers:list",
1435
1421
  "pluginAlias": "@bytevion/cli",
1436
1422
  "pluginName": "@bytevion/cli",
1437
1423
  "pluginType": "core",
@@ -1442,13 +1428,19 @@
1442
1428
  "dist",
1443
1429
  "commands",
1444
1430
  "providers",
1445
- "test.js"
1431
+ "list.js"
1446
1432
  ]
1447
1433
  },
1448
- "sessions": {
1434
+ "providers:rotate": {
1449
1435
  "aliases": [],
1450
- "args": {},
1451
- "description": "List active terminal sessions (CLI tokens) for the org.",
1436
+ "args": {
1437
+ "id": {
1438
+ "description": "Connection id (see `byte providers list`)",
1439
+ "name": "id",
1440
+ "required": true
1441
+ }
1442
+ },
1443
+ "description": "Replace the upstream API key on a provider connection (keeps imported models).",
1452
1444
  "flags": {
1453
1445
  "json": {
1454
1446
  "description": "Format output as json.",
@@ -1472,11 +1464,19 @@
1472
1464
  "hasDynamicHelp": false,
1473
1465
  "multiple": false,
1474
1466
  "type": "option"
1467
+ },
1468
+ "api-key": {
1469
+ "description": "New upstream provider API key",
1470
+ "env": "BYTE_PROVIDER_KEY",
1471
+ "name": "api-key",
1472
+ "hasDynamicHelp": false,
1473
+ "multiple": false,
1474
+ "type": "option"
1475
1475
  }
1476
1476
  },
1477
1477
  "hasDynamicHelp": false,
1478
1478
  "hiddenAliases": [],
1479
- "id": "sessions",
1479
+ "id": "providers:rotate",
1480
1480
  "pluginAlias": "@bytevion/cli",
1481
1481
  "pluginName": "@bytevion/cli",
1482
1482
  "pluginType": "core",
@@ -1486,20 +1486,20 @@
1486
1486
  "relativePath": [
1487
1487
  "dist",
1488
1488
  "commands",
1489
- "sessions",
1490
- "index.js"
1489
+ "providers",
1490
+ "rotate.js"
1491
1491
  ]
1492
1492
  },
1493
- "sessions:revoke": {
1493
+ "providers:test": {
1494
1494
  "aliases": [],
1495
1495
  "args": {
1496
1496
  "id": {
1497
- "description": "Session id (see `byte sessions`)",
1497
+ "description": "Connection id (see `byte providers list`)",
1498
1498
  "name": "id",
1499
1499
  "required": true
1500
1500
  }
1501
1501
  },
1502
- "description": "Revoke a terminal session (CLI token) by id.",
1502
+ "description": "Verify a provider connection by re-fetching its model list.",
1503
1503
  "flags": {
1504
1504
  "json": {
1505
1505
  "description": "Format output as json.",
@@ -1527,7 +1527,7 @@
1527
1527
  },
1528
1528
  "hasDynamicHelp": false,
1529
1529
  "hiddenAliases": [],
1530
- "id": "sessions:revoke",
1530
+ "id": "providers:test",
1531
1531
  "pluginAlias": "@bytevion/cli",
1532
1532
  "pluginName": "@bytevion/cli",
1533
1533
  "pluginType": "core",
@@ -1537,8 +1537,8 @@
1537
1537
  "relativePath": [
1538
1538
  "dist",
1539
1539
  "commands",
1540
- "sessions",
1541
- "revoke.js"
1540
+ "providers",
1541
+ "test.js"
1542
1542
  ]
1543
1543
  },
1544
1544
  "opt:preset": {
@@ -1711,5 +1711,5 @@
1711
1711
  ]
1712
1712
  }
1713
1713
  },
1714
- "version": "0.4.0"
1714
+ "version": "0.4.1"
1715
1715
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytevion/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Byte — control your LLM optimization gateway from the terminal.",
5
5
  "author": "Byte",
6
6
  "license": "UNLICENSED",
@@ -8,7 +8,8 @@
8
8
  "access": "public"
9
9
  },
10
10
  "bin": {
11
- "byte": "./bin/run.js"
11
+ "byte": "./bin/run.js",
12
+ "bytevion": "./bin/run.js"
12
13
  },
13
14
  "type": "commonjs",
14
15
  "engines": {
@@ -74,6 +75,7 @@
74
75
  },
75
76
  "scripts": {
76
77
  "build": "tsc -b && node scripts/tui-pkg.js && oclif manifest",
78
+ "postinstall": "node ./bin/postinstall.js",
77
79
  "test": "npm run build && npm run test:unit && npm run test:tui",
78
80
  "test:unit": "tsx --test \"src/**/*.test.ts\" \"src/**/*.test.tsx\"",
79
81
  "test:tui": "node --test \"src/**/*.test.mts\"",