@xano/cli 0.0.95-beta.21 → 0.0.95-beta.22

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 (198) hide show
  1. package/README.md +13 -1
  2. package/dist/base-command.d.ts +11 -1
  3. package/dist/base-command.js +31 -3
  4. package/dist/commands/auth/index.d.ts +1 -0
  5. package/dist/commands/auth/index.js +15 -10
  6. package/dist/commands/branch/create/index.d.ts +1 -0
  7. package/dist/commands/branch/create/index.js +1 -4
  8. package/dist/commands/branch/delete/index.d.ts +1 -0
  9. package/dist/commands/branch/delete/index.js +1 -4
  10. package/dist/commands/branch/edit/index.d.ts +1 -0
  11. package/dist/commands/branch/edit/index.js +1 -4
  12. package/dist/commands/branch/get/index.d.ts +1 -0
  13. package/dist/commands/branch/get/index.js +1 -4
  14. package/dist/commands/branch/list/index.d.ts +1 -0
  15. package/dist/commands/branch/list/index.js +1 -4
  16. package/dist/commands/branch/set_live/index.d.ts +1 -0
  17. package/dist/commands/branch/set_live/index.js +1 -4
  18. package/dist/commands/function/create/index.d.ts +1 -0
  19. package/dist/commands/function/create/index.js +1 -2
  20. package/dist/commands/function/edit/index.d.ts +1 -0
  21. package/dist/commands/function/edit/index.js +1 -2
  22. package/dist/commands/function/get/index.d.ts +1 -0
  23. package/dist/commands/function/get/index.js +1 -4
  24. package/dist/commands/function/list/index.d.ts +1 -0
  25. package/dist/commands/function/list/index.js +1 -4
  26. package/dist/commands/platform/get/index.d.ts +1 -0
  27. package/dist/commands/platform/get/index.js +1 -4
  28. package/dist/commands/platform/list/index.d.ts +1 -0
  29. package/dist/commands/platform/list/index.js +1 -4
  30. package/dist/commands/profile/create/index.d.ts +1 -0
  31. package/dist/commands/profile/create/index.js +10 -4
  32. package/dist/commands/profile/delete/index.d.ts +1 -0
  33. package/dist/commands/profile/delete/index.js +8 -4
  34. package/dist/commands/profile/edit/index.d.ts +1 -0
  35. package/dist/commands/profile/edit/index.js +1 -4
  36. package/dist/commands/profile/get/index.d.ts +3 -0
  37. package/dist/commands/profile/get/index.js +12 -5
  38. package/dist/commands/profile/list/index.d.ts +1 -0
  39. package/dist/commands/profile/list/index.js +8 -4
  40. package/dist/commands/profile/me/index.d.ts +1 -0
  41. package/dist/commands/profile/me/index.js +1 -4
  42. package/dist/commands/profile/set/index.d.ts +3 -0
  43. package/dist/commands/profile/set/index.js +12 -6
  44. package/dist/commands/profile/token/index.d.ts +3 -0
  45. package/dist/commands/profile/token/index.js +12 -5
  46. package/dist/commands/profile/wizard/index.d.ts +1 -0
  47. package/dist/commands/profile/wizard/index.js +13 -9
  48. package/dist/commands/profile/workspace/index.d.ts +3 -0
  49. package/dist/commands/profile/workspace/index.js +12 -5
  50. package/dist/commands/profile/workspace/set/index.d.ts +1 -0
  51. package/dist/commands/profile/workspace/set/index.js +1 -3
  52. package/dist/commands/release/create/index.d.ts +1 -0
  53. package/dist/commands/release/create/index.js +1 -4
  54. package/dist/commands/release/delete/index.d.ts +1 -0
  55. package/dist/commands/release/delete/index.js +1 -4
  56. package/dist/commands/release/deploy/index.d.ts +1 -0
  57. package/dist/commands/release/edit/index.d.ts +1 -0
  58. package/dist/commands/release/edit/index.js +1 -4
  59. package/dist/commands/release/export/index.d.ts +1 -0
  60. package/dist/commands/release/export/index.js +1 -3
  61. package/dist/commands/release/get/index.d.ts +1 -0
  62. package/dist/commands/release/get/index.js +1 -4
  63. package/dist/commands/release/import/index.d.ts +1 -0
  64. package/dist/commands/release/import/index.js +1 -3
  65. package/dist/commands/release/list/index.d.ts +1 -0
  66. package/dist/commands/release/list/index.js +1 -4
  67. package/dist/commands/release/pull/index.d.ts +1 -0
  68. package/dist/commands/release/pull/index.js +1 -3
  69. package/dist/commands/release/push/index.d.ts +1 -0
  70. package/dist/commands/release/push/index.js +1 -3
  71. package/dist/commands/sandbox/delete/index.d.ts +1 -0
  72. package/dist/commands/sandbox/env/delete/index.d.ts +1 -0
  73. package/dist/commands/sandbox/env/get/index.d.ts +1 -0
  74. package/dist/commands/sandbox/env/get_all/index.d.ts +1 -0
  75. package/dist/commands/sandbox/env/list/index.d.ts +1 -0
  76. package/dist/commands/sandbox/env/set/index.d.ts +1 -0
  77. package/dist/commands/sandbox/env/set_all/index.d.ts +1 -0
  78. package/dist/commands/sandbox/get/index.d.ts +1 -0
  79. package/dist/commands/sandbox/license/get/index.d.ts +1 -0
  80. package/dist/commands/sandbox/license/set/index.d.ts +1 -0
  81. package/dist/commands/sandbox/pull/index.d.ts +1 -0
  82. package/dist/commands/sandbox/push/index.d.ts +1 -0
  83. package/dist/commands/sandbox/reset/index.d.ts +1 -0
  84. package/dist/commands/sandbox/review/index.d.ts +1 -0
  85. package/dist/commands/sandbox/unit_test/list/index.d.ts +1 -0
  86. package/dist/commands/sandbox/unit_test/run/index.d.ts +1 -0
  87. package/dist/commands/sandbox/unit_test/run_all/index.d.ts +1 -0
  88. package/dist/commands/sandbox/workflow_test/list/index.d.ts +1 -0
  89. package/dist/commands/sandbox/workflow_test/run/index.d.ts +1 -0
  90. package/dist/commands/sandbox/workflow_test/run_all/index.d.ts +1 -0
  91. package/dist/commands/static_host/build/create/index.d.ts +1 -0
  92. package/dist/commands/static_host/build/create/index.js +1 -3
  93. package/dist/commands/static_host/build/get/index.d.ts +1 -0
  94. package/dist/commands/static_host/build/get/index.js +1 -4
  95. package/dist/commands/static_host/build/list/index.d.ts +1 -0
  96. package/dist/commands/static_host/build/list/index.js +1 -4
  97. package/dist/commands/static_host/list/index.d.ts +1 -0
  98. package/dist/commands/static_host/list/index.js +1 -4
  99. package/dist/commands/tenant/backup/create/index.d.ts +1 -0
  100. package/dist/commands/tenant/backup/create/index.js +1 -4
  101. package/dist/commands/tenant/backup/delete/index.d.ts +1 -0
  102. package/dist/commands/tenant/backup/delete/index.js +1 -4
  103. package/dist/commands/tenant/backup/export/index.d.ts +1 -0
  104. package/dist/commands/tenant/backup/export/index.js +1 -3
  105. package/dist/commands/tenant/backup/import/index.d.ts +1 -0
  106. package/dist/commands/tenant/backup/import/index.js +1 -3
  107. package/dist/commands/tenant/backup/list/index.d.ts +1 -0
  108. package/dist/commands/tenant/backup/list/index.js +1 -4
  109. package/dist/commands/tenant/backup/restore/index.d.ts +1 -0
  110. package/dist/commands/tenant/backup/restore/index.js +1 -4
  111. package/dist/commands/tenant/cluster/create/index.d.ts +1 -0
  112. package/dist/commands/tenant/cluster/create/index.js +1 -3
  113. package/dist/commands/tenant/cluster/delete/index.d.ts +1 -0
  114. package/dist/commands/tenant/cluster/delete/index.js +1 -4
  115. package/dist/commands/tenant/cluster/edit/index.d.ts +1 -0
  116. package/dist/commands/tenant/cluster/edit/index.js +1 -4
  117. package/dist/commands/tenant/cluster/get/index.d.ts +1 -0
  118. package/dist/commands/tenant/cluster/get/index.js +1 -4
  119. package/dist/commands/tenant/cluster/license/get/index.d.ts +1 -0
  120. package/dist/commands/tenant/cluster/license/get/index.js +1 -3
  121. package/dist/commands/tenant/cluster/license/set/index.d.ts +1 -0
  122. package/dist/commands/tenant/cluster/license/set/index.js +1 -3
  123. package/dist/commands/tenant/cluster/list/index.d.ts +1 -0
  124. package/dist/commands/tenant/cluster/list/index.js +1 -4
  125. package/dist/commands/tenant/create/index.d.ts +1 -0
  126. package/dist/commands/tenant/create/index.js +1 -3
  127. package/dist/commands/tenant/delete/index.d.ts +1 -0
  128. package/dist/commands/tenant/delete/index.js +1 -4
  129. package/dist/commands/tenant/deploy_platform/index.d.ts +1 -0
  130. package/dist/commands/tenant/deploy_platform/index.js +1 -3
  131. package/dist/commands/tenant/deploy_release/index.d.ts +1 -0
  132. package/dist/commands/tenant/deploy_release/index.js +1 -4
  133. package/dist/commands/tenant/edit/index.d.ts +1 -0
  134. package/dist/commands/tenant/edit/index.js +1 -4
  135. package/dist/commands/tenant/env/delete/index.d.ts +1 -0
  136. package/dist/commands/tenant/env/delete/index.js +1 -4
  137. package/dist/commands/tenant/env/get/index.d.ts +1 -0
  138. package/dist/commands/tenant/env/get/index.js +1 -4
  139. package/dist/commands/tenant/env/get_all/index.d.ts +1 -0
  140. package/dist/commands/tenant/env/get_all/index.js +1 -3
  141. package/dist/commands/tenant/env/list/index.d.ts +1 -0
  142. package/dist/commands/tenant/env/list/index.js +1 -4
  143. package/dist/commands/tenant/env/set/index.d.ts +1 -0
  144. package/dist/commands/tenant/env/set/index.js +1 -4
  145. package/dist/commands/tenant/env/set_all/index.d.ts +1 -0
  146. package/dist/commands/tenant/env/set_all/index.js +1 -3
  147. package/dist/commands/tenant/get/index.d.ts +1 -0
  148. package/dist/commands/tenant/get/index.js +1 -4
  149. package/dist/commands/tenant/impersonate/index.d.ts +1 -0
  150. package/dist/commands/tenant/impersonate/index.js +1 -4
  151. package/dist/commands/tenant/license/get/index.d.ts +1 -0
  152. package/dist/commands/tenant/license/get/index.js +1 -3
  153. package/dist/commands/tenant/license/set/index.d.ts +1 -0
  154. package/dist/commands/tenant/license/set/index.js +1 -3
  155. package/dist/commands/tenant/list/index.d.ts +1 -0
  156. package/dist/commands/tenant/list/index.js +1 -4
  157. package/dist/commands/tenant/pull/index.d.ts +1 -0
  158. package/dist/commands/tenant/pull/index.js +1 -3
  159. package/dist/commands/tenant/unit_test/list/index.d.ts +1 -0
  160. package/dist/commands/tenant/unit_test/run/index.d.ts +1 -0
  161. package/dist/commands/tenant/unit_test/run_all/index.d.ts +1 -0
  162. package/dist/commands/tenant/workflow_test/list/index.d.ts +1 -0
  163. package/dist/commands/tenant/workflow_test/run/index.d.ts +1 -0
  164. package/dist/commands/tenant/workflow_test/run_all/index.d.ts +1 -0
  165. package/dist/commands/unit_test/list/index.d.ts +1 -0
  166. package/dist/commands/unit_test/list/index.js +1 -4
  167. package/dist/commands/unit_test/run/index.d.ts +1 -0
  168. package/dist/commands/unit_test/run/index.js +1 -4
  169. package/dist/commands/unit_test/run_all/index.d.ts +1 -0
  170. package/dist/commands/unit_test/run_all/index.js +1 -4
  171. package/dist/commands/update/index.d.ts +1 -0
  172. package/dist/commands/workflow_test/delete/index.d.ts +1 -0
  173. package/dist/commands/workflow_test/delete/index.js +1 -4
  174. package/dist/commands/workflow_test/get/index.d.ts +1 -0
  175. package/dist/commands/workflow_test/get/index.js +1 -4
  176. package/dist/commands/workflow_test/list/index.d.ts +1 -0
  177. package/dist/commands/workflow_test/list/index.js +1 -4
  178. package/dist/commands/workflow_test/run/index.d.ts +1 -0
  179. package/dist/commands/workflow_test/run/index.js +1 -4
  180. package/dist/commands/workflow_test/run_all/index.d.ts +1 -0
  181. package/dist/commands/workflow_test/run_all/index.js +1 -4
  182. package/dist/commands/workspace/create/index.d.ts +1 -0
  183. package/dist/commands/workspace/create/index.js +1 -4
  184. package/dist/commands/workspace/delete/index.d.ts +1 -0
  185. package/dist/commands/workspace/delete/index.js +1 -4
  186. package/dist/commands/workspace/edit/index.d.ts +1 -0
  187. package/dist/commands/workspace/edit/index.js +1 -4
  188. package/dist/commands/workspace/get/index.d.ts +1 -0
  189. package/dist/commands/workspace/get/index.js +1 -4
  190. package/dist/commands/workspace/git/pull/index.d.ts +1 -0
  191. package/dist/commands/workspace/list/index.d.ts +1 -0
  192. package/dist/commands/workspace/list/index.js +1 -4
  193. package/dist/commands/workspace/pull/index.d.ts +1 -0
  194. package/dist/commands/workspace/pull/index.js +1 -3
  195. package/dist/commands/workspace/push/index.d.ts +1 -0
  196. package/dist/commands/workspace/push/index.js +1 -3
  197. package/oclif.manifest.json +2920 -1796
  198. package/package.json +1 -1
package/README.md CHANGED
@@ -491,6 +491,7 @@ All commands support these options:
491
491
 
492
492
  | Flag | Description |
493
493
  |------|-------------|
494
+ | `-c, --config` | Path to credentials file (or set `XANO_CONFIG` env var). Default: `~/.xano/credentials.yaml` |
494
495
  | `-p, --profile` | Profile to use (or set `XANO_PROFILE` env var) |
495
496
  | `-w, --workspace` | Workspace ID (overrides profile default) |
496
497
  | `-o, --output` | Output format: `summary` (default) or `json` |
@@ -511,7 +512,18 @@ This will show:
511
512
 
512
513
  ## Configuration
513
514
 
514
- Profiles are stored in `~/.xano/credentials.yaml`:
515
+ Profiles are stored in `~/.xano/credentials.yaml` by default. You can use a different credentials file with:
516
+
517
+ ```bash
518
+ # Via flag
519
+ xano profile list -c /path/to/other-credentials.yaml
520
+
521
+ # Via environment variable
522
+ export XANO_CONFIG=/path/to/other-credentials.yaml
523
+ xano workspace list
524
+ ```
525
+
526
+ ### Credentials File Format
515
527
 
516
528
  ```yaml
517
529
  profiles:
@@ -25,12 +25,19 @@ export interface SandboxTenant {
25
25
  state?: string;
26
26
  xano_domain?: string;
27
27
  }
28
+ /**
29
+ * Resolve the credentials file path from flag, env var, or default.
30
+ * Checks (in order): explicit configPath arg, XANO_CONFIG env var, ~/.xano/credentials.yaml
31
+ */
32
+ export declare function resolveCredentialsPath(configPath?: string): string;
28
33
  export default abstract class BaseCommand extends Command {
29
34
  static baseFlags: {
35
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
30
36
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
31
37
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
32
38
  };
33
39
  static flags: {
40
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
34
41
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
35
42
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
36
43
  };
@@ -46,8 +53,11 @@ export default abstract class BaseCommand extends Command {
46
53
  protected getDefaultProfile(): string;
47
54
  protected getProfile(): string | undefined;
48
55
  /**
49
- * Load and parse the credentials file. Returns null if the file doesn't exist.
56
+ * Get the resolved credentials file path, respecting --config flag and XANO_CONFIG env var.
57
+ * Reads -c/--config from process.argv directly because oclif doesn't set this.flags
58
+ * from parsed results — the static flags property is the flag definition, not parsed values.
50
59
  */
60
+ protected getCredentialsPath(): string;
51
61
  protected loadCredentialsFile(): CredentialsFile | null;
52
62
  /**
53
63
  * Get or create the singleton sandbox environment for the authenticated user.
@@ -7,8 +7,25 @@ import { checkForUpdate } from './update-check.js';
7
7
  export function buildUserAgent(version) {
8
8
  return `xano-cli/${version} (${process.platform}; ${process.arch}) node/${process.version}`;
9
9
  }
10
+ /**
11
+ * Resolve the credentials file path from flag, env var, or default.
12
+ * Checks (in order): explicit configPath arg, XANO_CONFIG env var, ~/.xano/credentials.yaml
13
+ */
14
+ export function resolveCredentialsPath(configPath) {
15
+ const explicit = configPath || process.env.XANO_CONFIG;
16
+ if (explicit) {
17
+ return path.resolve(explicit);
18
+ }
19
+ return path.join(os.homedir(), '.xano', 'credentials.yaml');
20
+ }
10
21
  export default class BaseCommand extends Command {
11
22
  static baseFlags = {
23
+ config: Flags.string({
24
+ char: 'c',
25
+ description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
26
+ env: 'XANO_CONFIG',
27
+ required: false,
28
+ }),
12
29
  profile: Flags.string({
13
30
  char: 'p',
14
31
  description: 'Profile to use (uses default profile if not specified)',
@@ -88,11 +105,22 @@ export default class BaseCommand extends Command {
88
105
  return this.flags?.profile;
89
106
  }
90
107
  /**
91
- * Load and parse the credentials file. Returns null if the file doesn't exist.
108
+ * Get the resolved credentials file path, respecting --config flag and XANO_CONFIG env var.
109
+ * Reads -c/--config from process.argv directly because oclif doesn't set this.flags
110
+ * from parsed results — the static flags property is the flag definition, not parsed values.
92
111
  */
112
+ getCredentialsPath() {
113
+ const args = process.argv;
114
+ for (let i = 0; i < args.length; i++) {
115
+ if ((args[i] === '--config' || args[i] === '-c') && args[i + 1])
116
+ return resolveCredentialsPath(args[i + 1]);
117
+ if (args[i]?.startsWith('--config='))
118
+ return resolveCredentialsPath(args[i].slice('--config='.length));
119
+ }
120
+ return resolveCredentialsPath();
121
+ }
93
122
  loadCredentialsFile() {
94
- const configDir = path.join(os.homedir(), '.xano');
95
- const credentialsPath = path.join(configDir, 'credentials.yaml');
123
+ const credentialsPath = this.getCredentialsPath();
96
124
  if (!fs.existsSync(credentialsPath)) {
97
125
  return null;
98
126
  }
@@ -3,6 +3,7 @@ export default class Auth extends Command {
3
3
  static description: string;
4
4
  static examples: string[];
5
5
  static flags: {
6
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
7
  insecure: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
8
  origin: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
8
9
  };
@@ -4,10 +4,9 @@ import inquirer from 'inquirer';
4
4
  import * as yaml from 'js-yaml';
5
5
  import * as fs from 'node:fs';
6
6
  import * as http from 'node:http';
7
- import * as os from 'node:os';
8
- import { join } from 'node:path';
7
+ import { dirname } from 'node:path';
9
8
  import open from 'open';
10
- import { buildUserAgent } from '../../base-command.js';
9
+ import { buildUserAgent, resolveCredentialsPath } from '../../base-command.js';
11
10
  const AUTH_TIMEOUT_MS = 5 * 60 * 1000; // 5 minutes
12
11
  export default class Auth extends Command {
13
12
  static description = 'Authenticate with Xano via browser login';
@@ -23,6 +22,12 @@ Profile 'default' created successfully!`,
23
22
  Opening browser for Xano login at https://custom.xano.com...`,
24
23
  ];
25
24
  static flags = {
25
+ config: Flags.string({
26
+ char: 'c',
27
+ description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
28
+ env: 'XANO_CONFIG',
29
+ required: false,
30
+ }),
26
31
  insecure: Flags.boolean({
27
32
  char: 'k',
28
33
  default: false,
@@ -101,7 +106,7 @@ Opening browser for Xano login at https://custom.xano.com...`,
101
106
  instance_origin: instance.origin,
102
107
  name: profileName,
103
108
  workspace: workspace?.id,
104
- });
109
+ }, flags.config);
105
110
  this.log('');
106
111
  this.log(`Profile '${profileName}' created successfully!`);
107
112
  // Ensure clean exit (the open() call can keep the event loop alive)
@@ -206,12 +211,12 @@ Opening browser for Xano login at https://custom.xano.com...`,
206
211
  ]);
207
212
  return profileName.trim() || 'default';
208
213
  }
209
- async saveProfile(profile) {
210
- const configDir = join(os.homedir(), '.xano');
211
- const credentialsPath = join(configDir, 'credentials.yaml');
212
- // Ensure the .xano directory exists
213
- if (!fs.existsSync(configDir)) {
214
- fs.mkdirSync(configDir, { recursive: true });
214
+ async saveProfile(profile, configPath) {
215
+ const credentialsPath = resolveCredentialsPath(configPath);
216
+ const credDir = dirname(credentialsPath);
217
+ // Ensure the directory exists
218
+ if (!fs.existsSync(credDir)) {
219
+ fs.mkdirSync(credDir, { recursive: true });
215
220
  }
216
221
  // Read existing credentials file or create new structure
217
222
  let credentials = { profiles: {} };
@@ -11,6 +11,7 @@ export default class BranchCreate extends BaseCommand {
11
11
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  source: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
13
  workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
16
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
17
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchCreate extends BaseCommand {
8
6
  static description = 'Create a new branch by cloning from an existing branch';
@@ -146,8 +144,7 @@ Created branch: feature-auth
146
144
  }
147
145
  }
148
146
  loadCredentials() {
149
- const configDir = path.join(os.homedir(), '.xano');
150
- const credentialsPath = path.join(configDir, 'credentials.yaml');
147
+ const credentialsPath = this.getCredentialsPath();
151
148
  // Check if credentials file exists
152
149
  if (!fs.existsSync(credentialsPath)) {
153
150
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile create'`);
@@ -9,6 +9,7 @@ export default class BranchDelete extends BaseCommand {
9
9
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
11
  workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchDelete extends BaseCommand {
8
6
  static args = {
@@ -133,8 +131,7 @@ Deleted branch: dev
133
131
  });
134
132
  }
135
133
  loadCredentials() {
136
- const configDir = path.join(os.homedir(), '.xano');
137
- const credentialsPath = path.join(configDir, 'credentials.yaml');
134
+ const credentialsPath = this.getCredentialsPath();
138
135
  // Check if credentials file exists
139
136
  if (!fs.existsSync(credentialsPath)) {
140
137
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -11,6 +11,7 @@ export default class BranchEdit extends BaseCommand {
11
11
  label: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
13
  workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
16
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
17
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchEdit extends BaseCommand {
8
6
  static args = {
@@ -143,8 +141,7 @@ Updated branch: feature-authentication
143
141
  }
144
142
  }
145
143
  loadCredentials() {
146
- const configDir = path.join(os.homedir(), '.xano');
147
- const credentialsPath = path.join(configDir, 'credentials.yaml');
144
+ const credentialsPath = this.getCredentialsPath();
148
145
  // Check if credentials file exists
149
146
  if (!fs.existsSync(credentialsPath)) {
150
147
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -8,6 +8,7 @@ export default class BranchGet extends BaseCommand {
8
8
  static flags: {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
14
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchGet extends BaseCommand {
8
6
  static args = {
@@ -112,8 +110,7 @@ Branch: dev
112
110
  }
113
111
  }
114
112
  loadCredentials() {
115
- const configDir = path.join(os.homedir(), '.xano');
116
- const credentialsPath = path.join(configDir, 'credentials.yaml');
113
+ const credentialsPath = this.getCredentialsPath();
117
114
  // Check if credentials file exists
118
115
  if (!fs.existsSync(credentialsPath)) {
119
116
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -10,6 +10,7 @@ export default class BranchList extends BaseCommand {
10
10
  static examples: string[];
11
11
  static flags: {
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchList extends BaseCommand {
8
6
  static args = {
@@ -115,8 +113,7 @@ Available branches:
115
113
  }
116
114
  }
117
115
  loadCredentials() {
118
- const configDir = path.join(os.homedir(), '.xano');
119
- const credentialsPath = path.join(configDir, 'credentials.yaml');
116
+ const credentialsPath = this.getCredentialsPath();
120
117
  // Check if credentials file exists
121
118
  if (!fs.existsSync(credentialsPath)) {
122
119
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -9,6 +9,7 @@ export default class BranchSetLive extends BaseCommand {
9
9
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
10
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
11
  workspace: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class BranchSetLive extends BaseCommand {
8
6
  static args = {
@@ -132,8 +130,7 @@ Branch 'v1' is now live
132
130
  });
133
131
  }
134
132
  loadCredentials() {
135
- const configDir = path.join(os.homedir(), '.xano');
136
- const credentialsPath = path.join(configDir, 'credentials.yaml');
133
+ const credentialsPath = this.getCredentialsPath();
137
134
  // Check if credentials file exists
138
135
  if (!fs.existsSync(credentialsPath)) {
139
136
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -9,6 +9,7 @@ export default class FunctionCreate extends BaseCommand {
9
9
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
10
  stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
15
  };
@@ -241,8 +241,7 @@ Name: my_function
241
241
  return tmpFile;
242
242
  }
243
243
  loadCredentials() {
244
- const configDir = path.join(os.homedir(), '.xano');
245
- const credentialsPath = path.join(configDir, 'credentials.yaml');
244
+ const credentialsPath = this.getCredentialsPath();
246
245
  // Check if credentials file exists
247
246
  if (!fs.existsSync(credentialsPath)) {
248
247
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -12,6 +12,7 @@ export default class FunctionEdit extends BaseCommand {
12
12
  publish: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
13
  stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
14
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
16
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
17
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
18
  };
@@ -369,8 +369,7 @@ Name: my_function
369
369
  }
370
370
  }
371
371
  loadCredentials() {
372
- const configDir = path.join(os.homedir(), '.xano');
373
- const credentialsPath = path.join(configDir, 'credentials.yaml');
372
+ const credentialsPath = this.getCredentialsPath();
374
373
  // Check if credentials file exists
375
374
  if (!fs.existsSync(credentialsPath)) {
376
375
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
@@ -10,6 +10,7 @@ export default class FunctionGet extends BaseCommand {
10
10
  include_xanoscript: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
11
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
12
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -2,8 +2,6 @@ import { Args, Flags } from '@oclif/core';
2
2
  import inquirer from 'inquirer';
3
3
  import * as yaml from 'js-yaml';
4
4
  import * as fs from 'node:fs';
5
- import * as os from 'node:os';
6
- import * as path from 'node:path';
7
5
  import BaseCommand, { buildUserAgent } from '../../../base-command.js';
8
6
  export default class FunctionGet extends BaseCommand {
9
7
  static args = {
@@ -185,8 +183,7 @@ function yo {
185
183
  }
186
184
  }
187
185
  loadCredentials() {
188
- const configDir = path.join(os.homedir(), '.xano');
189
- const credentialsPath = path.join(configDir, 'credentials.yaml');
186
+ const credentialsPath = this.getCredentialsPath();
190
187
  // Check if credentials file exists
191
188
  if (!fs.existsSync(credentialsPath)) {
192
189
  this.error(`Credentials file not found at ${credentialsPath}\n` + `Create a profile using 'xano profile:create'`);
@@ -12,6 +12,7 @@ export default class FunctionList extends BaseCommand {
12
12
  per_page: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
13
13
  sort: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
14
14
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
16
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
17
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
18
  };
@@ -1,8 +1,6 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class FunctionList extends BaseCommand {
8
6
  static args = {};
@@ -185,8 +183,7 @@ Available functions:
185
183
  }
186
184
  }
187
185
  loadCredentials() {
188
- const configDir = path.join(os.homedir(), '.xano');
189
- const credentialsPath = path.join(configDir, 'credentials.yaml');
186
+ const credentialsPath = this.getCredentialsPath();
190
187
  // Check if credentials file exists
191
188
  if (!fs.existsSync(credentialsPath)) {
192
189
  this.error(`Credentials file not found at ${credentialsPath}\n` +
@@ -10,6 +10,7 @@ export default class PlatformGet extends BaseCommand {
10
10
  static examples: string[];
11
11
  static flags: {
12
12
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
13
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
14
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
15
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
16
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class PlatformGet extends BaseCommand {
8
6
  static args = {
@@ -105,8 +103,7 @@ Platform ID: 23629
105
103
  }
106
104
  }
107
105
  loadCredentials() {
108
- const configDir = path.join(os.homedir(), '.xano');
109
- const credentialsPath = path.join(configDir, 'credentials.yaml');
106
+ const credentialsPath = this.getCredentialsPath();
110
107
  if (!fs.existsSync(credentialsPath)) {
111
108
  this.error(`Credentials file not found at ${credentialsPath}\n` +
112
109
  `Create a profile using 'xano profile create'`);
@@ -4,6 +4,7 @@ export default class PlatformList extends BaseCommand {
4
4
  static examples: string[];
5
5
  static flags: {
6
6
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
10
  };
@@ -1,8 +1,6 @@
1
1
  import { Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class PlatformList extends BaseCommand {
8
6
  static description = 'List all platforms';
@@ -92,8 +90,7 @@ Platforms:
92
90
  }
93
91
  }
94
92
  loadCredentials() {
95
- const configDir = path.join(os.homedir(), '.xano');
96
- const credentialsPath = path.join(configDir, 'credentials.yaml');
93
+ const credentialsPath = this.getCredentialsPath();
97
94
  if (!fs.existsSync(credentialsPath)) {
98
95
  this.error(`Credentials file not found at ${credentialsPath}\n` +
99
96
  `Create a profile using 'xano profile create'`);
@@ -6,6 +6,7 @@ export default class ProfileCreate extends Command {
6
6
  static description: string;
7
7
  static examples: string[];
8
8
  static flags: {
9
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  access_token: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
11
  account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -1,8 +1,8 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import { resolveCredentialsPath } from '../../../base-command.js';
6
6
  export default class ProfileCreate extends Command {
7
7
  static args = {
8
8
  name: Args.string({
@@ -30,6 +30,12 @@ Profile 'selfhosted' created successfully at ~/.xano/credentials.yaml
30
30
  `,
31
31
  ];
32
32
  static flags = {
33
+ config: Flags.string({
34
+ char: 'c',
35
+ description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
36
+ env: 'XANO_CONFIG',
37
+ required: false,
38
+ }),
33
39
  access_token: Flags.string({
34
40
  char: 't',
35
41
  description: 'Access token for the Xano Metadata API',
@@ -69,9 +75,9 @@ Profile 'selfhosted' created successfully at ~/.xano/credentials.yaml
69
75
  };
70
76
  async run() {
71
77
  const { args, flags } = await this.parse(ProfileCreate);
72
- const configDir = path.join(os.homedir(), '.xano');
73
- const credentialsPath = path.join(configDir, 'credentials.yaml');
74
- // Ensure the .xano directory exists
78
+ const credentialsPath = resolveCredentialsPath(flags.config);
79
+ const configDir = path.dirname(credentialsPath);
80
+ // Ensure the directory exists
75
81
  if (!fs.existsSync(configDir)) {
76
82
  fs.mkdirSync(configDir, { recursive: true });
77
83
  this.log(`Created directory: ${configDir}`);
@@ -6,6 +6,7 @@ export default class ProfileDelete extends Command {
6
6
  static description: string;
7
7
  static examples: string[];
8
8
  static flags: {
9
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
11
  };
11
12
  run(): Promise<void>;
@@ -1,8 +1,7 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
4
+ import { resolveCredentialsPath } from '../../../base-command.js';
6
5
  export default class ProfileDelete extends Command {
7
6
  static args = {
8
7
  name: Args.string({
@@ -24,6 +23,12 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
24
23
  `,
25
24
  ];
26
25
  static flags = {
26
+ config: Flags.string({
27
+ char: 'c',
28
+ description: 'Path to credentials file (default: ~/.xano/credentials.yaml)',
29
+ env: 'XANO_CONFIG',
30
+ required: false,
31
+ }),
27
32
  force: Flags.boolean({
28
33
  char: 'f',
29
34
  default: false,
@@ -33,8 +38,7 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
33
38
  };
34
39
  async run() {
35
40
  const { args, flags } = await this.parse(ProfileDelete);
36
- const configDir = path.join(os.homedir(), '.xano');
37
- const credentialsPath = path.join(configDir, 'credentials.yaml');
41
+ const credentialsPath = resolveCredentialsPath(flags.config);
38
42
  // Check if credentials file exists
39
43
  if (!fs.existsSync(credentialsPath)) {
40
44
  this.error(`Credentials file not found at ${credentialsPath}. No profiles to delete.`);
@@ -15,6 +15,7 @@ export default class ProfileEdit extends BaseCommand {
15
15
  'remove-insecure': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
16
  'remove-workspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
17
  workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
+ config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
18
19
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
20
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
21
  };
@@ -1,8 +1,6 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
2
  import * as yaml from 'js-yaml';
3
3
  import * as fs from 'node:fs';
4
- import * as os from 'node:os';
5
- import * as path from 'node:path';
6
4
  import BaseCommand from '../../../base-command.js';
7
5
  export default class ProfileEdit extends BaseCommand {
8
6
  static args = {
@@ -87,8 +85,7 @@ Profile 'default' updated successfully at ~/.xano/credentials.yaml
87
85
  const { args, flags } = await this.parse(ProfileEdit);
88
86
  // Use provided name or default profile
89
87
  const profileName = args.name || this.getDefaultProfile();
90
- const configDir = path.join(os.homedir(), '.xano');
91
- const credentialsPath = path.join(configDir, 'credentials.yaml');
88
+ const credentialsPath = this.getCredentialsPath();
92
89
  // Check if credentials file exists
93
90
  if (!fs.existsSync(credentialsPath)) {
94
91
  this.error(`Credentials file not found at ${credentialsPath}. Create a profile first using 'profile:create'.`);