anthropic-gateway 1.1.0 → 1.2.0

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/cli.js +17 -0
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -42,6 +42,14 @@ function fail(msg) {
42
42
  process.exit(1);
43
43
  }
44
44
 
45
+ function getVersion() {
46
+ try {
47
+ return require(path.join(APP_DIR, 'package.json')).version;
48
+ } catch {
49
+ return 'unknown';
50
+ }
51
+ }
52
+
45
53
  function ask(rl, q, def) {
46
54
  return new Promise((resolve) => {
47
55
  rl.question(q + (def ? ' [' + def + '] ' : ' '), (a) => resolve(a.trim() === '' ? (def || '') : a.trim()));
@@ -235,6 +243,10 @@ function parseFlags(argv) {
235
243
 
236
244
  (async () => {
237
245
  const argv = process.argv.slice(2);
246
+ if (argv.includes('--version') || argv.includes('-v')) {
247
+ console.log('anthropic-gateway ' + getVersion());
248
+ process.exit(0);
249
+ }
238
250
  const flags = parseFlags(argv);
239
251
  const cmd = flags._ && flags._[0];
240
252
  if (!cmd) {
@@ -248,10 +260,15 @@ function parseFlags(argv) {
248
260
  ' anthropic-gateway stop',
249
261
  ' anthropic-gateway status',
250
262
  ' anthropic-gateway autostart on|off',
263
+ ' anthropic-gateway version # or: --version, -v',
251
264
  ].join('\n')
252
265
  );
253
266
  process.exit(0);
254
267
  }
268
+ if (cmd === 'version') {
269
+ console.log('anthropic-gateway ' + getVersion());
270
+ process.exit(0);
271
+ }
255
272
  if (cmd === 'setup') await cmdSetup(flags);
256
273
  else if (cmd === 'start') await cmdStart(flags);
257
274
  else if (cmd === 'stop') await cmdStop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anthropic-gateway",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Anthropic-compatible local gateway for any OpenAI-compatible model provider — make Claude Code (GUI/CLI) work with kilo, OpenAI, DeepSeek, local models, etc.",
5
5
  "license": "MIT",
6
6
  "engines": {