Skip to content

Commit c2d1459

Browse files
committed
cli: read --version from package.json; bump v0.1.4
1 parent a0eb27b commit c2d1459

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

Formula/agentlock.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
class Agentlock < Formula
22
desc "Locally-hosted, open-source firewall for AI coding agents"
33
homepage "https://openagentlock.github.io/OpenAgentLock"
4-
url "https://registry.npmjs.org/@openagentlock/cli/-/cli-0.1.3.tgz"
5-
sha256 "ac6583fbc009617484517b75b85c6eb873ef9af0e2d2fcf5e38a404c6ff519e2"
4+
url "https://registry.npmjs.org/@openagentlock/cli/-/cli-0.1.4.tgz"
5+
sha256 "REPLACE_AFTER_NPM_PUBLISH"
66
license "FSL-1.1-Apache-2.0"
7-
version "0.1.3"
7+
version "0.1.4"
88

99
depends_on "bun"
1010

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openagentlock/cli",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"type": "module",
55
"license": "SEE LICENSE IN LICENSE",
66
"description": "OpenAgentLock CLI — a firewall for AI coding agents. Detects local agent harnesses (Claude Code, Codex CLI, Cursor, OpenCode, Cline, Gemini CLI, Continue, Copilot), gates risky tool calls via a Go control plane, anchors decisions in a Rust Merkle ledger.",

cli/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// See docs/api/openapi.yaml for the control-plane API that will execute
99
// install once it's signed off.
1010

11+
import { readFileSync } from "node:fs";
12+
import { dirname, join } from "node:path";
13+
import { fileURLToPath } from "node:url";
14+
1115
import { Command } from "commander";
1216
import { runDashboard } from "./commands/dashboard.ts";
1317
import { runDetect } from "./commands/detect.ts";
@@ -20,12 +24,17 @@ import { runHookCodex } from "./commands/hook-codex.ts";
2024
import { runLedgerRoot, runLedgerVerify } from "./commands/ledger.ts";
2125
import { runSignerEnroll } from "./commands/signer-enroll.ts";
2226

27+
// Read version from the published package.json so `agentlock --version`
28+
// always matches the installed npm version, no hand-bumping required.
29+
const PKG_PATH = join(dirname(fileURLToPath(import.meta.url)), "..", "package.json");
30+
const PKG_VERSION = (JSON.parse(readFileSync(PKG_PATH, "utf8")) as { version: string }).version;
31+
2332
const program = new Command();
2433

2534
program
2635
.name("agentlock")
2736
.description("Local-first hardening for AI coding agents.")
28-
.version("0.0.1");
37+
.version(PKG_VERSION);
2938

3039
program
3140
.command("detect")

0 commit comments

Comments
 (0)