@xano/cli 0.0.7 → 0.0.9

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.
@@ -15,5 +15,7 @@ export default class EphemeralRunJob extends BaseCommand {
15
15
  run(): Promise<void>;
16
16
  private editFile;
17
17
  private readStdin;
18
+ private isUrl;
19
+ private fetchContent;
18
20
  private loadCredentials;
19
21
  }
@@ -16,7 +16,7 @@ export default class EphemeralRunJob extends BaseCommand {
16
16
  }),
17
17
  file: Flags.string({
18
18
  char: 'f',
19
- description: 'Path to file containing XanoScript code',
19
+ description: 'Path or URL to file containing XanoScript code',
20
20
  required: false,
21
21
  exclusive: ['stdin'],
22
22
  }),
@@ -43,7 +43,7 @@ export default class EphemeralRunJob extends BaseCommand {
43
43
  }),
44
44
  args: Flags.string({
45
45
  char: 'a',
46
- description: 'Path to JSON file containing input arguments',
46
+ description: 'Path or URL to JSON file containing input arguments',
47
47
  required: false,
48
48
  }),
49
49
  };
@@ -113,26 +113,20 @@ Job executed successfully!
113
113
  // Read XanoScript content
114
114
  let xanoscript;
115
115
  if (flags.file) {
116
- // Read from file
117
- let fileToRead = flags.file;
118
- // If edit flag is set, copy to temp file and open in editor
119
- if (flags.edit) {
120
- fileToRead = await this.editFile(flags.file);
121
- }
122
- try {
116
+ // If edit flag is set and source is not a URL, copy to temp file and open in editor
117
+ if (flags.edit && !this.isUrl(flags.file)) {
118
+ const fileToRead = await this.editFile(flags.file);
123
119
  xanoscript = fs.readFileSync(fileToRead, 'utf8');
124
- // Clean up temp file if it was created
125
- if (flags.edit && fileToRead !== flags.file) {
126
- try {
127
- fs.unlinkSync(fileToRead);
128
- }
129
- catch {
130
- // Ignore cleanup errors
131
- }
120
+ // Clean up temp file
121
+ try {
122
+ fs.unlinkSync(fileToRead);
123
+ }
124
+ catch {
125
+ // Ignore cleanup errors
132
126
  }
133
127
  }
134
- catch (error) {
135
- this.error(`Failed to read file '${fileToRead}': ${error}`);
128
+ else {
129
+ xanoscript = await this.fetchContent(flags.file);
136
130
  }
137
131
  }
138
132
  else if (flags.stdin) {
@@ -151,15 +145,15 @@ Job executed successfully!
151
145
  if (!xanoscript || xanoscript.trim().length === 0) {
152
146
  this.error('XanoScript content is empty');
153
147
  }
154
- // Load args from JSON file if provided
148
+ // Load args from JSON file or URL if provided
155
149
  let inputArgs;
156
150
  if (flags.args) {
157
151
  try {
158
- const argsContent = fs.readFileSync(flags.args, 'utf8');
152
+ const argsContent = await this.fetchContent(flags.args);
159
153
  inputArgs = JSON.parse(argsContent);
160
154
  }
161
155
  catch (error) {
162
- this.error(`Failed to read or parse args file '${flags.args}': ${error}`);
156
+ this.error(`Failed to read or parse args '${flags.args}': ${error}`);
163
157
  }
164
158
  }
165
159
  // Construct the API URL
@@ -294,6 +288,31 @@ Job executed successfully!
294
288
  process.stdin.resume();
295
289
  });
296
290
  }
291
+ isUrl(str) {
292
+ return str.startsWith('http://') || str.startsWith('https://');
293
+ }
294
+ async fetchContent(source) {
295
+ if (this.isUrl(source)) {
296
+ try {
297
+ const response = await fetch(source);
298
+ if (!response.ok) {
299
+ this.error(`Failed to fetch '${source}': ${response.status} ${response.statusText}`);
300
+ }
301
+ return await response.text();
302
+ }
303
+ catch (error) {
304
+ this.error(`Failed to fetch '${source}': ${error}`);
305
+ }
306
+ }
307
+ else {
308
+ try {
309
+ return fs.readFileSync(source, 'utf8');
310
+ }
311
+ catch (error) {
312
+ this.error(`Failed to read file '${source}': ${error}`);
313
+ }
314
+ }
315
+ }
297
316
  loadCredentials() {
298
317
  const configDir = path.join(os.homedir(), '.xano');
299
318
  const credentialsPath = path.join(configDir, 'credentials.yaml');
@@ -14,5 +14,7 @@ export default class EphemeralRunService extends BaseCommand {
14
14
  run(): Promise<void>;
15
15
  private editFile;
16
16
  private readStdin;
17
+ private isUrl;
18
+ private fetchContent;
17
19
  private loadCredentials;
18
20
  }
@@ -16,7 +16,7 @@ export default class EphemeralRunService extends BaseCommand {
16
16
  }),
17
17
  file: Flags.string({
18
18
  char: 'f',
19
- description: 'Path to file containing XanoScript code',
19
+ description: 'Path or URL to file containing XanoScript code',
20
20
  required: false,
21
21
  exclusive: ['stdin'],
22
22
  }),
@@ -103,26 +103,20 @@ Service created successfully!
103
103
  // Read XanoScript content
104
104
  let xanoscript;
105
105
  if (flags.file) {
106
- // Read from file
107
- let fileToRead = flags.file;
108
- // If edit flag is set, copy to temp file and open in editor
109
- if (flags.edit) {
110
- fileToRead = await this.editFile(flags.file);
111
- }
112
- try {
106
+ // If edit flag is set and source is not a URL, copy to temp file and open in editor
107
+ if (flags.edit && !this.isUrl(flags.file)) {
108
+ const fileToRead = await this.editFile(flags.file);
113
109
  xanoscript = fs.readFileSync(fileToRead, 'utf8');
114
- // Clean up temp file if it was created
115
- if (flags.edit && fileToRead !== flags.file) {
116
- try {
117
- fs.unlinkSync(fileToRead);
118
- }
119
- catch {
120
- // Ignore cleanup errors
121
- }
110
+ // Clean up temp file
111
+ try {
112
+ fs.unlinkSync(fileToRead);
113
+ }
114
+ catch {
115
+ // Ignore cleanup errors
122
116
  }
123
117
  }
124
- catch (error) {
125
- this.error(`Failed to read file '${fileToRead}': ${error}`);
118
+ else {
119
+ xanoscript = await this.fetchContent(flags.file);
126
120
  }
127
121
  }
128
122
  else if (flags.stdin) {
@@ -266,6 +260,31 @@ Service created successfully!
266
260
  process.stdin.resume();
267
261
  });
268
262
  }
263
+ isUrl(str) {
264
+ return str.startsWith('http://') || str.startsWith('https://');
265
+ }
266
+ async fetchContent(source) {
267
+ if (this.isUrl(source)) {
268
+ try {
269
+ const response = await fetch(source);
270
+ if (!response.ok) {
271
+ this.error(`Failed to fetch '${source}': ${response.status} ${response.statusText}`);
272
+ }
273
+ return await response.text();
274
+ }
275
+ catch (error) {
276
+ this.error(`Failed to fetch '${source}': ${error}`);
277
+ }
278
+ }
279
+ else {
280
+ try {
281
+ return fs.readFileSync(source, 'utf8');
282
+ }
283
+ catch (error) {
284
+ this.error(`Failed to read file '${source}': ${error}`);
285
+ }
286
+ }
287
+ }
269
288
  loadCredentials() {
270
289
  const configDir = path.join(os.homedir(), '.xano');
271
290
  const credentialsPath = path.join(configDir, 'credentials.yaml');
@@ -1,31 +1,5 @@
1
1
  {
2
2
  "commands": {
3
- "profile:get-default": {
4
- "aliases": [],
5
- "args": {},
6
- "description": "Get the current default profile name",
7
- "examples": [
8
- "$ xano profile:get-default\nproduction\n",
9
- "$ xano profile:get-default\nNo default profile set\n"
10
- ],
11
- "flags": {},
12
- "hasDynamicHelp": false,
13
- "hiddenAliases": [],
14
- "id": "profile:get-default",
15
- "pluginAlias": "@xano/cli",
16
- "pluginName": "@xano/cli",
17
- "pluginType": "core",
18
- "strict": true,
19
- "enableJsonFlag": false,
20
- "isESM": true,
21
- "relativePath": [
22
- "dist",
23
- "commands",
24
- "profile",
25
- "get-default",
26
- "index.js"
27
- ]
28
- },
29
3
  "profile:create": {
30
4
  "aliases": [],
31
5
  "args": {
@@ -113,6 +87,48 @@
113
87
  "index.js"
114
88
  ]
115
89
  },
90
+ "profile:delete": {
91
+ "aliases": [],
92
+ "args": {
93
+ "name": {
94
+ "description": "Profile name to delete",
95
+ "name": "name",
96
+ "required": true
97
+ }
98
+ },
99
+ "description": "Delete a profile configuration",
100
+ "examples": [
101
+ "$ xano profile:delete old-profile\nAre you sure you want to delete profile 'old-profile'? (y/n): y\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n",
102
+ "$ xano profile:delete old-profile --force\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n",
103
+ "$ xano profile:delete old-profile -f\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n"
104
+ ],
105
+ "flags": {
106
+ "force": {
107
+ "char": "f",
108
+ "description": "Skip confirmation prompt",
109
+ "name": "force",
110
+ "required": false,
111
+ "allowNo": false,
112
+ "type": "boolean"
113
+ }
114
+ },
115
+ "hasDynamicHelp": false,
116
+ "hiddenAliases": [],
117
+ "id": "profile:delete",
118
+ "pluginAlias": "@xano/cli",
119
+ "pluginName": "@xano/cli",
120
+ "pluginType": "core",
121
+ "strict": true,
122
+ "enableJsonFlag": false,
123
+ "isESM": true,
124
+ "relativePath": [
125
+ "dist",
126
+ "commands",
127
+ "profile",
128
+ "delete",
129
+ "index.js"
130
+ ]
131
+ },
116
132
  "profile:edit": {
117
133
  "aliases": [],
118
134
  "args": {
@@ -207,34 +223,18 @@
207
223
  "index.js"
208
224
  ]
209
225
  },
210
- "profile:delete": {
226
+ "profile:get-default": {
211
227
  "aliases": [],
212
- "args": {
213
- "name": {
214
- "description": "Profile name to delete",
215
- "name": "name",
216
- "required": true
217
- }
218
- },
219
- "description": "Delete a profile configuration",
228
+ "args": {},
229
+ "description": "Get the current default profile name",
220
230
  "examples": [
221
- "$ xano profile:delete old-profile\nAre you sure you want to delete profile 'old-profile'? (y/n): y\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n",
222
- "$ xano profile:delete old-profile --force\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n",
223
- "$ xano profile:delete old-profile -f\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n"
231
+ "$ xano profile:get-default\nproduction\n",
232
+ "$ xano profile:get-default\nNo default profile set\n"
224
233
  ],
225
- "flags": {
226
- "force": {
227
- "char": "f",
228
- "description": "Skip confirmation prompt",
229
- "name": "force",
230
- "required": false,
231
- "allowNo": false,
232
- "type": "boolean"
233
- }
234
- },
234
+ "flags": {},
235
235
  "hasDynamicHelp": false,
236
236
  "hiddenAliases": [],
237
- "id": "profile:delete",
237
+ "id": "profile:get-default",
238
238
  "pluginAlias": "@xano/cli",
239
239
  "pluginName": "@xano/cli",
240
240
  "pluginType": "core",
@@ -245,7 +245,7 @@
245
245
  "dist",
246
246
  "commands",
247
247
  "profile",
248
- "delete",
248
+ "get-default",
249
249
  "index.js"
250
250
  ]
251
251
  },
@@ -362,23 +362,16 @@
362
362
  "index.js"
363
363
  ]
364
364
  },
365
- "function:get": {
365
+ "function:create": {
366
366
  "aliases": [],
367
- "args": {
368
- "function_id": {
369
- "description": "Function ID",
370
- "name": "function_id",
371
- "required": false
372
- }
373
- },
374
- "description": "Get a specific function from a workspace",
367
+ "args": {},
368
+ "description": "Create a new function in a workspace",
375
369
  "examples": [
376
- "$ xano function:get 145 -w 40\nFunction: yo (ID: 145)\nCreated: 2025-10-10 10:30:00\nDescription: Sample function\n",
377
- "$ xano function:get 145 --profile production\nFunction: yo (ID: 145)\nCreated: 2025-10-10 10:30:00\n",
378
- "$ xano function:get\nSelect a function:\n yo (ID: 145) - Sample function\n another-func (ID: 146)\n",
379
- "$ xano function:get 145 -w 40 --output json\n{\n \"id\": 145,\n \"name\": \"yo\",\n \"description\": \"Sample function\"\n}\n",
380
- "$ xano function:get 145 -p staging -o json --include_draft\n{\n \"id\": 145,\n \"name\": \"yo\"\n}\n",
381
- "$ xano function:get 145 -p staging -o xs\nfunction yo {\n input {\n }\n stack {\n }\n response = null\n}\n"
370
+ "$ xano function:create -w 40 -f function.xs\nFunction created successfully!\nID: 123\nName: my_function\n",
371
+ "$ xano function:create -f function.xs\nFunction created successfully!\nID: 123\nName: my_function\n",
372
+ "$ xano function:create -w 40 -f function.xs --edit\n# Opens function.xs in $EDITOR, then creates function with edited content\nFunction created successfully!\nID: 123\nName: my_function\n",
373
+ "$ cat function.xs | xano function:create -w 40 --stdin\nFunction created successfully!\nID: 123\nName: my_function\n",
374
+ "$ xano function:create -w 40 -f function.xs -o json\n{\n \"id\": 123,\n \"name\": \"my_function\",\n ...\n}\n"
382
375
  ],
383
376
  "flags": {
384
377
  "profile": {
@@ -400,39 +393,58 @@
400
393
  "multiple": false,
401
394
  "type": "option"
402
395
  },
403
- "output": {
404
- "char": "o",
405
- "description": "Output format",
406
- "name": "output",
396
+ "file": {
397
+ "char": "f",
398
+ "description": "Path to file containing XanoScript code",
399
+ "exclusive": [
400
+ "stdin"
401
+ ],
402
+ "name": "file",
407
403
  "required": false,
408
- "default": "summary",
409
404
  "hasDynamicHelp": false,
410
405
  "multiple": false,
411
- "options": [
412
- "summary",
413
- "json",
414
- "xs"
415
- ],
416
406
  "type": "option"
417
407
  },
418
- "include_draft": {
419
- "description": "Include draft version",
420
- "name": "include_draft",
408
+ "stdin": {
409
+ "char": "s",
410
+ "description": "Read XanoScript code from stdin",
411
+ "exclusive": [
412
+ "file"
413
+ ],
414
+ "name": "stdin",
421
415
  "required": false,
422
416
  "allowNo": false,
423
417
  "type": "boolean"
424
418
  },
425
- "include_xanoscript": {
426
- "description": "Include XanoScript in response",
427
- "name": "include_xanoscript",
419
+ "edit": {
420
+ "char": "e",
421
+ "dependsOn": [
422
+ "file"
423
+ ],
424
+ "description": "Open file in editor before creating function (requires --file)",
425
+ "name": "edit",
428
426
  "required": false,
429
427
  "allowNo": false,
430
428
  "type": "boolean"
429
+ },
430
+ "output": {
431
+ "char": "o",
432
+ "description": "Output format",
433
+ "name": "output",
434
+ "required": false,
435
+ "default": "summary",
436
+ "hasDynamicHelp": false,
437
+ "multiple": false,
438
+ "options": [
439
+ "summary",
440
+ "json"
441
+ ],
442
+ "type": "option"
431
443
  }
432
444
  },
433
445
  "hasDynamicHelp": false,
434
446
  "hiddenAliases": [],
435
- "id": "function:get",
447
+ "id": "function:create",
436
448
  "pluginAlias": "@xano/cli",
437
449
  "pluginName": "@xano/cli",
438
450
  "pluginType": "core",
@@ -443,7 +455,7 @@
443
455
  "dist",
444
456
  "commands",
445
457
  "function",
446
- "get",
458
+ "create",
447
459
  "index.js"
448
460
  ]
449
461
  },
@@ -557,6 +569,91 @@
557
569
  "index.js"
558
570
  ]
559
571
  },
572
+ "function:get": {
573
+ "aliases": [],
574
+ "args": {
575
+ "function_id": {
576
+ "description": "Function ID",
577
+ "name": "function_id",
578
+ "required": false
579
+ }
580
+ },
581
+ "description": "Get a specific function from a workspace",
582
+ "examples": [
583
+ "$ xano function:get 145 -w 40\nFunction: yo (ID: 145)\nCreated: 2025-10-10 10:30:00\nDescription: Sample function\n",
584
+ "$ xano function:get 145 --profile production\nFunction: yo (ID: 145)\nCreated: 2025-10-10 10:30:00\n",
585
+ "$ xano function:get\nSelect a function:\n ❯ yo (ID: 145) - Sample function\n another-func (ID: 146)\n",
586
+ "$ xano function:get 145 -w 40 --output json\n{\n \"id\": 145,\n \"name\": \"yo\",\n \"description\": \"Sample function\"\n}\n",
587
+ "$ xano function:get 145 -p staging -o json --include_draft\n{\n \"id\": 145,\n \"name\": \"yo\"\n}\n",
588
+ "$ xano function:get 145 -p staging -o xs\nfunction yo {\n input {\n }\n stack {\n }\n response = null\n}\n"
589
+ ],
590
+ "flags": {
591
+ "profile": {
592
+ "char": "p",
593
+ "description": "Profile to use for this command",
594
+ "env": "XANO_PROFILE",
595
+ "name": "profile",
596
+ "required": false,
597
+ "hasDynamicHelp": false,
598
+ "multiple": false,
599
+ "type": "option"
600
+ },
601
+ "workspace": {
602
+ "char": "w",
603
+ "description": "Workspace ID (optional if set in profile)",
604
+ "name": "workspace",
605
+ "required": false,
606
+ "hasDynamicHelp": false,
607
+ "multiple": false,
608
+ "type": "option"
609
+ },
610
+ "output": {
611
+ "char": "o",
612
+ "description": "Output format",
613
+ "name": "output",
614
+ "required": false,
615
+ "default": "summary",
616
+ "hasDynamicHelp": false,
617
+ "multiple": false,
618
+ "options": [
619
+ "summary",
620
+ "json",
621
+ "xs"
622
+ ],
623
+ "type": "option"
624
+ },
625
+ "include_draft": {
626
+ "description": "Include draft version",
627
+ "name": "include_draft",
628
+ "required": false,
629
+ "allowNo": false,
630
+ "type": "boolean"
631
+ },
632
+ "include_xanoscript": {
633
+ "description": "Include XanoScript in response",
634
+ "name": "include_xanoscript",
635
+ "required": false,
636
+ "allowNo": false,
637
+ "type": "boolean"
638
+ }
639
+ },
640
+ "hasDynamicHelp": false,
641
+ "hiddenAliases": [],
642
+ "id": "function:get",
643
+ "pluginAlias": "@xano/cli",
644
+ "pluginName": "@xano/cli",
645
+ "pluginType": "core",
646
+ "strict": true,
647
+ "enableJsonFlag": false,
648
+ "isESM": true,
649
+ "relativePath": [
650
+ "dist",
651
+ "commands",
652
+ "function",
653
+ "get",
654
+ "index.js"
655
+ ]
656
+ },
560
657
  "function:list": {
561
658
  "aliases": [],
562
659
  "args": {},
@@ -753,17 +850,15 @@
753
850
  "index.js"
754
851
  ]
755
852
  },
756
- "ephemeral:run:job": {
853
+ "workspace:list": {
757
854
  "aliases": [],
758
855
  "args": {},
759
- "description": "Run an ephemeral job in a workspace",
856
+ "description": "List all workspaces from the Xano Metadata API",
760
857
  "examples": [
761
- "$ xano ephemeral:run:job -w 1 -f script.xs\nJob executed successfully!\n...\n",
762
- "$ xano ephemeral:run:job -f script.xs\nJob executed successfully!\n...\n",
763
- "$ xano ephemeral:run:job -w 1 -f script.xs --edit\n# Opens script.xs in $EDITOR, then runs job with edited content\nJob executed successfully!\n...\n",
764
- "$ cat script.xs | xano ephemeral:run:job -w 1 --stdin\nJob executed successfully!\n...\n",
765
- "$ xano ephemeral:run:job -w 1 -f script.xs -o json\n{\n \"job\": { \"id\": 1, \"run\": { \"id\": 1 } },\n \"result\": { ... }\n}\n",
766
- "$ xano ephemeral:run:job -w 1 -f script.xs -a args.json\n# Runs job with input arguments from args.json\nJob executed successfully!\n...\n"
858
+ "$ xano workspace:list\nAvailable workspaces:\n - workspace-1 (ID: 1)\n - workspace-2 (ID: 2)\n - workspace-3 (ID: 3)\n",
859
+ "$ xano workspace:list --profile production\nAvailable workspaces:\n - my-app (ID: 1)\n - staging-env (ID: 2)\n",
860
+ "$ xano workspace:list --output json\n{\n \"workspaces\": [\n {\n \"id\": 1,\n \"name\": \"workspace-1\"\n },\n {\n \"id\": 2,\n \"name\": \"workspace-2\"\n }\n ]\n}\n",
861
+ "$ xano workspace:list -p staging -o json\n{\n \"workspaces\": [\n {\n \"id\": 1,\n \"name\": \"my-app\"\n }\n ]\n}\n"
767
862
  ],
768
863
  "flags": {
769
864
  "profile": {
@@ -776,49 +871,6 @@
776
871
  "multiple": false,
777
872
  "type": "option"
778
873
  },
779
- "workspace": {
780
- "char": "w",
781
- "description": "Workspace ID (optional if set in profile)",
782
- "name": "workspace",
783
- "required": false,
784
- "hasDynamicHelp": false,
785
- "multiple": false,
786
- "type": "option"
787
- },
788
- "file": {
789
- "char": "f",
790
- "description": "Path to file containing XanoScript code",
791
- "exclusive": [
792
- "stdin"
793
- ],
794
- "name": "file",
795
- "required": false,
796
- "hasDynamicHelp": false,
797
- "multiple": false,
798
- "type": "option"
799
- },
800
- "stdin": {
801
- "char": "s",
802
- "description": "Read XanoScript code from stdin",
803
- "exclusive": [
804
- "file"
805
- ],
806
- "name": "stdin",
807
- "required": false,
808
- "allowNo": false,
809
- "type": "boolean"
810
- },
811
- "edit": {
812
- "char": "e",
813
- "dependsOn": [
814
- "file"
815
- ],
816
- "description": "Open file in editor before running job (requires --file)",
817
- "name": "edit",
818
- "required": false,
819
- "allowNo": false,
820
- "type": "boolean"
821
- },
822
874
  "output": {
823
875
  "char": "o",
824
876
  "description": "Output format",
@@ -832,20 +884,11 @@
832
884
  "json"
833
885
  ],
834
886
  "type": "option"
835
- },
836
- "args": {
837
- "char": "a",
838
- "description": "Path to JSON file containing input arguments",
839
- "name": "args",
840
- "required": false,
841
- "hasDynamicHelp": false,
842
- "multiple": false,
843
- "type": "option"
844
887
  }
845
888
  },
846
889
  "hasDynamicHelp": false,
847
890
  "hiddenAliases": [],
848
- "id": "ephemeral:run:job",
891
+ "id": "workspace:list",
849
892
  "pluginAlias": "@xano/cli",
850
893
  "pluginName": "@xano/cli",
851
894
  "pluginType": "core",
@@ -855,22 +898,22 @@
855
898
  "relativePath": [
856
899
  "dist",
857
900
  "commands",
858
- "ephemeral",
859
- "run",
860
- "job",
901
+ "workspace",
902
+ "list",
861
903
  "index.js"
862
904
  ]
863
905
  },
864
- "ephemeral:run:service": {
906
+ "ephemeral:run:job": {
865
907
  "aliases": [],
866
908
  "args": {},
867
- "description": "Run an ephemeral service in a workspace",
909
+ "description": "Run an ephemeral job in a workspace",
868
910
  "examples": [
869
- "$ xano ephemeral:run:service -w 1 -f service.xs\nService created successfully!\n...\n",
870
- "$ xano ephemeral:run:service -f service.xs\nService created successfully!\n...\n",
871
- "$ xano ephemeral:run:service -w 1 -f service.xs --edit\n# Opens service.xs in $EDITOR, then creates service with edited content\nService created successfully!\n...\n",
872
- "$ cat service.xs | xano ephemeral:run:service -w 1 --stdin\nService created successfully!\n...\n",
873
- "$ xano ephemeral:run:service -w 1 -f service.xs -o json\n{\n \"service\": { \"id\": 1 },\n ...\n}\n"
911
+ "$ xano ephemeral:run:job -w 1 -f script.xs\nJob executed successfully!\n...\n",
912
+ "$ xano ephemeral:run:job -f script.xs\nJob executed successfully!\n...\n",
913
+ "$ xano ephemeral:run:job -w 1 -f script.xs --edit\n# Opens script.xs in $EDITOR, then runs job with edited content\nJob executed successfully!\n...\n",
914
+ "$ cat script.xs | xano ephemeral:run:job -w 1 --stdin\nJob executed successfully!\n...\n",
915
+ "$ xano ephemeral:run:job -w 1 -f script.xs -o json\n{\n \"job\": { \"id\": 1, \"run\": { \"id\": 1 } },\n \"result\": { ... }\n}\n",
916
+ "$ xano ephemeral:run:job -w 1 -f script.xs -a args.json\n# Runs job with input arguments from args.json\nJob executed successfully!\n...\n"
874
917
  ],
875
918
  "flags": {
876
919
  "profile": {
@@ -894,7 +937,7 @@
894
937
  },
895
938
  "file": {
896
939
  "char": "f",
897
- "description": "Path to file containing XanoScript code",
940
+ "description": "Path or URL to file containing XanoScript code",
898
941
  "exclusive": [
899
942
  "stdin"
900
943
  ],
@@ -920,7 +963,7 @@
920
963
  "dependsOn": [
921
964
  "file"
922
965
  ],
923
- "description": "Open file in editor before running service (requires --file)",
966
+ "description": "Open file in editor before running job (requires --file)",
924
967
  "name": "edit",
925
968
  "required": false,
926
969
  "allowNo": false,
@@ -939,65 +982,20 @@
939
982
  "json"
940
983
  ],
941
984
  "type": "option"
942
- }
943
- },
944
- "hasDynamicHelp": false,
945
- "hiddenAliases": [],
946
- "id": "ephemeral:run:service",
947
- "pluginAlias": "@xano/cli",
948
- "pluginName": "@xano/cli",
949
- "pluginType": "core",
950
- "strict": true,
951
- "enableJsonFlag": false,
952
- "isESM": true,
953
- "relativePath": [
954
- "dist",
955
- "commands",
956
- "ephemeral",
957
- "run",
958
- "service",
959
- "index.js"
960
- ]
961
- },
962
- "workspace:list": {
963
- "aliases": [],
964
- "args": {},
965
- "description": "List all workspaces from the Xano Metadata API",
966
- "examples": [
967
- "$ xano workspace:list\nAvailable workspaces:\n - workspace-1 (ID: 1)\n - workspace-2 (ID: 2)\n - workspace-3 (ID: 3)\n",
968
- "$ xano workspace:list --profile production\nAvailable workspaces:\n - my-app (ID: 1)\n - staging-env (ID: 2)\n",
969
- "$ xano workspace:list --output json\n{\n \"workspaces\": [\n {\n \"id\": 1,\n \"name\": \"workspace-1\"\n },\n {\n \"id\": 2,\n \"name\": \"workspace-2\"\n }\n ]\n}\n",
970
- "$ xano workspace:list -p staging -o json\n{\n \"workspaces\": [\n {\n \"id\": 1,\n \"name\": \"my-app\"\n }\n ]\n}\n"
971
- ],
972
- "flags": {
973
- "profile": {
974
- "char": "p",
975
- "description": "Profile to use for this command",
976
- "env": "XANO_PROFILE",
977
- "name": "profile",
978
- "required": false,
979
- "hasDynamicHelp": false,
980
- "multiple": false,
981
- "type": "option"
982
985
  },
983
- "output": {
984
- "char": "o",
985
- "description": "Output format",
986
- "name": "output",
986
+ "args": {
987
+ "char": "a",
988
+ "description": "Path or URL to JSON file containing input arguments",
989
+ "name": "args",
987
990
  "required": false,
988
- "default": "summary",
989
991
  "hasDynamicHelp": false,
990
992
  "multiple": false,
991
- "options": [
992
- "summary",
993
- "json"
994
- ],
995
993
  "type": "option"
996
994
  }
997
995
  },
998
996
  "hasDynamicHelp": false,
999
997
  "hiddenAliases": [],
1000
- "id": "workspace:list",
998
+ "id": "ephemeral:run:job",
1001
999
  "pluginAlias": "@xano/cli",
1002
1000
  "pluginName": "@xano/cli",
1003
1001
  "pluginType": "core",
@@ -1007,21 +1005,22 @@
1007
1005
  "relativePath": [
1008
1006
  "dist",
1009
1007
  "commands",
1010
- "workspace",
1011
- "list",
1008
+ "ephemeral",
1009
+ "run",
1010
+ "job",
1012
1011
  "index.js"
1013
1012
  ]
1014
1013
  },
1015
- "function:create": {
1014
+ "ephemeral:run:service": {
1016
1015
  "aliases": [],
1017
1016
  "args": {},
1018
- "description": "Create a new function in a workspace",
1017
+ "description": "Run an ephemeral service in a workspace",
1019
1018
  "examples": [
1020
- "$ xano function:create -w 40 -f function.xs\nFunction created successfully!\nID: 123\nName: my_function\n",
1021
- "$ xano function:create -f function.xs\nFunction created successfully!\nID: 123\nName: my_function\n",
1022
- "$ xano function:create -w 40 -f function.xs --edit\n# Opens function.xs in $EDITOR, then creates function with edited content\nFunction created successfully!\nID: 123\nName: my_function\n",
1023
- "$ cat function.xs | xano function:create -w 40 --stdin\nFunction created successfully!\nID: 123\nName: my_function\n",
1024
- "$ xano function:create -w 40 -f function.xs -o json\n{\n \"id\": 123,\n \"name\": \"my_function\",\n ...\n}\n"
1019
+ "$ xano ephemeral:run:service -w 1 -f service.xs\nService created successfully!\n...\n",
1020
+ "$ xano ephemeral:run:service -f service.xs\nService created successfully!\n...\n",
1021
+ "$ xano ephemeral:run:service -w 1 -f service.xs --edit\n# Opens service.xs in $EDITOR, then creates service with edited content\nService created successfully!\n...\n",
1022
+ "$ cat service.xs | xano ephemeral:run:service -w 1 --stdin\nService created successfully!\n...\n",
1023
+ "$ xano ephemeral:run:service -w 1 -f service.xs -o json\n{\n \"service\": { \"id\": 1 },\n ...\n}\n"
1025
1024
  ],
1026
1025
  "flags": {
1027
1026
  "profile": {
@@ -1045,7 +1044,7 @@
1045
1044
  },
1046
1045
  "file": {
1047
1046
  "char": "f",
1048
- "description": "Path to file containing XanoScript code",
1047
+ "description": "Path or URL to file containing XanoScript code",
1049
1048
  "exclusive": [
1050
1049
  "stdin"
1051
1050
  ],
@@ -1071,7 +1070,7 @@
1071
1070
  "dependsOn": [
1072
1071
  "file"
1073
1072
  ],
1074
- "description": "Open file in editor before creating function (requires --file)",
1073
+ "description": "Open file in editor before running service (requires --file)",
1075
1074
  "name": "edit",
1076
1075
  "required": false,
1077
1076
  "allowNo": false,
@@ -1094,7 +1093,7 @@
1094
1093
  },
1095
1094
  "hasDynamicHelp": false,
1096
1095
  "hiddenAliases": [],
1097
- "id": "function:create",
1096
+ "id": "ephemeral:run:service",
1098
1097
  "pluginAlias": "@xano/cli",
1099
1098
  "pluginName": "@xano/cli",
1100
1099
  "pluginType": "core",
@@ -1104,8 +1103,9 @@
1104
1103
  "relativePath": [
1105
1104
  "dist",
1106
1105
  "commands",
1107
- "function",
1108
- "create",
1106
+ "ephemeral",
1107
+ "run",
1108
+ "service",
1109
1109
  "index.js"
1110
1110
  ]
1111
1111
  },
@@ -1366,5 +1366,5 @@
1366
1366
  ]
1367
1367
  }
1368
1368
  },
1369
- "version": "0.0.7"
1369
+ "version": "0.0.9"
1370
1370
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xano/cli",
3
3
  "description": "CLI for Xano's Metadata API",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "author": "Sean Montgomery",
6
6
  "bin": {
7
7
  "xano": "./bin/run.js"