@bytevion/cli 0.5.1 → 0.5.2
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.
- package/dist/commands/connect.d.ts +3 -0
- package/dist/commands/connect.js +50 -19
- package/dist/commands/integrate.js +4 -4
- package/dist/commands/metrics.d.ts +9 -0
- package/dist/commands/metrics.js +39 -0
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.js +4 -3
- package/dist/lib/api.d.ts +1 -0
- package/dist/lib/api.js +3 -0
- package/oclif.manifest.json +226 -154
- package/package.json +1 -1
|
@@ -6,7 +6,10 @@ export default class Connect extends BaseCommand {
|
|
|
6
6
|
model: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
preset: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
8
|
only: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
write: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
11
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
12
|
};
|
|
11
13
|
run(): Promise<unknown>;
|
|
14
|
+
private smokeTest;
|
|
12
15
|
}
|
package/dist/commands/connect.js
CHANGED
|
@@ -7,22 +7,26 @@ class Connect extends base_1.BaseCommand {
|
|
|
7
7
|
static description = 'Detect installed coding agents and wire every one Byte can auto-configure — in one shot.';
|
|
8
8
|
static examples = [
|
|
9
9
|
'<%= config.bin %> connect',
|
|
10
|
-
'<%= config.bin %> connect --
|
|
10
|
+
'<%= config.bin %> connect --all --write',
|
|
11
11
|
'<%= config.bin %> connect --only opencode,codex',
|
|
12
12
|
];
|
|
13
13
|
static flags = {
|
|
14
|
-
model: core_1.Flags.string({ description: 'Model
|
|
14
|
+
model: core_1.Flags.string({ description: 'Model to wire (default: auto — Byte routes to your enabled model)' }),
|
|
15
15
|
preset: core_1.Flags.string({
|
|
16
16
|
description: 'Optimization preset to apply before wiring',
|
|
17
17
|
options: ['maximum', 'balanced', 'max_savings', 'lowest_latency', 'reliability_first'],
|
|
18
18
|
}),
|
|
19
19
|
only: core_1.Flags.string({ description: 'Comma-separated subset of tool keys to wire' }),
|
|
20
|
+
all: core_1.Flags.boolean({ description: 'Wire every detected auto-configurable tool (this is the default)' }),
|
|
21
|
+
write: core_1.Flags.boolean({ description: 'Write tool config files (the default for connect)' }),
|
|
20
22
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompts' }),
|
|
21
23
|
};
|
|
22
24
|
async run() {
|
|
23
25
|
const { flags } = await this.parse(Connect);
|
|
24
26
|
// A Byte key is what gets written into each tool's config, so require one up front.
|
|
25
|
-
this.requireByteKey(flags);
|
|
27
|
+
const byteKey = this.requireByteKey(flags);
|
|
28
|
+
const model = flags.model || 'auto';
|
|
29
|
+
const bin = this.config.bin;
|
|
26
30
|
const only = flags.only ? new Set(flags.only.split(',').map((s) => s.trim()).filter(Boolean)) : null;
|
|
27
31
|
const detected = (0, detect_1.detectTools)().filter((d) => d.installed && (!only || only.has(d.key)));
|
|
28
32
|
const targets = detected.filter((d) => d.canAutoWrite);
|
|
@@ -31,34 +35,61 @@ class Connect extends base_1.BaseCommand {
|
|
|
31
35
|
if (!this.jsonEnabled()) {
|
|
32
36
|
this.log('No auto-configurable coding agents detected.');
|
|
33
37
|
if (manual.length)
|
|
34
|
-
this.log(`Installed but manual: ${manual.join(', ')} — run
|
|
38
|
+
this.log(`Installed but manual: ${manual.join(', ')} — run \`${bin} integrate <tool>\`.`);
|
|
35
39
|
else
|
|
36
|
-
this.log(
|
|
40
|
+
this.log(`Install one (e.g. opencode) or wire manually with \`${bin} integrate --list\`.`);
|
|
37
41
|
}
|
|
38
42
|
return { wired: [], manual };
|
|
39
43
|
}
|
|
40
44
|
const wired = [];
|
|
41
45
|
for (const target of targets) {
|
|
42
|
-
const argv = [
|
|
43
|
-
target.key,
|
|
44
|
-
'--write',
|
|
45
|
-
'--yes',
|
|
46
|
-
...(flags.model ? ['--model', flags.model] : []),
|
|
47
|
-
...(flags.preset ? ['--preset', flags.preset] : []),
|
|
48
|
-
];
|
|
46
|
+
const argv = [target.key, '--write', '--yes', '--model', model, ...(flags.preset ? ['--preset', flags.preset] : [])];
|
|
49
47
|
// sequential keeps config writes + their backups ordered and surfaces the first failure clearly
|
|
50
48
|
// eslint-disable-next-line no-await-in-loop
|
|
51
49
|
await this.config.runCommand('integrate', argv);
|
|
52
50
|
wired.push(target.key);
|
|
53
51
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
// Real smoke test of the shared gateway every config points at: list models, then send a
|
|
53
|
+
// model=auto completion. Only claim "connected" if both pass.
|
|
54
|
+
const probe = await this.smokeTest(byteKey, flags);
|
|
55
|
+
if (this.jsonEnabled())
|
|
56
|
+
return { wired, manual, model, verified: probe.ok, probe };
|
|
57
|
+
this.log('');
|
|
58
|
+
if (probe.ok) {
|
|
59
|
+
this.log(`Connected ${wired.length} tool(s): ${wired.join(', ')} ✓ gateway verified (model: ${model}).`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
this.log(`Wired ${wired.length} tool(s): ${wired.join(', ')} — gateway smoke test did not pass: ${probe.reason}.`);
|
|
63
|
+
this.log(`Resolve that, then confirm with \`${bin} run "hi"\` or \`${bin} doctor\`.`);
|
|
64
|
+
}
|
|
65
|
+
if (manual.length)
|
|
66
|
+
this.log(`Manual setup needed for: ${manual.join(', ')} — run \`${bin} integrate <tool>\`.`);
|
|
67
|
+
this.log(`Export the Byte key in your shell (see \`${bin} env\`) and start coding.`);
|
|
68
|
+
return { wired, manual, model, verified: probe.ok };
|
|
69
|
+
}
|
|
70
|
+
// GET /v1/models then POST /v1/chat/completions model=auto, both with the Byte key. Returns
|
|
71
|
+
// a clear reason on failure so connect never prints "connected" for a wiring that won't work.
|
|
72
|
+
async smokeTest(byteKey, flags) {
|
|
73
|
+
const api = this.api(flags);
|
|
74
|
+
try {
|
|
75
|
+
await api.models(byteKey);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
const e = err;
|
|
79
|
+
return { ok: false, reason: `GET /v1/models failed (${e?.code || e?.message || 'unreachable'})` };
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const res = (await api.chat(byteKey, { model: 'auto', max_tokens: 1, messages: [{ role: 'user', content: 'ping' }] }));
|
|
83
|
+
if (res?.choices?.length || res?.id)
|
|
84
|
+
return { ok: true, reason: '' };
|
|
85
|
+
return { ok: false, reason: 'chat returned no choices' };
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
const e = err;
|
|
89
|
+
const code = String(e?.code || e?.message || 'error');
|
|
90
|
+
const reason = code.includes('NOT_CONFIGURED') ? `no model enabled yet — run \`${this.config.bin} setup\` or enable a model` : `POST /v1/chat/completions model=auto failed (${code})`;
|
|
91
|
+
return { ok: false, reason };
|
|
60
92
|
}
|
|
61
|
-
return { wired, manual };
|
|
62
93
|
}
|
|
63
94
|
}
|
|
64
95
|
exports.default = Connect;
|
|
@@ -64,7 +64,7 @@ class Integrate extends base_1.BaseCommand {
|
|
|
64
64
|
write: core_1.Flags.boolean({ description: 'Write tool config files (a timestamped .bak is kept)' }),
|
|
65
65
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompts' }),
|
|
66
66
|
key: core_1.Flags.string({ description: 'Byte API key to use (defaults to the saved profile key)' }),
|
|
67
|
-
model: core_1.Flags.string({ description: 'Model
|
|
67
|
+
model: core_1.Flags.string({ description: 'Model to wire (default: auto — Byte routes to your enabled model)' }),
|
|
68
68
|
preset: core_1.Flags.string({
|
|
69
69
|
description: 'Apply this optimization preset to the org before wiring',
|
|
70
70
|
options: ['balanced', 'max_savings', 'lowest_latency', 'reliability_first'],
|
|
@@ -90,11 +90,11 @@ class Integrate extends base_1.BaseCommand {
|
|
|
90
90
|
}
|
|
91
91
|
const integ = (0, integrations_1.findIntegration)(target);
|
|
92
92
|
if (!integ)
|
|
93
|
-
return this.error(`Unknown target "${target}". Run
|
|
93
|
+
return this.error(`Unknown target "${target}". Run \`${this.config.bin} integrate --list\`.`, { exit: 2 });
|
|
94
94
|
const byteKey = flags.key || this.requireByteKey(flags);
|
|
95
95
|
const base = this.baseUrlFrom(flags);
|
|
96
96
|
const shell = (0, shell_1.detectShell)(flags.shell);
|
|
97
|
-
const modelAlias = flags.model || '
|
|
97
|
+
const modelAlias = flags.model || 'auto';
|
|
98
98
|
if (flags.preset) {
|
|
99
99
|
this.requireToken(flags);
|
|
100
100
|
await this.api(flags).optPatch({ default_mode: flags.preset });
|
|
@@ -191,7 +191,7 @@ class Integrate extends base_1.BaseCommand {
|
|
|
191
191
|
const rows = (0, detect_1.detectTools)().map((d) => {
|
|
192
192
|
let wired = false;
|
|
193
193
|
const integ = (0, integrations_1.findIntegration)(d.key);
|
|
194
|
-
const file = integ?.build({ baseUrl: base, byteKey, modelAlias: '
|
|
194
|
+
const file = integ?.build({ baseUrl: base, byteKey, modelAlias: 'auto' }).settingsFile;
|
|
195
195
|
if (file && (0, node_fs_1.existsSync)(file.path)) {
|
|
196
196
|
try {
|
|
197
197
|
wired = (0, node_fs_1.readFileSync)(file.path, 'utf8').toLowerCase().includes('byte');
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCommand } from '../base';
|
|
2
|
+
export default class Metrics extends BaseCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<unknown>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const base_1 = require("../base");
|
|
5
|
+
const output_1 = require("../lib/output");
|
|
6
|
+
const num = (v) => (typeof v === 'number' && Number.isFinite(v) ? v : Number(v) || 0);
|
|
7
|
+
const pad = (s) => s.padEnd(12);
|
|
8
|
+
class Metrics extends base_1.BaseCommand {
|
|
9
|
+
static description = 'Full cost / latency / quality breakdown for a single request.';
|
|
10
|
+
static examples = ['<%= config.bin %> metrics 1429', '<%= config.bin %> requests # to find an id'];
|
|
11
|
+
static args = {
|
|
12
|
+
id: core_1.Args.string({ description: 'Request id (from the requests list or the dashboard)', required: true }),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { args, flags } = await this.parse(Metrics);
|
|
16
|
+
this.requireToken(flags);
|
|
17
|
+
const d = await this.api(flags).requestDetail(args.id);
|
|
18
|
+
if (this.jsonEnabled())
|
|
19
|
+
return d;
|
|
20
|
+
const cost = d.cost ?? {};
|
|
21
|
+
const tok = d.tokens ?? {};
|
|
22
|
+
const lat = d.latency ?? {};
|
|
23
|
+
const cache = d.cache ?? {};
|
|
24
|
+
const routedFrom = d.requested_model && d.requested_model !== d.routed_model ? ` (routed from: ${d.requested_model})` : '';
|
|
25
|
+
const layers = Array.isArray(d.layers) ? d.layers : [];
|
|
26
|
+
this.log('');
|
|
27
|
+
this.log(` ${pad('Model')}${d.routed_model ?? d.selected_alias ?? '-'}${routedFrom}`);
|
|
28
|
+
this.log(` ${pad('Cost')}direct ${(0, output_1.fmtUsd)(cost.raw_usd)} → byte ${(0, output_1.fmtUsd)(cost.byte_usd)} save ${num(cost.savings_pct).toFixed(1)}%`);
|
|
29
|
+
this.log(` ${pad('Tokens')}in ${num(tok.in)} out ${num(tok.out)}${num(tok.cached_in) ? ` (cached in ${num(tok.cached_in)})` : ''}`);
|
|
30
|
+
this.log(` ${pad('Latency')}${num(lat.total_ms)}ms · ttft ${num(lat.ttft_ms)}ms${num(lat.saved_ms) ? ` · saved ${num(lat.saved_ms)}ms` : ''}`);
|
|
31
|
+
this.log(` ${pad('Cache')}tier=${cache.layer ?? 'miss'} · quality=${d.quality_gate_state || 'n/a'}`);
|
|
32
|
+
if (layers.length)
|
|
33
|
+
this.log(` ${pad('Layers')}${layers.map((l) => `${l.layer}(${(0, output_1.fmtUsd)(l.savings_usd)})`).join(' ')}`);
|
|
34
|
+
this.log(` ${pad('Verdict')}${d.dominance_status || '-'}`);
|
|
35
|
+
this.log('');
|
|
36
|
+
return d;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = Metrics;
|
package/dist/commands/sync.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export default class Sync extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
model: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
8
|
yes: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
};
|
|
9
10
|
run(): Promise<unknown>;
|
package/dist/commands/sync.js
CHANGED
|
@@ -7,7 +7,8 @@ class Sync extends base_1.BaseCommand {
|
|
|
7
7
|
static description = 'Re-apply your current Byte key/model to every wired coding agent (run after rotating a key or switching model).';
|
|
8
8
|
static examples = ['<%= config.bin %> sync', '<%= config.bin %> sync --model byte-2-deepseek-v4-flash'];
|
|
9
9
|
static flags = {
|
|
10
|
-
model: core_1.Flags.string({ description: 'Model
|
|
10
|
+
model: core_1.Flags.string({ description: 'Model to wire (default: the last wired model, or auto)' }),
|
|
11
|
+
all: core_1.Flags.boolean({ description: 'Re-apply to every wired tool (this is the default)' }),
|
|
11
12
|
yes: core_1.Flags.boolean({ char: 'y', description: 'Skip confirmation prompts' }),
|
|
12
13
|
};
|
|
13
14
|
async run() {
|
|
@@ -18,10 +19,10 @@ class Sync extends base_1.BaseCommand {
|
|
|
18
19
|
const tools = wiring.tools || [];
|
|
19
20
|
if (!tools.length) {
|
|
20
21
|
if (!this.jsonEnabled())
|
|
21
|
-
this.log(
|
|
22
|
+
this.log(`No wired tools yet. Run \`${this.config.bin} connect\` first.`);
|
|
22
23
|
return { synced: [] };
|
|
23
24
|
}
|
|
24
|
-
const model = flags.model || wiring.model;
|
|
25
|
+
const model = flags.model || wiring.model || 'auto';
|
|
25
26
|
if (flags.model)
|
|
26
27
|
(0, wiring_1.setSelectedModel)(profile, flags.model);
|
|
27
28
|
const synced = [];
|
package/dist/lib/api.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare class ByteApi {
|
|
|
34
34
|
usage(granularity: string): Promise<any>;
|
|
35
35
|
dashboard(): Promise<any>;
|
|
36
36
|
requests(): Promise<any>;
|
|
37
|
+
requestDetail(id: string | number): Promise<any>;
|
|
37
38
|
cacheStats(): Promise<any>;
|
|
38
39
|
costs(): Promise<any>;
|
|
39
40
|
health(): Promise<any>;
|
package/dist/lib/api.js
CHANGED
|
@@ -138,6 +138,9 @@ class ByteApi {
|
|
|
138
138
|
requests() {
|
|
139
139
|
return this.request('GET', '/api/v1/requests');
|
|
140
140
|
}
|
|
141
|
+
requestDetail(id) {
|
|
142
|
+
return this.request('GET', `/api/v1/requests/${encodeURIComponent(String(id))}`);
|
|
143
|
+
}
|
|
141
144
|
cacheStats() {
|
|
142
145
|
return this.request('GET', '/api/v1/cache/stats');
|
|
143
146
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"description": "Detect installed coding agents and wire every one Byte can auto-configure — in one shot.",
|
|
69
69
|
"examples": [
|
|
70
70
|
"<%= config.bin %> connect",
|
|
71
|
-
"<%= config.bin %> connect --
|
|
71
|
+
"<%= config.bin %> connect --all --write",
|
|
72
72
|
"<%= config.bin %> connect --only opencode,codex"
|
|
73
73
|
],
|
|
74
74
|
"flags": {
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"type": "option"
|
|
97
97
|
},
|
|
98
98
|
"model": {
|
|
99
|
-
"description": "Model
|
|
99
|
+
"description": "Model to wire (default: auto — Byte routes to your enabled model)",
|
|
100
100
|
"name": "model",
|
|
101
101
|
"hasDynamicHelp": false,
|
|
102
102
|
"multiple": false,
|
|
@@ -123,6 +123,18 @@
|
|
|
123
123
|
"multiple": false,
|
|
124
124
|
"type": "option"
|
|
125
125
|
},
|
|
126
|
+
"all": {
|
|
127
|
+
"description": "Wire every detected auto-configurable tool (this is the default)",
|
|
128
|
+
"name": "all",
|
|
129
|
+
"allowNo": false,
|
|
130
|
+
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"write": {
|
|
133
|
+
"description": "Write tool config files (the default for connect)",
|
|
134
|
+
"name": "write",
|
|
135
|
+
"allowNo": false,
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
},
|
|
126
138
|
"yes": {
|
|
127
139
|
"char": "y",
|
|
128
140
|
"description": "Skip confirmation prompts",
|
|
@@ -479,7 +491,7 @@
|
|
|
479
491
|
"type": "option"
|
|
480
492
|
},
|
|
481
493
|
"model": {
|
|
482
|
-
"description": "Model
|
|
494
|
+
"description": "Model to wire (default: auto — Byte routes to your enabled model)",
|
|
483
495
|
"name": "model",
|
|
484
496
|
"hasDynamicHelp": false,
|
|
485
497
|
"multiple": false,
|
|
@@ -612,6 +624,60 @@
|
|
|
612
624
|
"logout.js"
|
|
613
625
|
]
|
|
614
626
|
},
|
|
627
|
+
"metrics": {
|
|
628
|
+
"aliases": [],
|
|
629
|
+
"args": {
|
|
630
|
+
"id": {
|
|
631
|
+
"description": "Request id (from the requests list or the dashboard)",
|
|
632
|
+
"name": "id",
|
|
633
|
+
"required": true
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
"description": "Full cost / latency / quality breakdown for a single request.",
|
|
637
|
+
"examples": [
|
|
638
|
+
"<%= config.bin %> metrics 1429",
|
|
639
|
+
"<%= config.bin %> requests # to find an id"
|
|
640
|
+
],
|
|
641
|
+
"flags": {
|
|
642
|
+
"json": {
|
|
643
|
+
"description": "Format output as json.",
|
|
644
|
+
"helpGroup": "GLOBAL",
|
|
645
|
+
"name": "json",
|
|
646
|
+
"allowNo": false,
|
|
647
|
+
"type": "boolean"
|
|
648
|
+
},
|
|
649
|
+
"profile": {
|
|
650
|
+
"description": "Configuration profile to use",
|
|
651
|
+
"env": "BYTE_PROFILE",
|
|
652
|
+
"name": "profile",
|
|
653
|
+
"hasDynamicHelp": false,
|
|
654
|
+
"multiple": false,
|
|
655
|
+
"type": "option"
|
|
656
|
+
},
|
|
657
|
+
"base-url": {
|
|
658
|
+
"description": "Override the API base URL",
|
|
659
|
+
"env": "BYTE_BASE_URL",
|
|
660
|
+
"name": "base-url",
|
|
661
|
+
"hasDynamicHelp": false,
|
|
662
|
+
"multiple": false,
|
|
663
|
+
"type": "option"
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
"hasDynamicHelp": false,
|
|
667
|
+
"hiddenAliases": [],
|
|
668
|
+
"id": "metrics",
|
|
669
|
+
"pluginAlias": "@bytevion/cli",
|
|
670
|
+
"pluginName": "@bytevion/cli",
|
|
671
|
+
"pluginType": "core",
|
|
672
|
+
"strict": true,
|
|
673
|
+
"enableJsonFlag": true,
|
|
674
|
+
"isESM": false,
|
|
675
|
+
"relativePath": [
|
|
676
|
+
"dist",
|
|
677
|
+
"commands",
|
|
678
|
+
"metrics.js"
|
|
679
|
+
]
|
|
680
|
+
},
|
|
615
681
|
"run": {
|
|
616
682
|
"aliases": [],
|
|
617
683
|
"args": {
|
|
@@ -874,12 +940,18 @@
|
|
|
874
940
|
"type": "option"
|
|
875
941
|
},
|
|
876
942
|
"model": {
|
|
877
|
-
"description": "Model
|
|
943
|
+
"description": "Model to wire (default: the last wired model, or auto)",
|
|
878
944
|
"name": "model",
|
|
879
945
|
"hasDynamicHelp": false,
|
|
880
946
|
"multiple": false,
|
|
881
947
|
"type": "option"
|
|
882
948
|
},
|
|
949
|
+
"all": {
|
|
950
|
+
"description": "Re-apply to every wired tool (this is the default)",
|
|
951
|
+
"name": "all",
|
|
952
|
+
"allowNo": false,
|
|
953
|
+
"type": "boolean"
|
|
954
|
+
},
|
|
883
955
|
"yes": {
|
|
884
956
|
"char": "y",
|
|
885
957
|
"description": "Skip confirmation prompts",
|
|
@@ -1620,14 +1692,23 @@
|
|
|
1620
1692
|
"test.js"
|
|
1621
1693
|
]
|
|
1622
1694
|
},
|
|
1623
|
-
"
|
|
1695
|
+
"opt:preset": {
|
|
1624
1696
|
"aliases": [],
|
|
1625
|
-
"args": {
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1697
|
+
"args": {
|
|
1698
|
+
"preset": {
|
|
1699
|
+
"description": "Mode to apply",
|
|
1700
|
+
"name": "preset",
|
|
1701
|
+
"options": [
|
|
1702
|
+
"maximum",
|
|
1703
|
+
"max_savings",
|
|
1704
|
+
"balanced",
|
|
1705
|
+
"lowest_latency",
|
|
1706
|
+
"reliability_first"
|
|
1707
|
+
],
|
|
1708
|
+
"required": true
|
|
1709
|
+
}
|
|
1710
|
+
},
|
|
1711
|
+
"description": "Apply an optimization mode for the whole org (maximum, balanced, max_savings, lowest_latency, reliability_first).",
|
|
1631
1712
|
"flags": {
|
|
1632
1713
|
"json": {
|
|
1633
1714
|
"description": "Format output as json.",
|
|
@@ -1651,53 +1732,11 @@
|
|
|
1651
1732
|
"hasDynamicHelp": false,
|
|
1652
1733
|
"multiple": false,
|
|
1653
1734
|
"type": "option"
|
|
1654
|
-
},
|
|
1655
|
-
"provider": {
|
|
1656
|
-
"description": "Provider preset id (openai, deepseek, anthropic, …)",
|
|
1657
|
-
"name": "provider",
|
|
1658
|
-
"hasDynamicHelp": false,
|
|
1659
|
-
"multiple": false,
|
|
1660
|
-
"type": "option"
|
|
1661
|
-
},
|
|
1662
|
-
"api-key": {
|
|
1663
|
-
"description": "Upstream provider API key",
|
|
1664
|
-
"env": "BYTE_PROVIDER_KEY",
|
|
1665
|
-
"name": "api-key",
|
|
1666
|
-
"hasDynamicHelp": false,
|
|
1667
|
-
"multiple": false,
|
|
1668
|
-
"type": "option"
|
|
1669
|
-
},
|
|
1670
|
-
"provider-base-url": {
|
|
1671
|
-
"description": "Custom base URL (for --provider custom or to override)",
|
|
1672
|
-
"name": "provider-base-url",
|
|
1673
|
-
"hasDynamicHelp": false,
|
|
1674
|
-
"multiple": false,
|
|
1675
|
-
"type": "option"
|
|
1676
|
-
},
|
|
1677
|
-
"mode": {
|
|
1678
|
-
"description": "Gateway mode (byte_compatible/byte_messages/byte_generative)",
|
|
1679
|
-
"name": "mode",
|
|
1680
|
-
"hasDynamicHelp": false,
|
|
1681
|
-
"multiple": false,
|
|
1682
|
-
"type": "option"
|
|
1683
|
-
},
|
|
1684
|
-
"label": {
|
|
1685
|
-
"description": "Label for this connection",
|
|
1686
|
-
"name": "label",
|
|
1687
|
-
"hasDynamicHelp": false,
|
|
1688
|
-
"multiple": false,
|
|
1689
|
-
"type": "option"
|
|
1690
|
-
},
|
|
1691
|
-
"no-fetch": {
|
|
1692
|
-
"description": "Skip auto-importing the model list",
|
|
1693
|
-
"name": "no-fetch",
|
|
1694
|
-
"allowNo": false,
|
|
1695
|
-
"type": "boolean"
|
|
1696
1735
|
}
|
|
1697
1736
|
},
|
|
1698
1737
|
"hasDynamicHelp": false,
|
|
1699
1738
|
"hiddenAliases": [],
|
|
1700
|
-
"id": "
|
|
1739
|
+
"id": "opt:preset",
|
|
1701
1740
|
"pluginAlias": "@bytevion/cli",
|
|
1702
1741
|
"pluginName": "@bytevion/cli",
|
|
1703
1742
|
"pluginType": "core",
|
|
@@ -1707,24 +1746,34 @@
|
|
|
1707
1746
|
"relativePath": [
|
|
1708
1747
|
"dist",
|
|
1709
1748
|
"commands",
|
|
1710
|
-
"
|
|
1711
|
-
"
|
|
1749
|
+
"opt",
|
|
1750
|
+
"preset.js"
|
|
1712
1751
|
]
|
|
1713
1752
|
},
|
|
1714
|
-
"
|
|
1753
|
+
"opt:set": {
|
|
1715
1754
|
"aliases": [],
|
|
1716
1755
|
"args": {
|
|
1717
|
-
"
|
|
1718
|
-
"description": "
|
|
1719
|
-
"name": "
|
|
1720
|
-
"required":
|
|
1756
|
+
"flag": {
|
|
1757
|
+
"description": "Optimization field name",
|
|
1758
|
+
"name": "flag",
|
|
1759
|
+
"required": true
|
|
1760
|
+
},
|
|
1761
|
+
"value": {
|
|
1762
|
+
"description": "on or off",
|
|
1763
|
+
"name": "value",
|
|
1764
|
+
"options": [
|
|
1765
|
+
"on",
|
|
1766
|
+
"off",
|
|
1767
|
+
"true",
|
|
1768
|
+
"false"
|
|
1769
|
+
],
|
|
1770
|
+
"required": true
|
|
1721
1771
|
}
|
|
1722
1772
|
},
|
|
1723
|
-
"description": "
|
|
1773
|
+
"description": "Toggle a single optimization layer on or off. See field names with `byte opt show --json`.",
|
|
1724
1774
|
"examples": [
|
|
1725
|
-
"<%= config.bin %>
|
|
1726
|
-
"<%= config.bin %>
|
|
1727
|
-
"<%= config.bin %> providers compare byte-2-deepseek-v4-flash --off"
|
|
1775
|
+
"<%= config.bin %> opt set compression_enabled off",
|
|
1776
|
+
"<%= config.bin %> opt set response_cache_enabled on"
|
|
1728
1777
|
],
|
|
1729
1778
|
"flags": {
|
|
1730
1779
|
"json": {
|
|
@@ -1749,23 +1798,11 @@
|
|
|
1749
1798
|
"hasDynamicHelp": false,
|
|
1750
1799
|
"multiple": false,
|
|
1751
1800
|
"type": "option"
|
|
1752
|
-
},
|
|
1753
|
-
"all": {
|
|
1754
|
-
"description": "Apply to every priced model in the org",
|
|
1755
|
-
"name": "all",
|
|
1756
|
-
"allowNo": false,
|
|
1757
|
-
"type": "boolean"
|
|
1758
|
-
},
|
|
1759
|
-
"off": {
|
|
1760
|
-
"description": "Disable comparison instead of enabling it",
|
|
1761
|
-
"name": "off",
|
|
1762
|
-
"allowNo": false,
|
|
1763
|
-
"type": "boolean"
|
|
1764
1801
|
}
|
|
1765
1802
|
},
|
|
1766
1803
|
"hasDynamicHelp": false,
|
|
1767
1804
|
"hiddenAliases": [],
|
|
1768
|
-
"id": "
|
|
1805
|
+
"id": "opt:set",
|
|
1769
1806
|
"pluginAlias": "@bytevion/cli",
|
|
1770
1807
|
"pluginName": "@bytevion/cli",
|
|
1771
1808
|
"pluginType": "core",
|
|
@@ -1775,14 +1812,14 @@
|
|
|
1775
1812
|
"relativePath": [
|
|
1776
1813
|
"dist",
|
|
1777
1814
|
"commands",
|
|
1778
|
-
"
|
|
1779
|
-
"
|
|
1815
|
+
"opt",
|
|
1816
|
+
"set.js"
|
|
1780
1817
|
]
|
|
1781
1818
|
},
|
|
1782
|
-
"
|
|
1819
|
+
"opt:show": {
|
|
1783
1820
|
"aliases": [],
|
|
1784
1821
|
"args": {},
|
|
1785
|
-
"description": "
|
|
1822
|
+
"description": "Show the current optimization mode and every layer running on your requests.",
|
|
1786
1823
|
"flags": {
|
|
1787
1824
|
"json": {
|
|
1788
1825
|
"description": "Format output as json.",
|
|
@@ -1810,7 +1847,7 @@
|
|
|
1810
1847
|
},
|
|
1811
1848
|
"hasDynamicHelp": false,
|
|
1812
1849
|
"hiddenAliases": [],
|
|
1813
|
-
"id": "
|
|
1850
|
+
"id": "opt:show",
|
|
1814
1851
|
"pluginAlias": "@bytevion/cli",
|
|
1815
1852
|
"pluginName": "@bytevion/cli",
|
|
1816
1853
|
"pluginType": "core",
|
|
@@ -1820,20 +1857,18 @@
|
|
|
1820
1857
|
"relativePath": [
|
|
1821
1858
|
"dist",
|
|
1822
1859
|
"commands",
|
|
1823
|
-
"
|
|
1824
|
-
"
|
|
1860
|
+
"opt",
|
|
1861
|
+
"show.js"
|
|
1825
1862
|
]
|
|
1826
1863
|
},
|
|
1827
|
-
"providers:
|
|
1864
|
+
"providers:add": {
|
|
1828
1865
|
"aliases": [],
|
|
1829
|
-
"args": {
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
},
|
|
1836
|
-
"description": "Replace the upstream API key on a provider connection (keeps imported models).",
|
|
1866
|
+
"args": {},
|
|
1867
|
+
"description": "Connect an upstream provider key (BYOK). Byte stores it encrypted and imports models.",
|
|
1868
|
+
"examples": [
|
|
1869
|
+
"<%= config.bin %> providers add --provider deepseek --api-key sk-...",
|
|
1870
|
+
"<%= config.bin %> providers add --provider custom --provider-base-url https://api.example.com/v1 --api-key ..."
|
|
1871
|
+
],
|
|
1837
1872
|
"flags": {
|
|
1838
1873
|
"json": {
|
|
1839
1874
|
"description": "Format output as json.",
|
|
@@ -1858,18 +1893,52 @@
|
|
|
1858
1893
|
"multiple": false,
|
|
1859
1894
|
"type": "option"
|
|
1860
1895
|
},
|
|
1896
|
+
"provider": {
|
|
1897
|
+
"description": "Provider preset id (openai, deepseek, anthropic, …)",
|
|
1898
|
+
"name": "provider",
|
|
1899
|
+
"hasDynamicHelp": false,
|
|
1900
|
+
"multiple": false,
|
|
1901
|
+
"type": "option"
|
|
1902
|
+
},
|
|
1861
1903
|
"api-key": {
|
|
1862
|
-
"description": "
|
|
1904
|
+
"description": "Upstream provider API key",
|
|
1863
1905
|
"env": "BYTE_PROVIDER_KEY",
|
|
1864
1906
|
"name": "api-key",
|
|
1865
1907
|
"hasDynamicHelp": false,
|
|
1866
1908
|
"multiple": false,
|
|
1867
1909
|
"type": "option"
|
|
1910
|
+
},
|
|
1911
|
+
"provider-base-url": {
|
|
1912
|
+
"description": "Custom base URL (for --provider custom or to override)",
|
|
1913
|
+
"name": "provider-base-url",
|
|
1914
|
+
"hasDynamicHelp": false,
|
|
1915
|
+
"multiple": false,
|
|
1916
|
+
"type": "option"
|
|
1917
|
+
},
|
|
1918
|
+
"mode": {
|
|
1919
|
+
"description": "Gateway mode (byte_compatible/byte_messages/byte_generative)",
|
|
1920
|
+
"name": "mode",
|
|
1921
|
+
"hasDynamicHelp": false,
|
|
1922
|
+
"multiple": false,
|
|
1923
|
+
"type": "option"
|
|
1924
|
+
},
|
|
1925
|
+
"label": {
|
|
1926
|
+
"description": "Label for this connection",
|
|
1927
|
+
"name": "label",
|
|
1928
|
+
"hasDynamicHelp": false,
|
|
1929
|
+
"multiple": false,
|
|
1930
|
+
"type": "option"
|
|
1931
|
+
},
|
|
1932
|
+
"no-fetch": {
|
|
1933
|
+
"description": "Skip auto-importing the model list",
|
|
1934
|
+
"name": "no-fetch",
|
|
1935
|
+
"allowNo": false,
|
|
1936
|
+
"type": "boolean"
|
|
1868
1937
|
}
|
|
1869
1938
|
},
|
|
1870
1939
|
"hasDynamicHelp": false,
|
|
1871
1940
|
"hiddenAliases": [],
|
|
1872
|
-
"id": "providers:
|
|
1941
|
+
"id": "providers:add",
|
|
1873
1942
|
"pluginAlias": "@bytevion/cli",
|
|
1874
1943
|
"pluginName": "@bytevion/cli",
|
|
1875
1944
|
"pluginType": "core",
|
|
@@ -1880,19 +1949,24 @@
|
|
|
1880
1949
|
"dist",
|
|
1881
1950
|
"commands",
|
|
1882
1951
|
"providers",
|
|
1883
|
-
"
|
|
1952
|
+
"add.js"
|
|
1884
1953
|
]
|
|
1885
1954
|
},
|
|
1886
|
-
"providers:
|
|
1955
|
+
"providers:compare": {
|
|
1887
1956
|
"aliases": [],
|
|
1888
1957
|
"args": {
|
|
1889
|
-
"
|
|
1890
|
-
"description": "
|
|
1891
|
-
"name": "
|
|
1892
|
-
"required":
|
|
1958
|
+
"alias": {
|
|
1959
|
+
"description": "Model byte alias (omit when using --all)",
|
|
1960
|
+
"name": "alias",
|
|
1961
|
+
"required": false
|
|
1893
1962
|
}
|
|
1894
1963
|
},
|
|
1895
|
-
"description": "
|
|
1964
|
+
"description": "Enable (or disable) direct-vs-Byte comparison on imported models. Run with --all so `byte compare` works out of the box.",
|
|
1965
|
+
"examples": [
|
|
1966
|
+
"<%= config.bin %> providers compare --all",
|
|
1967
|
+
"<%= config.bin %> providers compare byte-2-deepseek-v4-flash",
|
|
1968
|
+
"<%= config.bin %> providers compare byte-2-deepseek-v4-flash --off"
|
|
1969
|
+
],
|
|
1896
1970
|
"flags": {
|
|
1897
1971
|
"json": {
|
|
1898
1972
|
"description": "Format output as json.",
|
|
@@ -1916,11 +1990,23 @@
|
|
|
1916
1990
|
"hasDynamicHelp": false,
|
|
1917
1991
|
"multiple": false,
|
|
1918
1992
|
"type": "option"
|
|
1993
|
+
},
|
|
1994
|
+
"all": {
|
|
1995
|
+
"description": "Apply to every priced model in the org",
|
|
1996
|
+
"name": "all",
|
|
1997
|
+
"allowNo": false,
|
|
1998
|
+
"type": "boolean"
|
|
1999
|
+
},
|
|
2000
|
+
"off": {
|
|
2001
|
+
"description": "Disable comparison instead of enabling it",
|
|
2002
|
+
"name": "off",
|
|
2003
|
+
"allowNo": false,
|
|
2004
|
+
"type": "boolean"
|
|
1919
2005
|
}
|
|
1920
2006
|
},
|
|
1921
2007
|
"hasDynamicHelp": false,
|
|
1922
2008
|
"hiddenAliases": [],
|
|
1923
|
-
"id": "providers:
|
|
2009
|
+
"id": "providers:compare",
|
|
1924
2010
|
"pluginAlias": "@bytevion/cli",
|
|
1925
2011
|
"pluginName": "@bytevion/cli",
|
|
1926
2012
|
"pluginType": "core",
|
|
@@ -1931,26 +2017,13 @@
|
|
|
1931
2017
|
"dist",
|
|
1932
2018
|
"commands",
|
|
1933
2019
|
"providers",
|
|
1934
|
-
"
|
|
2020
|
+
"compare.js"
|
|
1935
2021
|
]
|
|
1936
2022
|
},
|
|
1937
|
-
"
|
|
2023
|
+
"providers:list": {
|
|
1938
2024
|
"aliases": [],
|
|
1939
|
-
"args": {
|
|
1940
|
-
|
|
1941
|
-
"description": "Mode to apply",
|
|
1942
|
-
"name": "preset",
|
|
1943
|
-
"options": [
|
|
1944
|
-
"maximum",
|
|
1945
|
-
"max_savings",
|
|
1946
|
-
"balanced",
|
|
1947
|
-
"lowest_latency",
|
|
1948
|
-
"reliability_first"
|
|
1949
|
-
],
|
|
1950
|
-
"required": true
|
|
1951
|
-
}
|
|
1952
|
-
},
|
|
1953
|
-
"description": "Apply an optimization mode for the whole org (maximum, balanced, max_savings, lowest_latency, reliability_first).",
|
|
2025
|
+
"args": {},
|
|
2026
|
+
"description": "List upstream provider connections for the current org.",
|
|
1954
2027
|
"flags": {
|
|
1955
2028
|
"json": {
|
|
1956
2029
|
"description": "Format output as json.",
|
|
@@ -1978,7 +2051,7 @@
|
|
|
1978
2051
|
},
|
|
1979
2052
|
"hasDynamicHelp": false,
|
|
1980
2053
|
"hiddenAliases": [],
|
|
1981
|
-
"id": "
|
|
2054
|
+
"id": "providers:list",
|
|
1982
2055
|
"pluginAlias": "@bytevion/cli",
|
|
1983
2056
|
"pluginName": "@bytevion/cli",
|
|
1984
2057
|
"pluginType": "core",
|
|
@@ -1988,35 +2061,20 @@
|
|
|
1988
2061
|
"relativePath": [
|
|
1989
2062
|
"dist",
|
|
1990
2063
|
"commands",
|
|
1991
|
-
"
|
|
1992
|
-
"
|
|
2064
|
+
"providers",
|
|
2065
|
+
"list.js"
|
|
1993
2066
|
]
|
|
1994
2067
|
},
|
|
1995
|
-
"
|
|
2068
|
+
"providers:rotate": {
|
|
1996
2069
|
"aliases": [],
|
|
1997
2070
|
"args": {
|
|
1998
|
-
"
|
|
1999
|
-
"description": "
|
|
2000
|
-
"name": "
|
|
2001
|
-
"required": true
|
|
2002
|
-
},
|
|
2003
|
-
"value": {
|
|
2004
|
-
"description": "on or off",
|
|
2005
|
-
"name": "value",
|
|
2006
|
-
"options": [
|
|
2007
|
-
"on",
|
|
2008
|
-
"off",
|
|
2009
|
-
"true",
|
|
2010
|
-
"false"
|
|
2011
|
-
],
|
|
2071
|
+
"id": {
|
|
2072
|
+
"description": "Connection id (see `byte providers list`)",
|
|
2073
|
+
"name": "id",
|
|
2012
2074
|
"required": true
|
|
2013
2075
|
}
|
|
2014
2076
|
},
|
|
2015
|
-
"description": "
|
|
2016
|
-
"examples": [
|
|
2017
|
-
"<%= config.bin %> opt set compression_enabled off",
|
|
2018
|
-
"<%= config.bin %> opt set response_cache_enabled on"
|
|
2019
|
-
],
|
|
2077
|
+
"description": "Replace the upstream API key on a provider connection (keeps imported models).",
|
|
2020
2078
|
"flags": {
|
|
2021
2079
|
"json": {
|
|
2022
2080
|
"description": "Format output as json.",
|
|
@@ -2040,11 +2098,19 @@
|
|
|
2040
2098
|
"hasDynamicHelp": false,
|
|
2041
2099
|
"multiple": false,
|
|
2042
2100
|
"type": "option"
|
|
2101
|
+
},
|
|
2102
|
+
"api-key": {
|
|
2103
|
+
"description": "New upstream provider API key",
|
|
2104
|
+
"env": "BYTE_PROVIDER_KEY",
|
|
2105
|
+
"name": "api-key",
|
|
2106
|
+
"hasDynamicHelp": false,
|
|
2107
|
+
"multiple": false,
|
|
2108
|
+
"type": "option"
|
|
2043
2109
|
}
|
|
2044
2110
|
},
|
|
2045
2111
|
"hasDynamicHelp": false,
|
|
2046
2112
|
"hiddenAliases": [],
|
|
2047
|
-
"id": "
|
|
2113
|
+
"id": "providers:rotate",
|
|
2048
2114
|
"pluginAlias": "@bytevion/cli",
|
|
2049
2115
|
"pluginName": "@bytevion/cli",
|
|
2050
2116
|
"pluginType": "core",
|
|
@@ -2054,14 +2120,20 @@
|
|
|
2054
2120
|
"relativePath": [
|
|
2055
2121
|
"dist",
|
|
2056
2122
|
"commands",
|
|
2057
|
-
"
|
|
2058
|
-
"
|
|
2123
|
+
"providers",
|
|
2124
|
+
"rotate.js"
|
|
2059
2125
|
]
|
|
2060
2126
|
},
|
|
2061
|
-
"
|
|
2127
|
+
"providers:test": {
|
|
2062
2128
|
"aliases": [],
|
|
2063
|
-
"args": {
|
|
2064
|
-
|
|
2129
|
+
"args": {
|
|
2130
|
+
"id": {
|
|
2131
|
+
"description": "Connection id (see `byte providers list`)",
|
|
2132
|
+
"name": "id",
|
|
2133
|
+
"required": true
|
|
2134
|
+
}
|
|
2135
|
+
},
|
|
2136
|
+
"description": "Verify a provider connection by re-fetching its model list.",
|
|
2065
2137
|
"flags": {
|
|
2066
2138
|
"json": {
|
|
2067
2139
|
"description": "Format output as json.",
|
|
@@ -2089,7 +2161,7 @@
|
|
|
2089
2161
|
},
|
|
2090
2162
|
"hasDynamicHelp": false,
|
|
2091
2163
|
"hiddenAliases": [],
|
|
2092
|
-
"id": "
|
|
2164
|
+
"id": "providers:test",
|
|
2093
2165
|
"pluginAlias": "@bytevion/cli",
|
|
2094
2166
|
"pluginName": "@bytevion/cli",
|
|
2095
2167
|
"pluginType": "core",
|
|
@@ -2099,8 +2171,8 @@
|
|
|
2099
2171
|
"relativePath": [
|
|
2100
2172
|
"dist",
|
|
2101
2173
|
"commands",
|
|
2102
|
-
"
|
|
2103
|
-
"
|
|
2174
|
+
"providers",
|
|
2175
|
+
"test.js"
|
|
2104
2176
|
]
|
|
2105
2177
|
},
|
|
2106
2178
|
"sessions": {
|
|
@@ -2200,5 +2272,5 @@
|
|
|
2200
2272
|
]
|
|
2201
2273
|
}
|
|
2202
2274
|
},
|
|
2203
|
-
"version": "0.5.
|
|
2275
|
+
"version": "0.5.2"
|
|
2204
2276
|
}
|