@xano/cli 0.0.24 → 0.0.26

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 (108) hide show
  1. package/dist/base-command.d.ts +1 -3
  2. package/dist/base-command.js +5 -12
  3. package/dist/commands/function/create/index.d.ts +6 -7
  4. package/dist/commands/function/create/index.js +55 -55
  5. package/dist/commands/function/edit/index.d.ts +10 -11
  6. package/dist/commands/function/edit/index.js +162 -155
  7. package/dist/commands/function/get/index.d.ts +5 -6
  8. package/dist/commands/function/get/index.js +60 -55
  9. package/dist/commands/function/list/index.d.ts +5 -6
  10. package/dist/commands/function/list/index.js +52 -52
  11. package/dist/commands/profile/create/index.d.ts +6 -6
  12. package/dist/commands/profile/create/index.js +37 -37
  13. package/dist/commands/profile/delete/index.d.ts +2 -2
  14. package/dist/commands/profile/delete/index.js +9 -9
  15. package/dist/commands/profile/edit/index.d.ts +7 -8
  16. package/dist/commands/profile/edit/index.js +48 -48
  17. package/dist/commands/profile/get-default/index.js +1 -1
  18. package/dist/commands/profile/list/index.d.ts +2 -2
  19. package/dist/commands/profile/list/index.js +9 -9
  20. package/dist/commands/profile/me/index.d.ts +3 -4
  21. package/dist/commands/profile/me/index.js +21 -21
  22. package/dist/commands/profile/project/index.js +1 -1
  23. package/dist/commands/profile/set-default/index.js +1 -1
  24. package/dist/commands/profile/token/index.js +1 -1
  25. package/dist/commands/profile/wizard/index.d.ts +4 -5
  26. package/dist/commands/profile/wizard/index.js +108 -142
  27. package/dist/commands/run/env/delete/index.d.ts +2 -3
  28. package/dist/commands/run/env/delete/index.js +10 -10
  29. package/dist/commands/run/env/get/index.d.ts +2 -3
  30. package/dist/commands/run/env/get/index.js +11 -11
  31. package/dist/commands/run/env/list/index.d.ts +2 -3
  32. package/dist/commands/run/env/list/index.js +19 -17
  33. package/dist/commands/run/env/set/index.d.ts +2 -3
  34. package/dist/commands/run/env/set/index.js +5 -5
  35. package/dist/commands/run/exec/index.d.ts +8 -19
  36. package/dist/commands/run/exec/index.js +108 -186
  37. package/dist/commands/run/info/index.d.ts +4 -5
  38. package/dist/commands/run/info/index.js +27 -27
  39. package/dist/commands/run/projects/create/index.d.ts +3 -4
  40. package/dist/commands/run/projects/create/index.js +23 -23
  41. package/dist/commands/run/projects/delete/index.d.ts +2 -3
  42. package/dist/commands/run/projects/delete/index.js +10 -10
  43. package/dist/commands/run/projects/list/index.d.ts +2 -3
  44. package/dist/commands/run/projects/list/index.js +12 -12
  45. package/dist/commands/run/projects/update/index.d.ts +3 -4
  46. package/dist/commands/run/projects/update/index.js +21 -21
  47. package/dist/commands/run/secrets/delete/index.d.ts +2 -3
  48. package/dist/commands/run/secrets/delete/index.js +10 -10
  49. package/dist/commands/run/secrets/get/index.d.ts +2 -3
  50. package/dist/commands/run/secrets/get/index.js +11 -11
  51. package/dist/commands/run/secrets/list/index.d.ts +2 -3
  52. package/dist/commands/run/secrets/list/index.js +24 -22
  53. package/dist/commands/run/secrets/set/index.d.ts +3 -4
  54. package/dist/commands/run/secrets/set/index.js +16 -16
  55. package/dist/commands/run/sessions/delete/index.d.ts +2 -3
  56. package/dist/commands/run/sessions/delete/index.js +10 -10
  57. package/dist/commands/run/sessions/get/index.d.ts +2 -3
  58. package/dist/commands/run/sessions/get/index.js +11 -11
  59. package/dist/commands/run/sessions/list/index.d.ts +2 -3
  60. package/dist/commands/run/sessions/list/index.js +11 -11
  61. package/dist/commands/run/sessions/start/index.d.ts +2 -3
  62. package/dist/commands/run/sessions/start/index.js +11 -11
  63. package/dist/commands/run/sessions/stop/index.d.ts +2 -3
  64. package/dist/commands/run/sessions/stop/index.js +11 -11
  65. package/dist/commands/run/sink/get/index.d.ts +2 -3
  66. package/dist/commands/run/sink/get/index.js +11 -11
  67. package/dist/commands/static_host/build/create/index.d.ts +4 -5
  68. package/dist/commands/static_host/build/create/index.js +33 -33
  69. package/dist/commands/static_host/build/get/index.d.ts +4 -5
  70. package/dist/commands/static_host/build/get/index.js +20 -20
  71. package/dist/commands/static_host/build/list/index.d.ts +3 -4
  72. package/dist/commands/static_host/build/list/index.js +31 -31
  73. package/dist/commands/static_host/list/index.d.ts +3 -4
  74. package/dist/commands/static_host/list/index.js +31 -31
  75. package/dist/commands/workspace/list/index.d.ts +2 -3
  76. package/dist/commands/workspace/list/index.js +15 -15
  77. package/dist/commands/workspace/pull/index.d.ts +4 -5
  78. package/dist/commands/workspace/pull/index.js +52 -47
  79. package/dist/commands/workspace/push/index.d.ts +0 -1
  80. package/dist/commands/workspace/push/index.js +4 -4
  81. package/dist/help.d.ts +1 -1
  82. package/dist/lib/base-run-command.d.ts +6 -6
  83. package/dist/lib/base-run-command.js +6 -8
  84. package/dist/lib/run-http-client.d.ts +18 -24
  85. package/dist/lib/run-http-client.js +61 -96
  86. package/dist/lib/run-types.d.ts +80 -80
  87. package/oclif.manifest.json +888 -2031
  88. package/package.json +5 -2
  89. package/dist/commands/branch/create/index.d.ts +0 -17
  90. package/dist/commands/branch/create/index.js +0 -164
  91. package/dist/commands/branch/delete/index.d.ts +0 -18
  92. package/dist/commands/branch/delete/index.js +0 -156
  93. package/dist/commands/branch/edit/index.d.ts +0 -19
  94. package/dist/commands/branch/edit/index.js +0 -166
  95. package/dist/commands/branch/get/index.d.ts +0 -16
  96. package/dist/commands/branch/get/index.js +0 -135
  97. package/dist/commands/branch/list/index.d.ts +0 -18
  98. package/dist/commands/branch/list/index.js +0 -138
  99. package/dist/commands/branch/set-live/index.d.ts +0 -18
  100. package/dist/commands/branch/set-live/index.js +0 -155
  101. package/dist/commands/workspace/create/index.d.ts +0 -14
  102. package/dist/commands/workspace/create/index.js +0 -131
  103. package/dist/commands/workspace/delete/index.d.ts +0 -20
  104. package/dist/commands/workspace/delete/index.js +0 -141
  105. package/dist/commands/workspace/edit/index.d.ts +0 -22
  106. package/dist/commands/workspace/edit/index.js +0 -176
  107. package/dist/commands/workspace/get/index.d.ts +0 -18
  108. package/dist/commands/workspace/get/index.js +0 -136
@@ -1,11 +1,57 @@
1
1
  import { Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../base-command.js';
7
7
  export default class FunctionList extends BaseCommand {
8
8
  static args = {};
9
+ static flags = {
10
+ ...BaseCommand.baseFlags,
11
+ workspace: Flags.string({
12
+ char: 'w',
13
+ description: 'Workspace ID (optional if set in profile)',
14
+ required: false,
15
+ }),
16
+ output: Flags.string({
17
+ char: 'o',
18
+ description: 'Output format',
19
+ required: false,
20
+ default: 'summary',
21
+ options: ['summary', 'json'],
22
+ }),
23
+ include_draft: Flags.boolean({
24
+ description: 'Include draft functions',
25
+ required: false,
26
+ default: false,
27
+ }),
28
+ include_xanoscript: Flags.boolean({
29
+ description: 'Include XanoScript in response',
30
+ required: false,
31
+ default: false,
32
+ }),
33
+ page: Flags.integer({
34
+ description: 'Page number for pagination',
35
+ required: false,
36
+ default: 1,
37
+ }),
38
+ per_page: Flags.integer({
39
+ description: 'Number of results per page',
40
+ required: false,
41
+ default: 50,
42
+ }),
43
+ sort: Flags.string({
44
+ description: 'Sort field',
45
+ required: false,
46
+ default: 'created_at',
47
+ }),
48
+ order: Flags.string({
49
+ description: 'Sort order',
50
+ required: false,
51
+ default: 'desc',
52
+ options: ['asc', 'desc'],
53
+ }),
54
+ };
9
55
  static description = 'List all functions in a workspace from the Xano Metadata API';
10
56
  static examples = [
11
57
  `$ xano function:list -w 40
@@ -36,52 +82,6 @@ Available functions:
36
82
  ]
37
83
  `,
38
84
  ];
39
- static flags = {
40
- ...BaseCommand.baseFlags,
41
- include_draft: Flags.boolean({
42
- default: false,
43
- description: 'Include draft functions',
44
- required: false,
45
- }),
46
- include_xanoscript: Flags.boolean({
47
- default: false,
48
- description: 'Include XanoScript in response',
49
- required: false,
50
- }),
51
- order: Flags.string({
52
- default: 'desc',
53
- description: 'Sort order',
54
- options: ['asc', 'desc'],
55
- required: false,
56
- }),
57
- output: Flags.string({
58
- char: 'o',
59
- default: 'summary',
60
- description: 'Output format',
61
- options: ['summary', 'json'],
62
- required: false,
63
- }),
64
- page: Flags.integer({
65
- default: 1,
66
- description: 'Page number for pagination',
67
- required: false,
68
- }),
69
- per_page: Flags.integer({
70
- default: 50,
71
- description: 'Number of results per page',
72
- required: false,
73
- }),
74
- sort: Flags.string({
75
- default: 'created_at',
76
- description: 'Sort field',
77
- required: false,
78
- }),
79
- workspace: Flags.string({
80
- char: 'w',
81
- description: 'Workspace ID (optional if set in profile)',
82
- required: false,
83
- }),
84
- };
85
85
  async run() {
86
86
  const { flags } = await this.parse(FunctionList);
87
87
  // Get profile name (default or from flag/env)
@@ -118,21 +118,21 @@ Available functions:
118
118
  const queryParams = new URLSearchParams({
119
119
  include_draft: flags.include_draft.toString(),
120
120
  include_xanoscript: flags.include_xanoscript.toString(),
121
- order: flags.order,
122
121
  page: flags.page.toString(),
123
122
  per_page: flags.per_page.toString(),
124
123
  sort: flags.sort,
124
+ order: flags.order,
125
125
  });
126
126
  // Construct the API URL
127
127
  const apiUrl = `${profile.instance_origin}/api:meta/workspace/${workspaceId}/function?${queryParams.toString()}`;
128
128
  // Fetch functions from the API
129
129
  try {
130
130
  const response = await fetch(apiUrl, {
131
+ method: 'GET',
131
132
  headers: {
132
133
  'accept': 'application/json',
133
134
  'Authorization': `Bearer ${profile.access_token}`,
134
135
  },
135
- method: 'GET',
136
136
  });
137
137
  if (!response.ok) {
138
138
  const errorText = await response.text();
@@ -165,11 +165,11 @@ Available functions:
165
165
  else {
166
166
  this.log('Available functions:');
167
167
  for (const func of functions) {
168
- if (func.id === undefined) {
169
- this.log(` - ${func.name}`);
168
+ if (func.id !== undefined) {
169
+ this.log(` - ${func.name} (ID: ${func.id})`);
170
170
  }
171
171
  else {
172
- this.log(` - ${func.name} (ID: ${func.id})`);
172
+ this.log(` - ${func.name}`);
173
173
  }
174
174
  }
175
175
  }
@@ -3,17 +3,17 @@ export default class ProfileCreate extends Command {
3
3
  static args: {
4
4
  name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
5
  };
6
- static description: string;
7
- static examples: string[];
8
6
  static flags: {
9
- access_token: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
7
  account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
- default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
8
  instance_origin: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
+ access_token: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
10
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
12
  project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
13
  run_base_url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
16
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
15
  };
16
+ static description: string;
17
+ static examples: string[];
18
18
  run(): Promise<void>;
19
19
  }
@@ -1,8 +1,8 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  export default class ProfileCreate extends Command {
7
7
  static args = {
8
8
  name: Args.string({
@@ -10,34 +10,25 @@ export default class ProfileCreate extends Command {
10
10
  required: true,
11
11
  }),
12
12
  };
13
- static description = 'Create a new profile configuration';
14
- static examples = [
15
- `$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123
16
- Profile 'production' created successfully at ~/.xano/credentials.yaml
17
- `,
18
- `$ xano profile:create staging -a https://staging-account.xano.com -i https://staging-instance.xano.com -t token456
19
- Profile 'staging' created successfully at ~/.xano/credentials.yaml
20
- `,
21
- `$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch
22
- Profile 'dev' created successfully at ~/.xano/credentials.yaml
23
- `,
24
- `$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch -j my-project
25
- Profile 'dev' created successfully at ~/.xano/credentials.yaml
26
- `,
27
- `$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123 --default
28
- Profile 'production' created successfully at ~/.xano/credentials.yaml
29
- Default profile set to 'production'
30
- `,
31
- ];
32
13
  static flags = {
14
+ account_origin: Flags.string({
15
+ char: 'a',
16
+ description: 'Account origin URL. Optional for self hosted installs.',
17
+ required: false,
18
+ }),
19
+ instance_origin: Flags.string({
20
+ char: 'i',
21
+ description: 'Instance origin URL',
22
+ required: true,
23
+ }),
33
24
  access_token: Flags.string({
34
25
  char: 't',
35
26
  description: 'Access token for the Xano Metadata API',
36
27
  required: true,
37
28
  }),
38
- account_origin: Flags.string({
39
- char: 'a',
40
- description: 'Account origin URL. Optional for self hosted installs.',
29
+ workspace: Flags.string({
30
+ char: 'w',
31
+ description: 'Workspace name',
41
32
  required: false,
42
33
  }),
43
34
  branch: Flags.string({
@@ -45,16 +36,6 @@ Default profile set to 'production'
45
36
  description: 'Branch name',
46
37
  required: false,
47
38
  }),
48
- default: Flags.boolean({
49
- default: false,
50
- description: 'Set this profile as the default',
51
- required: false,
52
- }),
53
- instance_origin: Flags.string({
54
- char: 'i',
55
- description: 'Instance origin URL',
56
- required: true,
57
- }),
58
39
  project: Flags.string({
59
40
  char: 'j',
60
41
  description: 'Project name',
@@ -65,12 +46,31 @@ Default profile set to 'production'
65
46
  description: 'Xano Run API base URL (default: https://app.xano.com/)',
66
47
  required: false,
67
48
  }),
68
- workspace: Flags.string({
69
- char: 'w',
70
- description: 'Workspace name',
49
+ default: Flags.boolean({
50
+ description: 'Set this profile as the default',
71
51
  required: false,
52
+ default: false,
72
53
  }),
73
54
  };
55
+ static description = 'Create a new profile configuration';
56
+ static examples = [
57
+ `$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123
58
+ Profile 'production' created successfully at ~/.xano/credentials.yaml
59
+ `,
60
+ `$ xano profile:create staging -a https://staging-account.xano.com -i https://staging-instance.xano.com -t token456
61
+ Profile 'staging' created successfully at ~/.xano/credentials.yaml
62
+ `,
63
+ `$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch
64
+ Profile 'dev' created successfully at ~/.xano/credentials.yaml
65
+ `,
66
+ `$ xano profile:create dev -i https://dev-instance.xano.com -t token789 -w my-workspace -b feature-branch -j my-project
67
+ Profile 'dev' created successfully at ~/.xano/credentials.yaml
68
+ `,
69
+ `$ xano profile:create production --account_origin https://account.xano.com --instance_origin https://instance.xano.com --access_token token123 --default
70
+ Profile 'production' created successfully at ~/.xano/credentials.yaml
71
+ Default profile set to 'production'
72
+ `,
73
+ ];
74
74
  async run() {
75
75
  const { args, flags } = await this.parse(ProfileCreate);
76
76
  const configDir = path.join(os.homedir(), '.xano');
@@ -101,9 +101,9 @@ Default profile set to 'production'
101
101
  // Add or update the profile
102
102
  const profileExists = args.name in credentials.profiles;
103
103
  credentials.profiles[args.name] = {
104
- access_token: flags.access_token,
105
104
  account_origin: flags.account_origin ?? '',
106
105
  instance_origin: flags.instance_origin,
106
+ access_token: flags.access_token,
107
107
  ...(flags.workspace && { workspace: flags.workspace }),
108
108
  ...(flags.branch && { branch: flags.branch }),
109
109
  ...(flags.project && { project: flags.project }),
@@ -3,11 +3,11 @@ export default class ProfileDelete extends Command {
3
3
  static args: {
4
4
  name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
5
  };
6
- static description: string;
7
- static examples: string[];
8
6
  static flags: {
9
7
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
8
  };
9
+ static description: string;
10
+ static examples: string[];
11
11
  run(): Promise<void>;
12
12
  private confirm;
13
13
  private promptInput;
@@ -1,8 +1,8 @@
1
1
  import { Args, Command, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  export default class ProfileDelete extends Command {
7
7
  static args = {
8
8
  name: Args.string({
@@ -10,6 +10,14 @@ export default class ProfileDelete extends Command {
10
10
  required: true,
11
11
  }),
12
12
  };
13
+ static flags = {
14
+ force: Flags.boolean({
15
+ char: 'f',
16
+ description: 'Skip confirmation prompt',
17
+ required: false,
18
+ default: false,
19
+ }),
20
+ };
13
21
  static description = 'Delete a profile configuration';
14
22
  static examples = [
15
23
  `$ xano profile:delete old-profile
@@ -23,14 +31,6 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
23
31
  Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
24
32
  `,
25
33
  ];
26
- static flags = {
27
- force: Flags.boolean({
28
- char: 'f',
29
- default: false,
30
- description: 'Skip confirmation prompt',
31
- required: false,
32
- }),
33
- };
34
34
  async run() {
35
35
  const { args, flags } = await this.parse(ProfileDelete);
36
36
  const configDir = path.join(os.homedir(), '.xano');
@@ -3,22 +3,21 @@ export default class ProfileEdit extends BaseCommand {
3
3
  static args: {
4
4
  name: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
5
5
  };
6
- static description: string;
7
- static examples: string[];
8
6
  static flags: {
9
- access_token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
7
  account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
8
  instance_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ access_token: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
12
  project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ 'remove-workspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
14
  'remove-branch': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
15
  'remove-project': import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
- 'remove-run-base-url': import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
- 'remove-workspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
16
  run_base_url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
- workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
+ 'remove-run-base-url': import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
18
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
22
19
  };
20
+ static description: string;
21
+ static examples: string[];
23
22
  run(): Promise<void>;
24
23
  }
@@ -1,8 +1,8 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  import BaseCommand from '../../../base-command.js';
7
7
  export default class ProfileEdit extends BaseCommand {
8
8
  static args = {
@@ -11,40 +11,26 @@ export default class ProfileEdit extends BaseCommand {
11
11
  required: false,
12
12
  }),
13
13
  };
14
- static description = 'Edit an existing profile configuration';
15
- static examples = [
16
- `$ xano profile:edit --access_token new_token123
17
- Profile 'default' updated successfully at ~/.xano/credentials.yaml
18
- `,
19
- `$ xano profile:edit production --access_token new_token123
20
- Profile 'production' updated successfully at ~/.xano/credentials.yaml
21
- `,
22
- `$ xano profile:edit staging -i https://new-staging-instance.xano.com -t new_token456
23
- Profile 'staging' updated successfully at ~/.xano/credentials.yaml
24
- `,
25
- `$ xano profile:edit -b new-branch
26
- Profile 'default' updated successfully at ~/.xano/credentials.yaml
27
- `,
28
- `$ xano profile:edit --remove-branch
29
- Profile 'default' updated successfully at ~/.xano/credentials.yaml
30
- `,
31
- `$ xano profile:edit -j my-project
32
- Profile 'default' updated successfully at ~/.xano/credentials.yaml
33
- `,
34
- `$ xano profile:edit --remove-project
35
- Profile 'default' updated successfully at ~/.xano/credentials.yaml
36
- `,
37
- ];
38
14
  static flags = {
39
15
  ...BaseCommand.baseFlags,
16
+ account_origin: Flags.string({
17
+ char: 'a',
18
+ description: 'Update account origin URL',
19
+ required: false,
20
+ }),
21
+ instance_origin: Flags.string({
22
+ char: 'i',
23
+ description: 'Update instance origin URL',
24
+ required: false,
25
+ }),
40
26
  access_token: Flags.string({
41
27
  char: 't',
42
28
  description: 'Update access token for the Xano Metadata API',
43
29
  required: false,
44
30
  }),
45
- account_origin: Flags.string({
46
- char: 'a',
47
- description: 'Update account origin URL',
31
+ workspace: Flags.string({
32
+ char: 'w',
33
+ description: 'Update workspace name',
48
34
  required: false,
49
35
  }),
50
36
  branch: Flags.string({
@@ -52,47 +38,61 @@ Profile 'default' updated successfully at ~/.xano/credentials.yaml
52
38
  description: 'Update branch name',
53
39
  required: false,
54
40
  }),
55
- instance_origin: Flags.string({
56
- char: 'i',
57
- description: 'Update instance origin URL',
58
- required: false,
59
- }),
60
41
  project: Flags.string({
61
42
  char: 'j',
62
- description: 'Update project ID',
43
+ description: 'Update project name',
63
44
  required: false,
64
45
  }),
65
- 'remove-branch': Flags.boolean({
46
+ 'remove-workspace': Flags.boolean({
47
+ description: 'Remove workspace from profile',
48
+ required: false,
66
49
  default: false,
50
+ }),
51
+ 'remove-branch': Flags.boolean({
67
52
  description: 'Remove branch from profile',
68
53
  required: false,
54
+ default: false,
69
55
  }),
70
56
  'remove-project': Flags.boolean({
71
- default: false,
72
57
  description: 'Remove project from profile',
73
58
  required: false,
74
- }),
75
- 'remove-run-base-url': Flags.boolean({
76
- default: false,
77
- description: 'Remove run_base_url from profile (use default)',
78
- required: false,
79
- }),
80
- 'remove-workspace': Flags.boolean({
81
59
  default: false,
82
- description: 'Remove workspace from profile',
83
- required: false,
84
60
  }),
85
61
  run_base_url: Flags.string({
86
62
  char: 'r',
87
63
  description: 'Update Xano Run API base URL',
88
64
  required: false,
89
65
  }),
90
- workspace: Flags.string({
91
- char: 'w',
92
- description: 'Update workspace name',
66
+ 'remove-run-base-url': Flags.boolean({
67
+ description: 'Remove run_base_url from profile (use default)',
93
68
  required: false,
69
+ default: false,
94
70
  }),
95
71
  };
72
+ static description = 'Edit an existing profile configuration';
73
+ static examples = [
74
+ `$ xano profile:edit --access_token new_token123
75
+ Profile 'default' updated successfully at ~/.xano/credentials.yaml
76
+ `,
77
+ `$ xano profile:edit production --access_token new_token123
78
+ Profile 'production' updated successfully at ~/.xano/credentials.yaml
79
+ `,
80
+ `$ xano profile:edit staging -i https://new-staging-instance.xano.com -t new_token456
81
+ Profile 'staging' updated successfully at ~/.xano/credentials.yaml
82
+ `,
83
+ `$ xano profile:edit -b new-branch
84
+ Profile 'default' updated successfully at ~/.xano/credentials.yaml
85
+ `,
86
+ `$ xano profile:edit --remove-branch
87
+ Profile 'default' updated successfully at ~/.xano/credentials.yaml
88
+ `,
89
+ `$ xano profile:edit -j my-project
90
+ Profile 'default' updated successfully at ~/.xano/credentials.yaml
91
+ `,
92
+ `$ xano profile:edit --remove-project
93
+ Profile 'default' updated successfully at ~/.xano/credentials.yaml
94
+ `,
95
+ ];
96
96
  async run() {
97
97
  const { args, flags } = await this.parse(ProfileEdit);
98
98
  // Use provided name or default profile
@@ -1,8 +1,8 @@
1
1
  import { Command } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  export default class ProfileGetDefault extends Command {
7
7
  static description = 'Get the current default profile name';
8
8
  static examples = [
@@ -1,10 +1,10 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class ProfileList extends Command {
3
- static description: string;
4
- static examples: string[];
5
3
  static flags: {
6
4
  details: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
5
  };
6
+ static description: string;
7
+ static examples: string[];
8
8
  run(): Promise<void>;
9
9
  private maskToken;
10
10
  }
@@ -1,9 +1,17 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
- import * as yaml from 'js-yaml';
3
2
  import * as fs from 'node:fs';
4
3
  import * as os from 'node:os';
5
4
  import * as path from 'node:path';
5
+ import * as yaml from 'js-yaml';
6
6
  export default class ProfileList extends Command {
7
+ static flags = {
8
+ details: Flags.boolean({
9
+ char: 'd',
10
+ description: 'Show detailed information for each profile',
11
+ required: false,
12
+ default: false,
13
+ }),
14
+ };
7
15
  static description = 'List all available profile configurations';
8
16
  static examples = [
9
17
  `$ xano profile:list
@@ -41,14 +49,6 @@ Profile: default
41
49
  Project: my-project
42
50
  `,
43
51
  ];
44
- static flags = {
45
- details: Flags.boolean({
46
- char: 'd',
47
- default: false,
48
- description: 'Show detailed information for each profile',
49
- required: false,
50
- }),
51
- };
52
52
  async run() {
53
53
  const { flags } = await this.parse(ProfileList);
54
54
  const configDir = path.join(os.homedir(), '.xano');
@@ -1,13 +1,12 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class ProfileMe extends BaseCommand {
3
- static description: string;
4
- static examples: string[];
5
3
  static flags: {
6
4
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
7
5
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
6
  };
7
+ static description: string;
8
+ static examples: string[];
10
9
  run(): Promise<void>;
11
- private formatKey;
12
10
  private loadCredentials;
11
+ private formatKey;
13
12
  }