@xano/cli 0.0.20 → 0.0.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 (107) hide show
  1. package/dist/base-command.d.ts +1 -1
  2. package/dist/base-command.js +6 -6
  3. package/dist/commands/branch/create/index.d.ts +17 -0
  4. package/dist/commands/branch/create/index.js +164 -0
  5. package/dist/commands/branch/delete/index.d.ts +18 -0
  6. package/dist/commands/branch/delete/index.js +156 -0
  7. package/dist/commands/branch/edit/index.d.ts +19 -0
  8. package/dist/commands/branch/edit/index.js +166 -0
  9. package/dist/commands/branch/get/index.d.ts +16 -0
  10. package/dist/commands/branch/get/index.js +135 -0
  11. package/dist/commands/branch/list/index.d.ts +18 -0
  12. package/dist/commands/branch/list/index.js +138 -0
  13. package/dist/commands/branch/set-live/index.d.ts +18 -0
  14. package/dist/commands/branch/set-live/index.js +155 -0
  15. package/dist/commands/function/create/index.d.ts +6 -6
  16. package/dist/commands/function/create/index.js +55 -55
  17. package/dist/commands/function/edit/index.d.ts +10 -10
  18. package/dist/commands/function/edit/index.js +155 -162
  19. package/dist/commands/function/get/index.d.ts +5 -5
  20. package/dist/commands/function/get/index.js +55 -60
  21. package/dist/commands/function/list/index.d.ts +5 -5
  22. package/dist/commands/function/list/index.js +52 -52
  23. package/dist/commands/profile/create/index.d.ts +6 -6
  24. package/dist/commands/profile/create/index.js +37 -37
  25. package/dist/commands/profile/delete/index.d.ts +2 -2
  26. package/dist/commands/profile/delete/index.js +9 -9
  27. package/dist/commands/profile/edit/index.d.ts +7 -7
  28. package/dist/commands/profile/edit/index.js +47 -47
  29. package/dist/commands/profile/get-default/index.js +1 -1
  30. package/dist/commands/profile/list/index.d.ts +2 -2
  31. package/dist/commands/profile/list/index.js +9 -9
  32. package/dist/commands/profile/me/index.d.ts +3 -3
  33. package/dist/commands/profile/me/index.js +21 -21
  34. package/dist/commands/profile/project/index.js +1 -1
  35. package/dist/commands/profile/set-default/index.js +1 -1
  36. package/dist/commands/profile/token/index.js +1 -1
  37. package/dist/commands/profile/wizard/index.d.ts +4 -4
  38. package/dist/commands/profile/wizard/index.js +118 -122
  39. package/dist/commands/run/env/delete/index.d.ts +2 -2
  40. package/dist/commands/run/env/delete/index.js +9 -9
  41. package/dist/commands/run/env/get/index.d.ts +2 -2
  42. package/dist/commands/run/env/get/index.js +10 -10
  43. package/dist/commands/run/env/list/index.d.ts +2 -2
  44. package/dist/commands/run/env/list/index.js +16 -18
  45. package/dist/commands/run/env/set/index.d.ts +2 -2
  46. package/dist/commands/run/env/set/index.js +4 -4
  47. package/dist/commands/run/exec/index.d.ts +11 -11
  48. package/dist/commands/run/exec/index.js +109 -109
  49. package/dist/commands/run/info/index.d.ts +4 -4
  50. package/dist/commands/run/info/index.js +26 -26
  51. package/dist/commands/run/projects/create/index.d.ts +3 -3
  52. package/dist/commands/run/projects/create/index.js +22 -22
  53. package/dist/commands/run/projects/delete/index.d.ts +2 -2
  54. package/dist/commands/run/projects/delete/index.js +9 -9
  55. package/dist/commands/run/projects/list/index.d.ts +2 -2
  56. package/dist/commands/run/projects/list/index.js +11 -11
  57. package/dist/commands/run/projects/update/index.d.ts +3 -3
  58. package/dist/commands/run/projects/update/index.js +20 -20
  59. package/dist/commands/run/secrets/delete/index.d.ts +2 -2
  60. package/dist/commands/run/secrets/delete/index.js +9 -9
  61. package/dist/commands/run/secrets/get/index.d.ts +2 -2
  62. package/dist/commands/run/secrets/get/index.js +10 -10
  63. package/dist/commands/run/secrets/list/index.d.ts +2 -2
  64. package/dist/commands/run/secrets/list/index.js +21 -23
  65. package/dist/commands/run/secrets/set/index.d.ts +3 -3
  66. package/dist/commands/run/secrets/set/index.js +15 -15
  67. package/dist/commands/run/sessions/delete/index.d.ts +2 -2
  68. package/dist/commands/run/sessions/delete/index.js +9 -9
  69. package/dist/commands/run/sessions/get/index.d.ts +2 -2
  70. package/dist/commands/run/sessions/get/index.js +10 -10
  71. package/dist/commands/run/sessions/list/index.d.ts +2 -2
  72. package/dist/commands/run/sessions/list/index.js +10 -10
  73. package/dist/commands/run/sessions/start/index.d.ts +2 -2
  74. package/dist/commands/run/sessions/start/index.js +10 -10
  75. package/dist/commands/run/sessions/stop/index.d.ts +2 -2
  76. package/dist/commands/run/sessions/stop/index.js +10 -10
  77. package/dist/commands/run/sink/get/index.d.ts +2 -2
  78. package/dist/commands/run/sink/get/index.js +10 -10
  79. package/dist/commands/static_host/build/create/index.d.ts +4 -4
  80. package/dist/commands/static_host/build/create/index.js +33 -33
  81. package/dist/commands/static_host/build/get/index.d.ts +4 -4
  82. package/dist/commands/static_host/build/get/index.js +20 -20
  83. package/dist/commands/static_host/build/list/index.d.ts +3 -3
  84. package/dist/commands/static_host/build/list/index.js +31 -31
  85. package/dist/commands/static_host/list/index.d.ts +3 -3
  86. package/dist/commands/static_host/list/index.js +31 -31
  87. package/dist/commands/workspace/create/index.d.ts +14 -0
  88. package/dist/commands/workspace/create/index.js +131 -0
  89. package/dist/commands/workspace/delete/index.d.ts +20 -0
  90. package/dist/commands/workspace/delete/index.js +141 -0
  91. package/dist/commands/workspace/edit/index.d.ts +22 -0
  92. package/dist/commands/workspace/edit/index.js +176 -0
  93. package/dist/commands/workspace/get/index.d.ts +18 -0
  94. package/dist/commands/workspace/get/index.js +136 -0
  95. package/dist/commands/workspace/list/index.d.ts +2 -2
  96. package/dist/commands/workspace/list/index.js +15 -15
  97. package/dist/commands/workspace/pull/index.d.ts +4 -4
  98. package/dist/commands/workspace/pull/index.js +46 -51
  99. package/dist/commands/workspace/push/index.js +3 -3
  100. package/dist/help.d.ts +1 -1
  101. package/dist/lib/base-run-command.d.ts +4 -4
  102. package/dist/lib/base-run-command.js +3 -3
  103. package/dist/lib/run-http-client.d.ts +21 -21
  104. package/dist/lib/run-http-client.js +72 -72
  105. package/dist/lib/run-types.d.ts +80 -80
  106. package/oclif.manifest.json +1633 -791
  107. package/package.json +1 -1
@@ -1,57 +1,11 @@
1
1
  import { Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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
- };
55
9
  static description = 'List all functions in a workspace from the Xano Metadata API';
56
10
  static examples = [
57
11
  `$ xano function:list -w 40
@@ -82,6 +36,52 @@ Available functions:
82
36
  ]
83
37
  `,
84
38
  ];
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,
121
122
  page: flags.page.toString(),
122
123
  per_page: flags.per_page.toString(),
123
124
  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',
132
131
  headers: {
133
132
  'accept': 'application/json',
134
133
  'Authorization': `Bearer ${profile.access_token}`,
135
134
  },
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} (ID: ${func.id})`);
168
+ if (func.id === undefined) {
169
+ this.log(` - ${func.name}`);
170
170
  }
171
171
  else {
172
- this.log(` - ${func.name}`);
172
+ this.log(` - ${func.name} (ID: ${func.id})`);
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[];
6
8
  static flags: {
7
- account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- instance_origin: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
9
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>;
10
+ account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
+ instance_origin: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
12
14
  project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
15
  run_base_url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
- default: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
+ workspace: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
17
  };
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';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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,25 +10,34 @@ 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
+ ];
13
32
  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
- }),
24
33
  access_token: Flags.string({
25
34
  char: 't',
26
35
  description: 'Access token for the Xano Metadata API',
27
36
  required: true,
28
37
  }),
29
- workspace: Flags.string({
30
- char: 'w',
31
- description: 'Workspace name',
38
+ account_origin: Flags.string({
39
+ char: 'a',
40
+ description: 'Account origin URL. Optional for self hosted installs.',
32
41
  required: false,
33
42
  }),
34
43
  branch: Flags.string({
@@ -36,6 +45,16 @@ export default class ProfileCreate extends Command {
36
45
  description: 'Branch name',
37
46
  required: false,
38
47
  }),
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
+ }),
39
58
  project: Flags.string({
40
59
  char: 'j',
41
60
  description: 'Project name',
@@ -46,31 +65,12 @@ export default class ProfileCreate extends Command {
46
65
  description: 'Xano Run API base URL (default: https://app.xano.com/)',
47
66
  required: false,
48
67
  }),
49
- default: Flags.boolean({
50
- description: 'Set this profile as the default',
68
+ workspace: Flags.string({
69
+ char: 'w',
70
+ description: 'Workspace name',
51
71
  required: false,
52
- default: false,
53
72
  }),
54
73
  };
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,
104
105
  account_origin: flags.account_origin ?? '',
105
106
  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[];
6
8
  static flags: {
7
9
  force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
8
10
  };
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';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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,14 +10,6 @@ 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
- };
21
13
  static description = 'Delete a profile configuration';
22
14
  static examples = [
23
15
  `$ xano profile:delete old-profile
@@ -31,6 +23,14 @@ Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
31
23
  Profile 'old-profile' deleted successfully from ~/.xano/credentials.yaml
32
24
  `,
33
25
  ];
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,22 @@ 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[];
6
8
  static flags: {
7
- account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- instance_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
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>;
10
+ account_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
11
  branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ instance_origin: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  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
- run_base_url: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
17
16
  'remove-run-base-url': import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
+ 'remove-workspace': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ 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>;
18
20
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
21
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
22
  };
21
- static description: string;
22
- static examples: string[];
23
23
  run(): Promise<void>;
24
24
  }
@@ -1,8 +1,8 @@
1
1
  import { Args, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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,26 +11,40 @@ 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
+ ];
14
38
  static flags = {
15
39
  ...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
- }),
26
40
  access_token: Flags.string({
27
41
  char: 't',
28
42
  description: 'Update access token for the Xano Metadata API',
29
43
  required: false,
30
44
  }),
31
- workspace: Flags.string({
32
- char: 'w',
33
- description: 'Update workspace name',
45
+ account_origin: Flags.string({
46
+ char: 'a',
47
+ description: 'Update account origin URL',
34
48
  required: false,
35
49
  }),
36
50
  branch: Flags.string({
@@ -38,61 +52,47 @@ export default class ProfileEdit extends BaseCommand {
38
52
  description: 'Update branch name',
39
53
  required: false,
40
54
  }),
55
+ instance_origin: Flags.string({
56
+ char: 'i',
57
+ description: 'Update instance origin URL',
58
+ required: false,
59
+ }),
41
60
  project: Flags.string({
42
61
  char: 'j',
43
62
  description: 'Update project ID',
44
63
  required: false,
45
64
  }),
46
- 'remove-workspace': Flags.boolean({
47
- description: 'Remove workspace from profile',
48
- required: false,
49
- default: false,
50
- }),
51
65
  'remove-branch': Flags.boolean({
66
+ default: false,
52
67
  description: 'Remove branch from profile',
53
68
  required: false,
54
- default: false,
55
69
  }),
56
70
  'remove-project': Flags.boolean({
71
+ default: false,
57
72
  description: 'Remove project from profile',
58
73
  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({
59
81
  default: false,
82
+ description: 'Remove workspace from profile',
83
+ required: false,
60
84
  }),
61
85
  run_base_url: Flags.string({
62
86
  char: 'r',
63
87
  description: 'Update Xano Run API base URL',
64
88
  required: false,
65
89
  }),
66
- 'remove-run-base-url': Flags.boolean({
67
- description: 'Remove run_base_url from profile (use default)',
90
+ workspace: Flags.string({
91
+ char: 'w',
92
+ description: 'Update workspace name',
68
93
  required: false,
69
- default: false,
70
94
  }),
71
95
  };
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';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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[];
3
5
  static flags: {
4
6
  details: import("@oclif/core/interfaces").BooleanFlag<boolean>;
5
7
  };
6
- static description: string;
7
- static examples: string[];
8
8
  run(): Promise<void>;
9
9
  private maskToken;
10
10
  }
@@ -1,17 +1,9 @@
1
1
  import { Command, Flags } from '@oclif/core';
2
+ import * as yaml from 'js-yaml';
2
3
  import * as fs from 'node:fs';
3
4
  import * as os from 'node:os';
4
5
  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
- };
15
7
  static description = 'List all available profile configurations';
16
8
  static examples = [
17
9
  `$ xano profile:list
@@ -49,6 +41,14 @@ Profile: default
49
41
  Project: my-project
50
42
  `,
51
43
  ];
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,13 @@
1
1
  import BaseCommand from '../../../base-command.js';
2
2
  export default class ProfileMe extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
3
5
  static flags: {
4
6
  output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
5
7
  profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
6
8
  verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
9
  };
8
- static description: string;
9
- static examples: string[];
10
10
  run(): Promise<void>;
11
- private loadCredentials;
12
11
  private formatKey;
12
+ private loadCredentials;
13
13
  }