@xano/cli 0.0.46 → 0.0.48

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.
package/README.md CHANGED
@@ -475,6 +475,9 @@ default: default
475
475
  ```bash
476
476
  # Update the CLI to the latest version
477
477
  xano update
478
+
479
+ # Check for updates without installing
480
+ xano update --check
478
481
  ```
479
482
 
480
483
  ## Scripts
@@ -60,7 +60,7 @@ Opening browser for Xano login at https://custom.xano.com...`,
60
60
  this.log('');
61
61
  this.log('Fetching available branches...');
62
62
  const branches = await this.fetchBranches(token, instance.origin, workspace.id);
63
- if (branches.length > 0) {
63
+ if (branches.length > 1) {
64
64
  branch = await this.selectBranch(branches);
65
65
  }
66
66
  }
@@ -107,6 +107,10 @@ User Information:
107
107
  this.log(` Name: ${inst.name}`);
108
108
  if (inst.display)
109
109
  this.log(` Display: ${inst.display}`);
110
+ if (profile.workspace)
111
+ this.log(` Workspace: ${profile.workspace}`);
112
+ if (profile.branch)
113
+ this.log(` Branch: ${profile.branch}`);
110
114
  }
111
115
  if (flags.verbose) {
112
116
  knownFields.add('extras');
@@ -137,8 +137,8 @@ Profile 'production' created successfully at ~/.xano/credentials.yaml
137
137
  catch (error) {
138
138
  this.warn(`Failed to fetch branches: ${error instanceof Error ? error.message : String(error)}`);
139
139
  }
140
- // If branches were fetched, let user select one
141
- if (branches.length > 0) {
140
+ // If multiple branches exist, let user select one (skip if only one branch)
141
+ if (branches.length > 1) {
142
142
  this.log('');
143
143
  const { selectedBranch } = await inquirer.prompt([
144
144
  {
@@ -71,7 +71,7 @@ Impersonation successful!
71
71
  const params = new URLSearchParams({
72
72
  _ti: response._ti,
73
73
  });
74
- const impersonateUrl = `${frontendUrl}/tenant-impersonate?${params.toString()}`;
74
+ const impersonateUrl = `${frontendUrl}/impersonate?${params.toString()}`;
75
75
  if (flags['url-only']) {
76
76
  this.log(impersonateUrl);
77
77
  }
@@ -2,5 +2,10 @@ import BaseCommand from '../../base-command.js';
2
2
  export default class Update extends BaseCommand {
3
3
  static description: string;
4
4
  static examples: string[];
5
+ static flags: {
6
+ check: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
+ profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
+ verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
+ };
5
10
  run(): Promise<void>;
6
11
  }
@@ -1,11 +1,17 @@
1
+ import { Flags } from '@oclif/core';
1
2
  import { execSync } from 'node:child_process';
2
3
  import BaseCommand from '../../base-command.js';
3
4
  export default class Update extends BaseCommand {
4
5
  static description = 'Update the Xano CLI to the latest version';
5
- static examples = [
6
- `$ xano update`,
7
- ];
6
+ static examples = [`$ xano update`, `$ xano update --check`];
7
+ static flags = {
8
+ ...BaseCommand.flags,
9
+ check: Flags.boolean({
10
+ description: 'Check for updates without installing',
11
+ }),
12
+ };
8
13
  async run() {
14
+ const { flags } = await this.parse(Update);
9
15
  const currentVersion = this.config.version;
10
16
  this.log(`Current version: ${currentVersion}`);
11
17
  this.log('Checking for updates...');
@@ -15,6 +21,10 @@ export default class Update extends BaseCommand {
15
21
  this.log(`Already up to date (${currentVersion})`);
16
22
  return;
17
23
  }
24
+ if (flags.check) {
25
+ this.log(`Update available: ${currentVersion} → ${latest}`);
26
+ return;
27
+ }
18
28
  this.log(`Updating @xano/cli ${currentVersion} → ${latest}...`);
19
29
  execSync('npm install -g @xano/cli@latest', { stdio: 'inherit' });
20
30
  this.log(`Updated to ${latest}`);