@bytevion/cli 0.1.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.
- package/bin/run.js +7 -0
- package/dist/base.d.ts +20 -0
- package/dist/base.js +49 -0
- package/dist/commands/batch/list.d.ts +5 -0
- package/dist/commands/batch/list.js +22 -0
- package/dist/commands/batch/poll.d.ts +13 -0
- package/dist/commands/batch/poll.js +42 -0
- package/dist/commands/batch/submit.d.ts +13 -0
- package/dist/commands/batch/submit.js +74 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.js +65 -0
- package/dist/commands/env.d.ts +10 -0
- package/dist/commands/env.js +35 -0
- package/dist/commands/init.d.ts +12 -0
- package/dist/commands/init.js +58 -0
- package/dist/commands/integrate.d.ts +20 -0
- package/dist/commands/integrate.js +133 -0
- package/dist/commands/keys/create.d.ts +11 -0
- package/dist/commands/keys/create.js +33 -0
- package/dist/commands/keys/list.d.ts +5 -0
- package/dist/commands/keys/list.js +21 -0
- package/dist/commands/keys/revoke.d.ts +11 -0
- package/dist/commands/keys/revoke.js +19 -0
- package/dist/commands/keys/rotate.d.ts +11 -0
- package/dist/commands/keys/rotate.js +24 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.js +76 -0
- package/dist/commands/logout.d.ts +5 -0
- package/dist/commands/logout.js +24 -0
- package/dist/commands/opt/preset.d.ts +8 -0
- package/dist/commands/opt/preset.js +23 -0
- package/dist/commands/opt/set.d.ts +10 -0
- package/dist/commands/opt/set.js +22 -0
- package/dist/commands/opt/show.d.ts +5 -0
- package/dist/commands/opt/show.js +24 -0
- package/dist/commands/providers/add.d.ts +12 -0
- package/dist/commands/providers/add.js +40 -0
- package/dist/commands/providers/list.d.ts +5 -0
- package/dist/commands/providers/list.js +22 -0
- package/dist/commands/providers/rotate.d.ts +14 -0
- package/dist/commands/providers/rotate.js +28 -0
- package/dist/commands/providers/test.d.ts +11 -0
- package/dist/commands/providers/test.js +22 -0
- package/dist/commands/run.d.ts +13 -0
- package/dist/commands/run.js +32 -0
- package/dist/commands/sessions/index.d.ts +5 -0
- package/dist/commands/sessions/index.js +21 -0
- package/dist/commands/sessions/revoke.d.ts +8 -0
- package/dist/commands/sessions/revoke.js +19 -0
- package/dist/commands/stats.d.ts +5 -0
- package/dist/commands/stats.js +27 -0
- package/dist/commands/usage.d.ts +8 -0
- package/dist/commands/usage.js +32 -0
- package/dist/commands/whoami.d.ts +5 -0
- package/dist/commands/whoami.js +19 -0
- package/dist/lib/api.d.ts +40 -0
- package/dist/lib/api.js +147 -0
- package/dist/lib/config.d.ts +20 -0
- package/dist/lib/config.js +52 -0
- package/dist/lib/credentials.d.ts +5 -0
- package/dist/lib/credentials.js +50 -0
- package/dist/lib/errors.d.ts +7 -0
- package/dist/lib/errors.js +30 -0
- package/dist/lib/integrations.d.ts +23 -0
- package/dist/lib/integrations.js +145 -0
- package/dist/lib/output.d.ts +4 -0
- package/dist/lib/output.js +37 -0
- package/dist/lib/paths.d.ts +3 -0
- package/dist/lib/paths.js +19 -0
- package/dist/lib/shell.d.ts +4 -0
- package/dist/lib/shell.js +25 -0
- package/dist/lib/util.d.ts +4 -0
- package/dist/lib/util.js +101 -0
- package/oclif.manifest.json +1516 -0
- package/package.json +59 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.detectShell = detectShell;
|
|
4
|
+
exports.formatEnv = formatEnv;
|
|
5
|
+
exports.formatEnvBlock = formatEnvBlock;
|
|
6
|
+
function detectShell(override) {
|
|
7
|
+
if (override)
|
|
8
|
+
return override;
|
|
9
|
+
return process.platform === 'win32' ? 'powershell' : 'bash';
|
|
10
|
+
}
|
|
11
|
+
function formatEnv(shell, key, value) {
|
|
12
|
+
switch (shell) {
|
|
13
|
+
case 'fish':
|
|
14
|
+
return `set -x ${key} "${value}"`;
|
|
15
|
+
case 'powershell':
|
|
16
|
+
return `$env:${key} = "${value}"`;
|
|
17
|
+
case 'cmd':
|
|
18
|
+
return `set ${key}=${value}`;
|
|
19
|
+
default:
|
|
20
|
+
return `export ${key}="${value}"`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function formatEnvBlock(shell, vars) {
|
|
24
|
+
return vars.map(([k, v]) => formatEnv(shell, k, v)).join('\n');
|
|
25
|
+
}
|
package/dist/lib/util.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.sleep = sleep;
|
|
37
|
+
exports.openBrowser = openBrowser;
|
|
38
|
+
exports.prompt = prompt;
|
|
39
|
+
exports.promptHidden = promptHidden;
|
|
40
|
+
const node_child_process_1 = require("node:child_process");
|
|
41
|
+
const readline = __importStar(require("node:readline/promises"));
|
|
42
|
+
function sleep(ms) {
|
|
43
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
44
|
+
}
|
|
45
|
+
async function openBrowser(url) {
|
|
46
|
+
const platform = process.platform;
|
|
47
|
+
if (platform === 'win32') {
|
|
48
|
+
(0, node_child_process_1.spawn)('cmd', ['/c', 'start', '', url], { stdio: 'ignore', detached: true }).unref();
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const cmd = platform === 'darwin' ? 'open' : 'xdg-open';
|
|
52
|
+
(0, node_child_process_1.spawn)(cmd, [url], { stdio: 'ignore', detached: true }).unref();
|
|
53
|
+
}
|
|
54
|
+
async function prompt(question) {
|
|
55
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
56
|
+
try {
|
|
57
|
+
const answer = await rl.question(question);
|
|
58
|
+
return answer.trim();
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
rl.close();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// Byte codes for control keys (avoids embedding raw control characters).
|
|
65
|
+
const CR = 13;
|
|
66
|
+
const LF = 10;
|
|
67
|
+
const CTRL_C = 3;
|
|
68
|
+
const BACKSPACE = 8;
|
|
69
|
+
const DEL = 127;
|
|
70
|
+
async function promptHidden(question) {
|
|
71
|
+
const stdin = process.stdin;
|
|
72
|
+
if (!stdin.isTTY)
|
|
73
|
+
return prompt(question);
|
|
74
|
+
process.stdout.write(question);
|
|
75
|
+
return new Promise((resolve) => {
|
|
76
|
+
let input = '';
|
|
77
|
+
stdin.resume();
|
|
78
|
+
stdin.setRawMode(true);
|
|
79
|
+
const onData = (chunk) => {
|
|
80
|
+
const code = chunk[0];
|
|
81
|
+
if (code === CR || code === LF) {
|
|
82
|
+
stdin.setRawMode(false);
|
|
83
|
+
stdin.pause();
|
|
84
|
+
stdin.removeListener('data', onData);
|
|
85
|
+
process.stdout.write('\n');
|
|
86
|
+
resolve(input.trim());
|
|
87
|
+
}
|
|
88
|
+
else if (code === CTRL_C) {
|
|
89
|
+
process.stdout.write('\n');
|
|
90
|
+
process.exit(130);
|
|
91
|
+
}
|
|
92
|
+
else if (code === BACKSPACE || code === DEL) {
|
|
93
|
+
input = input.slice(0, -1);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
input += chunk.toString('utf8');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
stdin.on('data', onData);
|
|
100
|
+
});
|
|
101
|
+
}
|