@invizi/cli 0.1.2 → 0.1.3

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 (2) hide show
  1. package/dist/invizi.js +6 -24
  2. package/package.json +1 -1
package/dist/invizi.js CHANGED
@@ -96,34 +96,16 @@ async function executeRemote(args, options = {}) {
96
96
  export async function main(rawArgs = process.argv.slice(2)) {
97
97
  const args = rawArgs;
98
98
  const command = args[0];
99
- if (!command) {
99
+ if (!command || command === '--help' || command === '-h') {
100
100
  showLocalHelp();
101
- return 0;
102
- }
103
- if (command === '--help' || command === '-h') {
104
101
  const header = await getAuthorizationHeader();
105
- if (!header) {
106
- showLocalHelp();
107
- return 0;
108
- }
109
- try {
110
- await showRemoteHelp(header);
111
- return 0;
112
- }
113
- catch {
102
+ if (header) {
114
103
  try {
115
- const code = await executeRemote(['--help'], { quietNetworkError: true });
116
- if (code !== 0) {
117
- showLocalHelp();
118
- return 0;
119
- }
120
- return code;
121
- }
122
- catch {
123
- showLocalHelp();
124
- return 0;
104
+ await showRemoteHelp(header);
125
105
  }
106
+ catch { /* server unreachable — just show local */ }
126
107
  }
108
+ return 0;
127
109
  }
128
110
  if (command === 'auth')
129
111
  return auth(args.slice(1));
@@ -136,7 +118,7 @@ export async function main(rawArgs = process.argv.slice(2)) {
136
118
  console.log(`\nConfig path: ${getConfigPath()}`);
137
119
  return 0;
138
120
  }
139
- if (command === 'version') {
121
+ if (command === 'version' || command === '--version' || command === '-v') {
140
122
  const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8'));
141
123
  console.log(`invizi-cli v${pkg.version || 'unknown'}`);
142
124
  return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invizi/cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Invizi CLI",
5
5
  "type": "module",
6
6
  "bin": {