@inceptionstack/roundhouse 0.3.5 → 0.3.6

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/package.json +1 -1
  2. package/src/cli/cli.ts +18 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inceptionstack/roundhouse",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "type": "module",
5
5
  "description": "Multi-platform chat gateway that routes messages through a configured AI agent",
6
6
  "license": "MIT",
package/src/cli/cli.ts CHANGED
@@ -609,12 +609,23 @@ const commands: Record<string, () => void | Promise<void>> = {
609
609
  agent: cmdAgent,
610
610
  };
611
611
 
612
- const fn = command ? commands[command] : undefined;
613
- if (fn) {
614
- Promise.resolve(fn()).catch((err) => {
615
- console.error(`[roundhouse] ${command} failed:`, err);
616
- process.exit(1);
617
- });
612
+ if (command === "--version" || command === "-v") {
613
+ try {
614
+ const pkg = JSON.parse(
615
+ await readFile(resolve(__dirname, "..", "..", "package.json"), "utf8")
616
+ );
617
+ console.log(pkg.version);
618
+ } catch {
619
+ console.log("unknown");
620
+ }
618
621
  } else {
619
- printHelp();
622
+ const fn = command ? commands[command] : undefined;
623
+ if (fn) {
624
+ Promise.resolve(fn()).catch((err) => {
625
+ console.error(`[roundhouse] ${command} failed:`, err);
626
+ process.exit(1);
627
+ });
628
+ } else {
629
+ printHelp();
630
+ }
620
631
  }