@rupayan10/aios-cli 0.1.3 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +158 -3
  2. 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.3",
3521
+ version: "0.1.5",
3522
3522
  description: "FlowScale AIOS command-line interface",
3523
3523
  license: "AGPL-3.0-only",
3524
3524
  bin: {
@@ -5541,6 +5541,10 @@ var init_render = __esm({
5541
5541
  // src/commands/gpu.ts
5542
5542
  function registerGpu(program2) {
5543
5543
  const gpu = program2.command("gpu").description("GPU management");
5544
+ gpu.addHelpText("after", `
5545
+ Examples:
5546
+ $ aios gpu list
5547
+ $ aios gpu detect --json force re-detection (clears the cache)`);
5544
5548
  function printGpus(gpus, json) {
5545
5549
  if (json) {
5546
5550
  process.stdout.write(renderJson(gpus) + "\n");
@@ -8896,8 +8900,8 @@ var require_adm_zip = __commonJS({
8896
8900
  return null;
8897
8901
  }
8898
8902
  function fixPath(zipPath) {
8899
- const { join: join4, normalize: normalize2, sep } = pth.posix;
8900
- return join4(pth.isAbsolute(zipPath) ? "/" : ".", normalize2(sep + zipPath.split("\\").join(sep) + sep));
8903
+ const { join: join5, normalize: normalize2, sep } = pth.posix;
8904
+ return join5(pth.isAbsolute(zipPath) ? "/" : ".", normalize2(sep + zipPath.split("\\").join(sep) + sep));
8901
8905
  }
8902
8906
  function filenameFilter(filterfn) {
8903
8907
  if (filterfn instanceof RegExp) {
@@ -10123,6 +10127,16 @@ function collectInput(val, acc) {
10123
10127
  }
10124
10128
  function registerTools(program2) {
10125
10129
  const tools = program2.command("tools").description("Tool management");
10130
+ tools.addHelpText("after", `
10131
+ Examples:
10132
+ $ aios tools build flux.json --name "Flux Dev" --instance auto
10133
+ $ aios tools build wf.json --inputs 6__text --outputs 9__images keep only a subset
10134
+ $ aios tools list --json
10135
+ $ aios tools run <id> --input 6__text="a cat" --input 4__image=@cat.png --instance auto
10136
+ $ aios tools show <executionId>
10137
+
10138
+ ComfyUI inputs are keyed <nodeId>__<paramName> (e.g. 6__text); plugin inputs use api__<paramName>.
10139
+ Prefix a value with @ to upload a local file (e.g. --input 4__image=@photo.png).`);
10126
10140
  const build = tools.command("build").description("Create a tool from a ComfyUI workflow JSON file").argument("<workflow.json>", "path to a ComfyUI workflow JSON file").option("--name <name>", "tool name (defaults to the filename)").option("--instance <id>", "a running instance to resolve widget names via /object_info").option("--inputs <keys>", "comma-separated nodeId__param input keys to keep (default: all)").option("--outputs <keys>", "comma-separated output keys to keep (default: all)").option("--json", "machine-readable JSON output");
10127
10141
  build.action(async (file) => {
10128
10142
  const o2 = build.opts();
@@ -10669,6 +10683,13 @@ var init_comfy_logs = __esm({
10669
10683
  // src/commands/comfy.ts
10670
10684
  function registerComfy(program2) {
10671
10685
  const comfy = program2.command("comfy").description("ComfyUI instance management");
10686
+ comfy.addHelpText("after", `
10687
+ Examples:
10688
+ $ aios comfy detect generate instance configs from detected GPUs
10689
+ $ aios comfy status which instances are alive
10690
+ $ aios comfy start gpu-0 start one instance (omit id to start all)
10691
+ $ aios comfy logs gpu-0 -n 100
10692
+ $ aios comfy stop gpu-0`);
10672
10693
  const status = comfy.command("status").description("Show ComfyUI instance status").option("--json", "machine-readable JSON output");
10673
10694
  status.action(() => {
10674
10695
  const json = Boolean(status.opts().json);
@@ -10803,6 +10824,10 @@ var init_model_scanner = __esm({
10803
10824
  // src/commands/models.ts
10804
10825
  function registerModels(program2) {
10805
10826
  const models = program2.command("models").description("Local model management");
10827
+ models.addHelpText("after", `
10828
+ Examples:
10829
+ $ aios models scan --instance auto HTTP-scan a running instance
10830
+ $ aios models list --type checkpoint --json`);
10806
10831
  const scan = models.command("scan").description("Scan a running ComfyUI instance for models").requiredOption("--instance <id>", 'instance id or "auto"').option("--json", "machine-readable JSON output");
10807
10832
  scan.action(async () => {
10808
10833
  const o2 = scan.opts();
@@ -10851,6 +10876,12 @@ var init_models = __esm({
10851
10876
  // src/commands/plugins.ts
10852
10877
  function registerPlugins(program2) {
10853
10878
  const plugins = program2.command("plugins").description("API-engine tool plugin management");
10879
+ plugins.addHelpText("after", `
10880
+ Examples:
10881
+ $ aios plugins install flux1-lora-trainer from the FlowScale registry
10882
+ $ aios plugins import ./my-plugin local dir or a GitHub URL
10883
+ $ aios plugins start flux1-lora-trainer
10884
+ $ aios tools run flux1-lora-trainer-builtin --input api__prompt="a cat" --start`);
10854
10885
  const list = plugins.command("list").description("List locally installed tool plugins").option("--json", "machine-readable JSON output");
10855
10886
  list.action(() => {
10856
10887
  const o2 = list.opts();
@@ -11033,6 +11064,11 @@ var init_open_file = __esm({
11033
11064
  // src/commands/assets.ts
11034
11065
  function registerAssets(program2) {
11035
11066
  const assets = program2.command("assets").description("Saved execution outputs (assets)");
11067
+ assets.addHelpText("after", `
11068
+ Examples:
11069
+ $ aios assets list --tool <id> --json
11070
+ $ aios assets show <executionId>
11071
+ $ aios assets open <executionId> open the first output in your viewer`);
11036
11072
  const list = assets.command("list").description("List completed execution outputs resolved to disk").option("--tool <id>", "filter by tool id").option("--json", "machine-readable JSON output");
11037
11073
  list.action(() => {
11038
11074
  const o2 = list.opts();
@@ -11102,6 +11138,113 @@ var init_assets2 = __esm({
11102
11138
  }
11103
11139
  });
11104
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
+
11105
11248
  // node_modules/fast-string-truncated-width/dist/utils.js
11106
11249
  var getCodePointsLength, isFullWidth, isWideNotCJKTNotEmoji;
11107
11250
  var init_utils = __esm({
@@ -12254,6 +12397,17 @@ function buildProgram() {
12254
12397
  registerModels(program2);
12255
12398
  registerPlugins(program2);
12256
12399
  registerAssets(program2);
12400
+ registerConfig(program2);
12401
+ program2.addHelpText("after", `
12402
+ Examples:
12403
+ $ aios interactive menu (in a TTY)
12404
+ $ aios gpu list show detected GPUs
12405
+ $ aios comfy detect && aios comfy start gpu-0 configure + launch an instance
12406
+ $ aios tools build workflow.json --instance auto build a tool from a workflow
12407
+ $ aios tools run <toolId> --input 6__text="a cat" --instance auto
12408
+ $ aios assets open <executionId> open the rendered output
12409
+
12410
+ Add --json to most commands for scripting. Run \`aios help <command>\` for per-command examples.`);
12257
12411
  return program2;
12258
12412
  }
12259
12413
  async function main(argv) {
@@ -12282,6 +12436,7 @@ var init_cli = __esm({
12282
12436
  init_models();
12283
12437
  init_plugins();
12284
12438
  init_assets2();
12439
+ init_config2();
12285
12440
  process.removeAllListeners("warning");
12286
12441
  process.on("warning", (w) => {
12287
12442
  if (w.name === "ExperimentalWarning" && /sqlite/i.test(w.message)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rupayan10/aios-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "FlowScale AIOS command-line interface",
5
5
  "license": "AGPL-3.0-only",
6
6
  "bin": {