claude-connect 0.1.3 → 0.1.5

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.
@@ -3,7 +3,6 @@
3
3
  import { spawn } from 'node:child_process';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import process from 'node:process';
6
- import { run } from '../src/index.js';
7
6
 
8
7
  const alreadyRestarted = process.env.CLAUDE_CONNECT_NO_WARNINGS === '1';
9
8
 
@@ -32,9 +31,11 @@ if (!alreadyRestarted && !process.execArgv.includes('--no-warnings=ExperimentalW
32
31
  process.exit(1);
33
32
  });
34
33
  } else {
35
- run().catch((error) => {
36
- const message = error instanceof Error ? error.message : String(error);
37
- console.error(`\nclaude-connect: ${message}`);
38
- process.exitCode = 1;
39
- });
34
+ import('../src/index.js')
35
+ .then(({ run }) => run())
36
+ .catch((error) => {
37
+ const message = error instanceof Error ? error.message : String(error);
38
+ console.error(`\nclaude-connect: ${message}`);
39
+ process.exitCode = 1;
40
+ });
40
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-connect",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "CLI para configurar Claude Code con proveedores de modelos externos",
5
5
  "author": "wmcarlosv",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import packageJson from '../package.json' with { type: 'json' };
1
2
  import { getCatalogStore } from './data/catalog-store.js';
2
3
  import { gatewayBaseUrl } from './gateway/constants.js';
3
4
  import { getGatewayStatus } from './gateway/state.js';
@@ -18,6 +19,10 @@ function printGatewayStatus(status) {
18
19
  process.stdout.write(`${lines.join('\n')}\n`);
19
20
  }
20
21
 
22
+ function printVersion() {
23
+ process.stdout.write(`${packageJson.version}\n`);
24
+ }
25
+
21
26
  async function runGatewayCommand(args) {
22
27
  const action = args[0] ?? 'status';
23
28
 
@@ -51,6 +56,11 @@ async function runGatewayCommand(args) {
51
56
  }
52
57
 
53
58
  export async function run(argv = process.argv.slice(2)) {
59
+ if (argv[0] === '--version' || argv[0] === '-v' || argv[0] === 'version') {
60
+ printVersion();
61
+ return;
62
+ }
63
+
54
64
  if (argv[0] === 'gateway') {
55
65
  await runGatewayCommand(argv.slice(1));
56
66
  return;