@xano/cli 0.0.8 → 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,67 +1,25 @@
1
1
  {
2
2
  "commands": {
3
- "profile:delete": {
4
- "aliases": [],
5
- "args": {
6
- "name": {
7
- "description": "Profile name to delete",
8
- "name": "name",
9
- "required": true
10
- }
11
- },
12
- "description": "Delete a profile configuration",
13
- "examples": [
14
- "$ 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",
15
- "$ xano profile:delete old-profile --force\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n",
16
- "$ xano profile:delete old-profile -f\nProfile 'old-profile' deleted successfully from ~/.xano/credentials.yaml\n"
17
- ],
18
- "flags": {
19
- "force": {
20
- "char": "f",
21
- "description": "Skip confirmation prompt",
22
- "name": "force",
23
- "required": false,
24
- "allowNo": false,
25
- "type": "boolean"
26
- }
27
- },
28
- "hasDynamicHelp": false,
29
- "hiddenAliases": [],
30
- "id": "profile:delete",
31
- "pluginAlias": "@xano/cli",
32
- "pluginName": "@xano/cli",
33
- "pluginType": "core",
34
- "strict": true,
35
- "enableJsonFlag": false,
36
- "isESM": true,
37
- "relativePath": [
38
- "dist",
39
- "commands",
40
- "profile",
41
- "delete",
42
- "index.js"
43
- ]
44
- },
45
- "profile:edit": {
3
+ "profile:create": {
46
4
  "aliases": [],
47
5
  "args": {
48
6
  "name": {
49
- "description": "Profile name to edit",
7
+ "description": "Profile name",
50
8
  "name": "name",
51
9
  "required": true
52
10
  }
53
11
  },
54
- "description": "Edit an existing profile configuration",
12
+ "description": "Create a new profile configuration",
55
13
  "examples": [
56
- "$ xano profile:edit production --access_token new_token123\nProfile 'production' updated successfully at ~/.xano/credentials.yaml\n",
57
- "$ xano profile:edit staging -i https://new-staging-instance.xano.com -t new_token456\nProfile 'staging' updated successfully at ~/.xano/credentials.yaml\n",
58
- "$ xano profile:edit dev -w new-workspace -b new-branch\nProfile 'dev' updated successfully at ~/.xano/credentials.yaml\n",
59
- "$ xano profile:edit dev --remove-workspace\nProfile 'dev' updated successfully at ~/.xano/credentials.yaml\n"
14
+ "$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123\nProfile 'production' created successfully at ~/.xano/credentials.yaml\n",
15
+ "$ xano profile:create staging -a https://staging-account.xano.com -i https://staging-instance.xano.com -t token456\nProfile 'staging' created successfully at ~/.xano/credentials.yaml\n",
16
+ "$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch\nProfile 'dev' created successfully at ~/.xano/credentials.yaml\n",
17
+ "$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123 --default\nProfile 'production' created successfully at ~/.xano/credentials.yaml\nDefault profile set to 'production'\n"
60
18
  ],
61
19
  "flags": {
62
20
  "account_origin": {
63
21
  "char": "a",
64
- "description": "Update account origin URL",
22
+ "description": "Account origin URL. Optional for self hosted installs.",
65
23
  "name": "account_origin",
66
24
  "required": false,
67
25
  "hasDynamicHelp": false,
@@ -70,25 +28,25 @@
70
28
  },
71
29
  "instance_origin": {
72
30
  "char": "i",
73
- "description": "Update instance origin URL",
31
+ "description": "Instance origin URL",
74
32
  "name": "instance_origin",
75
- "required": false,
33
+ "required": true,
76
34
  "hasDynamicHelp": false,
77
35
  "multiple": false,
78
36
  "type": "option"
79
37
  },
80
38
  "access_token": {
81
39
  "char": "t",
82
- "description": "Update access token for the Xano Metadata API",
40
+ "description": "Access token for the Xano Metadata API",
83
41
  "name": "access_token",
84
- "required": false,
42
+ "required": true,
85
43
  "hasDynamicHelp": false,
86
44
  "multiple": false,
87
45
  "type": "option"
88
46
  },
89
47
  "workspace": {
90
48
  "char": "w",
91
- "description": "Update workspace name",
49
+ "description": "Workspace name",
92
50
  "name": "workspace",
93
51
  "required": false,
94
52
  "hasDynamicHelp": false,
@@ -97,23 +55,58 @@
97
55
  },
98
56
  "branch": {
99
57
  "char": "b",
100
- "description": "Update branch name",
58
+ "description": "Branch name",
101
59
  "name": "branch",
102
60
  "required": false,
103
61
  "hasDynamicHelp": false,
104
62
  "multiple": false,
105
63
  "type": "option"
106
64
  },
107
- "remove-workspace": {
108
- "description": "Remove workspace from profile",
109
- "name": "remove-workspace",
65
+ "default": {
66
+ "description": "Set this profile as the default",
67
+ "name": "default",
110
68
  "required": false,
111
69
  "allowNo": false,
112
70
  "type": "boolean"
113
- },
114
- "remove-branch": {
115
- "description": "Remove branch from profile",
116
- "name": "remove-branch",
71
+ }
72
+ },
73
+ "hasDynamicHelp": false,
74
+ "hiddenAliases": [],
75
+ "id": "profile:create",
76
+ "pluginAlias": "@xano/cli",
77
+ "pluginName": "@xano/cli",
78
+ "pluginType": "core",
79
+ "strict": true,
80
+ "enableJsonFlag": false,
81
+ "isESM": true,
82
+ "relativePath": [
83
+ "dist",
84
+ "commands",
85
+ "profile",
86
+ "create",
87
+ "index.js"
88
+ ]
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",
117
110
  "required": false,
118
111
  "allowNo": false,
119
112
  "type": "boolean"
@@ -121,7 +114,7 @@
121
114
  },
122
115
  "hasDynamicHelp": false,
123
116
  "hiddenAliases": [],
124
- "id": "profile:edit",
117
+ "id": "profile:delete",
125
118
  "pluginAlias": "@xano/cli",
126
119
  "pluginName": "@xano/cli",
127
120
  "pluginType": "core",
@@ -132,30 +125,30 @@
132
125
  "dist",
133
126
  "commands",
134
127
  "profile",
135
- "edit",
128
+ "delete",
136
129
  "index.js"
137
130
  ]
138
131
  },
139
- "profile:create": {
132
+ "profile:edit": {
140
133
  "aliases": [],
141
134
  "args": {
142
135
  "name": {
143
- "description": "Profile name",
136
+ "description": "Profile name to edit",
144
137
  "name": "name",
145
138
  "required": true
146
139
  }
147
140
  },
148
- "description": "Create a new profile configuration",
141
+ "description": "Edit an existing profile configuration",
149
142
  "examples": [
150
- "$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123\nProfile 'production' created successfully at ~/.xano/credentials.yaml\n",
151
- "$ xano profile:create staging -a https://staging-account.xano.com -i https://staging-instance.xano.com -t token456\nProfile 'staging' created successfully at ~/.xano/credentials.yaml\n",
152
- "$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch\nProfile 'dev' created successfully at ~/.xano/credentials.yaml\n",
153
- "$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123 --default\nProfile 'production' created successfully at ~/.xano/credentials.yaml\nDefault profile set to 'production'\n"
143
+ "$ xano profile:edit production --access_token new_token123\nProfile 'production' updated successfully at ~/.xano/credentials.yaml\n",
144
+ "$ xano profile:edit staging -i https://new-staging-instance.xano.com -t new_token456\nProfile 'staging' updated successfully at ~/.xano/credentials.yaml\n",
145
+ "$ xano profile:edit dev -w new-workspace -b new-branch\nProfile 'dev' updated successfully at ~/.xano/credentials.yaml\n",
146
+ "$ xano profile:edit dev --remove-workspace\nProfile 'dev' updated successfully at ~/.xano/credentials.yaml\n"
154
147
  ],
155
148
  "flags": {
156
149
  "account_origin": {
157
150
  "char": "a",
158
- "description": "Account origin URL. Optional for self hosted installs.",
151
+ "description": "Update account origin URL",
159
152
  "name": "account_origin",
160
153
  "required": false,
161
154
  "hasDynamicHelp": false,
@@ -164,25 +157,25 @@
164
157
  },
165
158
  "instance_origin": {
166
159
  "char": "i",
167
- "description": "Instance origin URL",
160
+ "description": "Update instance origin URL",
168
161
  "name": "instance_origin",
169
- "required": true,
162
+ "required": false,
170
163
  "hasDynamicHelp": false,
171
164
  "multiple": false,
172
165
  "type": "option"
173
166
  },
174
167
  "access_token": {
175
168
  "char": "t",
176
- "description": "Access token for the Xano Metadata API",
169
+ "description": "Update access token for the Xano Metadata API",
177
170
  "name": "access_token",
178
- "required": true,
171
+ "required": false,
179
172
  "hasDynamicHelp": false,
180
173
  "multiple": false,
181
174
  "type": "option"
182
175
  },
183
176
  "workspace": {
184
177
  "char": "w",
185
- "description": "Workspace name",
178
+ "description": "Update workspace name",
186
179
  "name": "workspace",
187
180
  "required": false,
188
181
  "hasDynamicHelp": false,
@@ -191,16 +184,23 @@
191
184
  },
192
185
  "branch": {
193
186
  "char": "b",
194
- "description": "Branch name",
187
+ "description": "Update branch name",
195
188
  "name": "branch",
196
189
  "required": false,
197
190
  "hasDynamicHelp": false,
198
191
  "multiple": false,
199
192
  "type": "option"
200
193
  },
201
- "default": {
202
- "description": "Set this profile as the default",
203
- "name": "default",
194
+ "remove-workspace": {
195
+ "description": "Remove workspace from profile",
196
+ "name": "remove-workspace",
197
+ "required": false,
198
+ "allowNo": false,
199
+ "type": "boolean"
200
+ },
201
+ "remove-branch": {
202
+ "description": "Remove branch from profile",
203
+ "name": "remove-branch",
204
204
  "required": false,
205
205
  "allowNo": false,
206
206
  "type": "boolean"
@@ -208,7 +208,7 @@
208
208
  },
209
209
  "hasDynamicHelp": false,
210
210
  "hiddenAliases": [],
211
- "id": "profile:create",
211
+ "id": "profile:edit",
212
212
  "pluginAlias": "@xano/cli",
213
213
  "pluginName": "@xano/cli",
214
214
  "pluginType": "core",
@@ -219,7 +219,7 @@
219
219
  "dist",
220
220
  "commands",
221
221
  "profile",
222
- "create",
222
+ "edit",
223
223
  "index.js"
224
224
  ]
225
225
  },
@@ -285,51 +285,6 @@
285
285
  "index.js"
286
286
  ]
287
287
  },
288
- "profile:wizard": {
289
- "aliases": [],
290
- "args": {},
291
- "description": "Create a new profile configuration using an interactive wizard",
292
- "examples": [
293
- "$ xano profile:wizard\nWelcome to the Xano Profile Wizard!\n? Enter your access token: ***...***\n? Select an instance:\n > Production (https://app.xano.com)\n Staging (https://staging.xano.com)\n? Profile name: production\nProfile 'production' created successfully at ~/.xano/credentials.yaml\n"
294
- ],
295
- "flags": {
296
- "name": {
297
- "char": "n",
298
- "description": "Profile name (skip prompt if provided)",
299
- "name": "name",
300
- "required": false,
301
- "hasDynamicHelp": false,
302
- "multiple": false,
303
- "type": "option"
304
- },
305
- "origin": {
306
- "char": "o",
307
- "description": "Xano instance origin URL",
308
- "name": "origin",
309
- "required": false,
310
- "default": "https://app.xano.com",
311
- "hasDynamicHelp": false,
312
- "multiple": false,
313
- "type": "option"
314
- }
315
- },
316
- "hasDynamicHelp": false,
317
- "hiddenAliases": [],
318
- "id": "profile:wizard",
319
- "pluginAlias": "@xano/cli",
320
- "pluginName": "@xano/cli",
321
- "pluginType": "core",
322
- "strict": true,
323
- "enableJsonFlag": false,
324
- "isESM": true,
325
- "relativePath": [
326
- "dist",
327
- "commands",
328
- "profile",
329
- "wizard",
330
- "index.js"
331
- ]
332
- },
333
288
  "profile:set-default": {
334
289
  "aliases": [],
335
290
  "args": {
@@ -362,197 +317,37 @@
362
317
  "index.js"
363
318
  ]
364
319
  },
365
- "ephemeral:run:job": {
366
- "aliases": [],
367
- "args": {},
368
- "description": "Run an ephemeral job in a workspace",
369
- "examples": [
370
- "$ xano ephemeral:run:job -w 1 -f script.xs\nJob executed successfully!\n...\n",
371
- "$ xano ephemeral:run:job -f script.xs\nJob executed successfully!\n...\n",
372
- "$ 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",
373
- "$ cat script.xs | xano ephemeral:run:job -w 1 --stdin\nJob executed successfully!\n...\n",
374
- "$ xano ephemeral:run:job -w 1 -f script.xs -o json\n{\n \"job\": { \"id\": 1, \"run\": { \"id\": 1 } },\n \"result\": { ... }\n}\n",
375
- "$ 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"
376
- ],
377
- "flags": {
378
- "profile": {
379
- "char": "p",
380
- "description": "Profile to use for this command",
381
- "env": "XANO_PROFILE",
382
- "name": "profile",
383
- "required": false,
384
- "hasDynamicHelp": false,
385
- "multiple": false,
386
- "type": "option"
387
- },
388
- "workspace": {
389
- "char": "w",
390
- "description": "Workspace ID (optional if set in profile)",
391
- "name": "workspace",
392
- "required": false,
393
- "hasDynamicHelp": false,
394
- "multiple": false,
395
- "type": "option"
396
- },
397
- "file": {
398
- "char": "f",
399
- "description": "Path to file containing XanoScript code",
400
- "exclusive": [
401
- "stdin"
402
- ],
403
- "name": "file",
404
- "required": false,
405
- "hasDynamicHelp": false,
406
- "multiple": false,
407
- "type": "option"
408
- },
409
- "stdin": {
410
- "char": "s",
411
- "description": "Read XanoScript code from stdin",
412
- "exclusive": [
413
- "file"
414
- ],
415
- "name": "stdin",
416
- "required": false,
417
- "allowNo": false,
418
- "type": "boolean"
419
- },
420
- "edit": {
421
- "char": "e",
422
- "dependsOn": [
423
- "file"
424
- ],
425
- "description": "Open file in editor before running job (requires --file)",
426
- "name": "edit",
427
- "required": false,
428
- "allowNo": false,
429
- "type": "boolean"
430
- },
431
- "output": {
432
- "char": "o",
433
- "description": "Output format",
434
- "name": "output",
435
- "required": false,
436
- "default": "summary",
437
- "hasDynamicHelp": false,
438
- "multiple": false,
439
- "options": [
440
- "summary",
441
- "json"
442
- ],
443
- "type": "option"
444
- },
445
- "args": {
446
- "char": "a",
447
- "description": "Path to JSON file containing input arguments",
448
- "name": "args",
449
- "required": false,
450
- "hasDynamicHelp": false,
451
- "multiple": false,
452
- "type": "option"
453
- }
454
- },
455
- "hasDynamicHelp": false,
456
- "hiddenAliases": [],
457
- "id": "ephemeral:run:job",
458
- "pluginAlias": "@xano/cli",
459
- "pluginName": "@xano/cli",
460
- "pluginType": "core",
461
- "strict": true,
462
- "enableJsonFlag": false,
463
- "isESM": true,
464
- "relativePath": [
465
- "dist",
466
- "commands",
467
- "ephemeral",
468
- "run",
469
- "job",
470
- "index.js"
471
- ]
472
- },
473
- "ephemeral:run:service": {
320
+ "profile:wizard": {
474
321
  "aliases": [],
475
322
  "args": {},
476
- "description": "Run an ephemeral service in a workspace",
323
+ "description": "Create a new profile configuration using an interactive wizard",
477
324
  "examples": [
478
- "$ xano ephemeral:run:service -w 1 -f service.xs\nService created successfully!\n...\n",
479
- "$ xano ephemeral:run:service -f service.xs\nService created successfully!\n...\n",
480
- "$ 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",
481
- "$ cat service.xs | xano ephemeral:run:service -w 1 --stdin\nService created successfully!\n...\n",
482
- "$ xano ephemeral:run:service -w 1 -f service.xs -o json\n{\n \"service\": { \"id\": 1 },\n ...\n}\n"
325
+ "$ xano profile:wizard\nWelcome to the Xano Profile Wizard!\n? Enter your access token: ***...***\n? Select an instance:\n > Production (https://app.xano.com)\n Staging (https://staging.xano.com)\n? Profile name: production\nProfile 'production' created successfully at ~/.xano/credentials.yaml\n"
483
326
  ],
484
327
  "flags": {
485
- "profile": {
486
- "char": "p",
487
- "description": "Profile to use for this command",
488
- "env": "XANO_PROFILE",
489
- "name": "profile",
490
- "required": false,
491
- "hasDynamicHelp": false,
492
- "multiple": false,
493
- "type": "option"
494
- },
495
- "workspace": {
496
- "char": "w",
497
- "description": "Workspace ID (optional if set in profile)",
498
- "name": "workspace",
499
- "required": false,
500
- "hasDynamicHelp": false,
501
- "multiple": false,
502
- "type": "option"
503
- },
504
- "file": {
505
- "char": "f",
506
- "description": "Path to file containing XanoScript code",
507
- "exclusive": [
508
- "stdin"
509
- ],
510
- "name": "file",
328
+ "name": {
329
+ "char": "n",
330
+ "description": "Profile name (skip prompt if provided)",
331
+ "name": "name",
511
332
  "required": false,
512
333
  "hasDynamicHelp": false,
513
334
  "multiple": false,
514
335
  "type": "option"
515
336
  },
516
- "stdin": {
517
- "char": "s",
518
- "description": "Read XanoScript code from stdin",
519
- "exclusive": [
520
- "file"
521
- ],
522
- "name": "stdin",
523
- "required": false,
524
- "allowNo": false,
525
- "type": "boolean"
526
- },
527
- "edit": {
528
- "char": "e",
529
- "dependsOn": [
530
- "file"
531
- ],
532
- "description": "Open file in editor before running service (requires --file)",
533
- "name": "edit",
534
- "required": false,
535
- "allowNo": false,
536
- "type": "boolean"
537
- },
538
- "output": {
337
+ "origin": {
539
338
  "char": "o",
540
- "description": "Output format",
541
- "name": "output",
339
+ "description": "Xano instance origin URL",
340
+ "name": "origin",
542
341
  "required": false,
543
- "default": "summary",
342
+ "default": "https://app.xano.com",
544
343
  "hasDynamicHelp": false,
545
344
  "multiple": false,
546
- "options": [
547
- "summary",
548
- "json"
549
- ],
550
345
  "type": "option"
551
346
  }
552
347
  },
553
348
  "hasDynamicHelp": false,
554
349
  "hiddenAliases": [],
555
- "id": "ephemeral:run:service",
350
+ "id": "profile:wizard",
556
351
  "pluginAlias": "@xano/cli",
557
352
  "pluginName": "@xano/cli",
558
353
  "pluginType": "core",
@@ -562,9 +357,8 @@
562
357
  "relativePath": [
563
358
  "dist",
564
359
  "commands",
565
- "ephemeral",
566
- "run",
567
- "service",
360
+ "profile",
361
+ "wizard",
568
362
  "index.js"
569
363
  ]
570
364
  },
@@ -976,6 +770,86 @@
976
770
  "index.js"
977
771
  ]
978
772
  },
773
+ "static_host:list": {
774
+ "aliases": [],
775
+ "args": {},
776
+ "description": "List all static hosts in a workspace from the Xano Metadata API",
777
+ "examples": [
778
+ "$ xano static_host:list -w 40\nAvailable static hosts:\n - my-static-host (ID: 1)\n - another-host (ID: 2)\n",
779
+ "$ xano static_host:list --profile production\nAvailable static hosts:\n - my-static-host (ID: 1)\n - another-host (ID: 2)\n",
780
+ "$ xano static_host:list -w 40 --output json\n[\n {\n \"id\": 1,\n \"name\": \"my-static-host\",\n \"domain\": \"example.com\"\n }\n]\n",
781
+ "$ xano static_host:list -p staging -o json --page 2\n[\n {\n \"id\": 3,\n \"name\": \"static-host-3\"\n }\n]\n"
782
+ ],
783
+ "flags": {
784
+ "profile": {
785
+ "char": "p",
786
+ "description": "Profile to use for this command",
787
+ "env": "XANO_PROFILE",
788
+ "name": "profile",
789
+ "required": false,
790
+ "hasDynamicHelp": false,
791
+ "multiple": false,
792
+ "type": "option"
793
+ },
794
+ "workspace": {
795
+ "char": "w",
796
+ "description": "Workspace ID (optional if set in profile)",
797
+ "name": "workspace",
798
+ "required": false,
799
+ "hasDynamicHelp": false,
800
+ "multiple": false,
801
+ "type": "option"
802
+ },
803
+ "output": {
804
+ "char": "o",
805
+ "description": "Output format",
806
+ "name": "output",
807
+ "required": false,
808
+ "default": "summary",
809
+ "hasDynamicHelp": false,
810
+ "multiple": false,
811
+ "options": [
812
+ "summary",
813
+ "json"
814
+ ],
815
+ "type": "option"
816
+ },
817
+ "page": {
818
+ "description": "Page number for pagination",
819
+ "name": "page",
820
+ "required": false,
821
+ "default": 1,
822
+ "hasDynamicHelp": false,
823
+ "multiple": false,
824
+ "type": "option"
825
+ },
826
+ "per_page": {
827
+ "description": "Number of results per page",
828
+ "name": "per_page",
829
+ "required": false,
830
+ "default": 50,
831
+ "hasDynamicHelp": false,
832
+ "multiple": false,
833
+ "type": "option"
834
+ }
835
+ },
836
+ "hasDynamicHelp": false,
837
+ "hiddenAliases": [],
838
+ "id": "static_host:list",
839
+ "pluginAlias": "@xano/cli",
840
+ "pluginName": "@xano/cli",
841
+ "pluginType": "core",
842
+ "strict": true,
843
+ "enableJsonFlag": false,
844
+ "isESM": true,
845
+ "relativePath": [
846
+ "dist",
847
+ "commands",
848
+ "static_host",
849
+ "list",
850
+ "index.js"
851
+ ]
852
+ },
979
853
  "workspace:list": {
980
854
  "aliases": [],
981
855
  "args": {},
@@ -1029,15 +903,17 @@
1029
903
  "index.js"
1030
904
  ]
1031
905
  },
1032
- "static_host:list": {
906
+ "ephemeral:run:job": {
1033
907
  "aliases": [],
1034
908
  "args": {},
1035
- "description": "List all static hosts in a workspace from the Xano Metadata API",
909
+ "description": "Run an ephemeral job in a workspace",
1036
910
  "examples": [
1037
- "$ xano static_host:list -w 40\nAvailable static hosts:\n - my-static-host (ID: 1)\n - another-host (ID: 2)\n",
1038
- "$ xano static_host:list --profile production\nAvailable static hosts:\n - my-static-host (ID: 1)\n - another-host (ID: 2)\n",
1039
- "$ xano static_host:list -w 40 --output json\n[\n {\n \"id\": 1,\n \"name\": \"my-static-host\",\n \"domain\": \"example.com\"\n }\n]\n",
1040
- "$ xano static_host:list -p staging -o json --page 2\n[\n {\n \"id\": 3,\n \"name\": \"static-host-3\"\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"
1041
917
  ],
1042
918
  "flags": {
1043
919
  "profile": {
@@ -1059,6 +935,40 @@
1059
935
  "multiple": false,
1060
936
  "type": "option"
1061
937
  },
938
+ "file": {
939
+ "char": "f",
940
+ "description": "Path or URL to file containing XanoScript code",
941
+ "exclusive": [
942
+ "stdin"
943
+ ],
944
+ "name": "file",
945
+ "required": false,
946
+ "hasDynamicHelp": false,
947
+ "multiple": false,
948
+ "type": "option"
949
+ },
950
+ "stdin": {
951
+ "char": "s",
952
+ "description": "Read XanoScript code from stdin",
953
+ "exclusive": [
954
+ "file"
955
+ ],
956
+ "name": "stdin",
957
+ "required": false,
958
+ "allowNo": false,
959
+ "type": "boolean"
960
+ },
961
+ "edit": {
962
+ "char": "e",
963
+ "dependsOn": [
964
+ "file"
965
+ ],
966
+ "description": "Open file in editor before running job (requires --file)",
967
+ "name": "edit",
968
+ "required": false,
969
+ "allowNo": false,
970
+ "type": "boolean"
971
+ },
1062
972
  "output": {
1063
973
  "char": "o",
1064
974
  "description": "Output format",
@@ -1073,28 +983,117 @@
1073
983
  ],
1074
984
  "type": "option"
1075
985
  },
1076
- "page": {
1077
- "description": "Page number for pagination",
1078
- "name": "page",
986
+ "args": {
987
+ "char": "a",
988
+ "description": "Path or URL to JSON file containing input arguments",
989
+ "name": "args",
990
+ "required": false,
991
+ "hasDynamicHelp": false,
992
+ "multiple": false,
993
+ "type": "option"
994
+ }
995
+ },
996
+ "hasDynamicHelp": false,
997
+ "hiddenAliases": [],
998
+ "id": "ephemeral:run:job",
999
+ "pluginAlias": "@xano/cli",
1000
+ "pluginName": "@xano/cli",
1001
+ "pluginType": "core",
1002
+ "strict": true,
1003
+ "enableJsonFlag": false,
1004
+ "isESM": true,
1005
+ "relativePath": [
1006
+ "dist",
1007
+ "commands",
1008
+ "ephemeral",
1009
+ "run",
1010
+ "job",
1011
+ "index.js"
1012
+ ]
1013
+ },
1014
+ "ephemeral:run:service": {
1015
+ "aliases": [],
1016
+ "args": {},
1017
+ "description": "Run an ephemeral service in a workspace",
1018
+ "examples": [
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"
1024
+ ],
1025
+ "flags": {
1026
+ "profile": {
1027
+ "char": "p",
1028
+ "description": "Profile to use for this command",
1029
+ "env": "XANO_PROFILE",
1030
+ "name": "profile",
1079
1031
  "required": false,
1080
- "default": 1,
1081
1032
  "hasDynamicHelp": false,
1082
1033
  "multiple": false,
1083
1034
  "type": "option"
1084
1035
  },
1085
- "per_page": {
1086
- "description": "Number of results per page",
1087
- "name": "per_page",
1036
+ "workspace": {
1037
+ "char": "w",
1038
+ "description": "Workspace ID (optional if set in profile)",
1039
+ "name": "workspace",
1088
1040
  "required": false,
1089
- "default": 50,
1090
1041
  "hasDynamicHelp": false,
1091
1042
  "multiple": false,
1092
1043
  "type": "option"
1044
+ },
1045
+ "file": {
1046
+ "char": "f",
1047
+ "description": "Path or URL to file containing XanoScript code",
1048
+ "exclusive": [
1049
+ "stdin"
1050
+ ],
1051
+ "name": "file",
1052
+ "required": false,
1053
+ "hasDynamicHelp": false,
1054
+ "multiple": false,
1055
+ "type": "option"
1056
+ },
1057
+ "stdin": {
1058
+ "char": "s",
1059
+ "description": "Read XanoScript code from stdin",
1060
+ "exclusive": [
1061
+ "file"
1062
+ ],
1063
+ "name": "stdin",
1064
+ "required": false,
1065
+ "allowNo": false,
1066
+ "type": "boolean"
1067
+ },
1068
+ "edit": {
1069
+ "char": "e",
1070
+ "dependsOn": [
1071
+ "file"
1072
+ ],
1073
+ "description": "Open file in editor before running service (requires --file)",
1074
+ "name": "edit",
1075
+ "required": false,
1076
+ "allowNo": false,
1077
+ "type": "boolean"
1078
+ },
1079
+ "output": {
1080
+ "char": "o",
1081
+ "description": "Output format",
1082
+ "name": "output",
1083
+ "required": false,
1084
+ "default": "summary",
1085
+ "hasDynamicHelp": false,
1086
+ "multiple": false,
1087
+ "options": [
1088
+ "summary",
1089
+ "json"
1090
+ ],
1091
+ "type": "option"
1093
1092
  }
1094
1093
  },
1095
1094
  "hasDynamicHelp": false,
1096
1095
  "hiddenAliases": [],
1097
- "id": "static_host:list",
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
- "static_host",
1108
- "list",
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.8"
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.8",
4
+ "version": "0.0.9",
5
5
  "author": "Sean Montgomery",
6
6
  "bin": {
7
7
  "xano": "./bin/run.js"