@rupayan10/aios-cli 0.1.4 → 0.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.
- package/dist/cli.js +112 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3518,7 +3518,7 @@ var init_package = __esm({
|
|
|
3518
3518
|
"package.json"() {
|
|
3519
3519
|
package_default = {
|
|
3520
3520
|
name: "@rupayan10/aios-cli",
|
|
3521
|
-
version: "0.1.
|
|
3521
|
+
version: "0.1.5",
|
|
3522
3522
|
description: "FlowScale AIOS command-line interface",
|
|
3523
3523
|
license: "AGPL-3.0-only",
|
|
3524
3524
|
bin: {
|
|
@@ -8900,8 +8900,8 @@ var require_adm_zip = __commonJS({
|
|
|
8900
8900
|
return null;
|
|
8901
8901
|
}
|
|
8902
8902
|
function fixPath(zipPath) {
|
|
8903
|
-
const { join:
|
|
8904
|
-
return
|
|
8903
|
+
const { join: join5, normalize: normalize2, sep } = pth.posix;
|
|
8904
|
+
return join5(pth.isAbsolute(zipPath) ? "/" : ".", normalize2(sep + zipPath.split("\\").join(sep) + sep));
|
|
8905
8905
|
}
|
|
8906
8906
|
function filenameFilter(filterfn) {
|
|
8907
8907
|
if (filterfn instanceof RegExp) {
|
|
@@ -11138,6 +11138,113 @@ var init_assets2 = __esm({
|
|
|
11138
11138
|
}
|
|
11139
11139
|
});
|
|
11140
11140
|
|
|
11141
|
+
// src/core-ext/config.ts
|
|
11142
|
+
function getConfigSummary() {
|
|
11143
|
+
return {
|
|
11144
|
+
comfyui: {
|
|
11145
|
+
path: getComfyManagedPath() ?? null,
|
|
11146
|
+
installType: getComfyInstallType() ?? null,
|
|
11147
|
+
managedPort: getComfyManagedPort()
|
|
11148
|
+
},
|
|
11149
|
+
providers: listProviders().map((p) => ({ name: p.name, configured: p.configured, docsUrl: p.docsUrl }))
|
|
11150
|
+
};
|
|
11151
|
+
}
|
|
11152
|
+
function isProviderName(name) {
|
|
11153
|
+
return ALL_PROVIDER_NAMES.includes(name);
|
|
11154
|
+
}
|
|
11155
|
+
var init_config = __esm({
|
|
11156
|
+
"src/core-ext/config.ts"() {
|
|
11157
|
+
"use strict";
|
|
11158
|
+
init_provider_settings();
|
|
11159
|
+
}
|
|
11160
|
+
});
|
|
11161
|
+
|
|
11162
|
+
// src/commands/config.ts
|
|
11163
|
+
function registerConfig(program2) {
|
|
11164
|
+
const config = program2.command("config").description("View and set CLI configuration (~/.flowscale/aios)");
|
|
11165
|
+
config.addHelpText("after", `
|
|
11166
|
+
Examples:
|
|
11167
|
+
$ aios config show
|
|
11168
|
+
$ aios config show --json
|
|
11169
|
+
$ aios config comfyui-path ~/ComfyUI point the CLI at a ComfyUI install
|
|
11170
|
+
$ aios config provider-key fal sk-... set a cloud provider key
|
|
11171
|
+
$ aios config provider-key replicate --unset remove a key
|
|
11172
|
+
|
|
11173
|
+
Providers: ${ALL_PROVIDER_NAMES.join(", ")}. Keys are stored in ~/.flowscale/aios/provider-keys.json and never printed.`);
|
|
11174
|
+
const show = config.command("show").description("Show current config (provider keys are masked)").option("--json", "machine-readable JSON output");
|
|
11175
|
+
show.action(() => {
|
|
11176
|
+
const o2 = show.opts();
|
|
11177
|
+
const summary = getConfigSummary();
|
|
11178
|
+
if (o2.json) {
|
|
11179
|
+
process.stdout.write(renderJson(summary) + "\n");
|
|
11180
|
+
return;
|
|
11181
|
+
}
|
|
11182
|
+
process.stdout.write(`ComfyUI path: ${summary.comfyui.path ?? "(unset)"}
|
|
11183
|
+
`);
|
|
11184
|
+
process.stdout.write(`Install type: ${summary.comfyui.installType ?? "(unset)"}
|
|
11185
|
+
`);
|
|
11186
|
+
process.stdout.write(`Managed port: ${summary.comfyui.managedPort}
|
|
11187
|
+
|
|
11188
|
+
`);
|
|
11189
|
+
process.stdout.write("Provider keys:\n");
|
|
11190
|
+
for (const p of summary.providers) {
|
|
11191
|
+
process.stdout.write(` ${p.name.padEnd(12)} ${p.configured ? "set" : "\u2014"}
|
|
11192
|
+
`);
|
|
11193
|
+
}
|
|
11194
|
+
});
|
|
11195
|
+
const comfyPath = config.command("comfyui-path").description("Set the ComfyUI installation path the CLI manages").argument("<path>", "path to a ComfyUI install (the dir containing main.py)");
|
|
11196
|
+
comfyPath.action((p) => {
|
|
11197
|
+
if (!(0, import_node_fs6.existsSync)(p)) {
|
|
11198
|
+
process.stderr.write(`Path does not exist: ${p}
|
|
11199
|
+
`);
|
|
11200
|
+
process.exitCode = 1;
|
|
11201
|
+
return;
|
|
11202
|
+
}
|
|
11203
|
+
if (!(0, import_node_fs6.existsSync)((0, import_node_path3.join)(p, "main.py"))) {
|
|
11204
|
+
process.stderr.write(`Warning: no main.py in ${p} \u2014 is this a ComfyUI install?
|
|
11205
|
+
`);
|
|
11206
|
+
}
|
|
11207
|
+
setComfyManagedPath(p);
|
|
11208
|
+
process.stdout.write(`ComfyUI path set to ${p}
|
|
11209
|
+
`);
|
|
11210
|
+
});
|
|
11211
|
+
const providerKey = config.command("provider-key").description("Set or unset a cloud provider API key").argument("<provider>", `one of: ${ALL_PROVIDER_NAMES.join(", ")}`).argument("[key]", "the API key (omit when using --unset)").option("--unset", "remove the key instead of setting it");
|
|
11212
|
+
providerKey.action((provider, key) => {
|
|
11213
|
+
const o2 = providerKey.opts();
|
|
11214
|
+
if (!isProviderName(provider)) {
|
|
11215
|
+
process.stderr.write(`Unknown provider: ${provider}. Valid: ${ALL_PROVIDER_NAMES.join(", ")}
|
|
11216
|
+
`);
|
|
11217
|
+
process.exitCode = 1;
|
|
11218
|
+
return;
|
|
11219
|
+
}
|
|
11220
|
+
if (o2.unset) {
|
|
11221
|
+
deleteProviderKey(provider);
|
|
11222
|
+
process.stdout.write(`Removed ${provider} key
|
|
11223
|
+
`);
|
|
11224
|
+
return;
|
|
11225
|
+
}
|
|
11226
|
+
if (!key) {
|
|
11227
|
+
process.stderr.write("Provide a key, or use --unset to remove it\n");
|
|
11228
|
+
process.exitCode = 1;
|
|
11229
|
+
return;
|
|
11230
|
+
}
|
|
11231
|
+
setProviderKey(provider, key);
|
|
11232
|
+
process.stdout.write(`Set ${provider} key
|
|
11233
|
+
`);
|
|
11234
|
+
});
|
|
11235
|
+
}
|
|
11236
|
+
var import_node_fs6, import_node_path3;
|
|
11237
|
+
var init_config2 = __esm({
|
|
11238
|
+
"src/commands/config.ts"() {
|
|
11239
|
+
"use strict";
|
|
11240
|
+
import_node_fs6 = require("node:fs");
|
|
11241
|
+
import_node_path3 = require("node:path");
|
|
11242
|
+
init_provider_settings();
|
|
11243
|
+
init_config();
|
|
11244
|
+
init_render();
|
|
11245
|
+
}
|
|
11246
|
+
});
|
|
11247
|
+
|
|
11141
11248
|
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
11142
11249
|
var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
|
|
11143
11250
|
var init_utils = __esm({
|
|
@@ -12290,6 +12397,7 @@ function buildProgram() {
|
|
|
12290
12397
|
registerModels(program2);
|
|
12291
12398
|
registerPlugins(program2);
|
|
12292
12399
|
registerAssets(program2);
|
|
12400
|
+
registerConfig(program2);
|
|
12293
12401
|
program2.addHelpText("after", `
|
|
12294
12402
|
Examples:
|
|
12295
12403
|
$ aios interactive menu (in a TTY)
|
|
@@ -12328,6 +12436,7 @@ var init_cli = __esm({
|
|
|
12328
12436
|
init_models();
|
|
12329
12437
|
init_plugins();
|
|
12330
12438
|
init_assets2();
|
|
12439
|
+
init_config2();
|
|
12331
12440
|
process.removeAllListeners("warning");
|
|
12332
12441
|
process.on("warning", (w) => {
|
|
12333
12442
|
if (w.name === "ExperimentalWarning" && /sqlite/i.test(w.message)) return;
|