@ast-ai-model-router/cli 2.0.0 → 2.0.2

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
@@ -29,6 +29,7 @@ Run without installing:
29
29
 
30
30
  ```bash
31
31
  npx --yes --package @ast-ai-model-router/cli ast-ai-model-router --help
32
+ npx --yes @ast-ai-model-router/cli --version
32
33
  ```
33
34
 
34
35
  ## Quick Start
@@ -245,6 +246,13 @@ This project is part of the [`faraa2m`](https://github.com/faraa2m) token-econom
245
246
 
246
247
  The router reads local source files to compute AST complexity and launches the local `claude` or `codex` CLI. It does not run a separate network service and does not upload source code. Any model traffic comes from the Claude Code or Codex CLI you choose to run.
247
248
 
249
+ ## Project Health
250
+
251
+ - [Contributing guide](./CONTRIBUTING.md)
252
+ - [Security policy](./SECURITY.md)
253
+ - [Code of Conduct](./CODE_OF_CONDUCT.md)
254
+ - [Changelog](./CHANGELOG.md)
255
+
248
256
  ## Status
249
257
 
250
258
  This is an explainable heuristic router. It is production-usable for policy and workflow guardrails, but it does not claim empirically proven model-quality optimization yet. Future releases can add outcome logging and calibration against real task success.
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawn } from "node:child_process";
3
3
  import { access, writeFile } from "node:fs/promises";
4
+ import { readFileSync } from "node:fs";
4
5
  import path from "node:path";
5
6
  import { parseArgs } from "node:util";
6
7
  import { CONFIG_TEMPLATE, loadConfig, validateTier } from "../lib/config.js";
@@ -35,12 +36,22 @@ Options:
35
36
  const EXIT_INVALID = 2;
36
37
  const EXIT_POLICY = 3;
37
38
 
39
+ function readPackageVersion() {
40
+ const packageJsonUrl = new URL("../package.json", import.meta.url);
41
+ const packageJson = JSON.parse(readFileSync(packageJsonUrl, "utf8"));
42
+ return packageJson.version ?? "0.0.0";
43
+ }
44
+
38
45
  async function main() {
39
46
  const [command, maybeAgent, ...rest] = process.argv.slice(2);
40
47
  if (!command || command === "--help" || command === "-h") {
41
48
  process.stdout.write(HELP);
42
49
  return;
43
50
  }
51
+ if (command === "version" || command === "--version" || command === "-v") {
52
+ process.stdout.write(`${readPackageVersion()}\n`);
53
+ return;
54
+ }
44
55
 
45
56
  if (command === "init") {
46
57
  const { values } = parseArgs({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ast-ai-model-router/cli",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "AST-based Claude Code and Codex model router with token-cost estimates, CI policy checks, and explainable AI coding-agent model selection.",
5
5
  "type": "module",
6
6
  "bin": {