@sechroom/cli 2026.6.1 → 2026.6.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.
Files changed (3) hide show
  1. package/README.md +23 -7
  2. package/dist/index.js +21 -0
  3. package/package.json +9 -10
package/README.md CHANGED
@@ -54,15 +54,27 @@ npm i -g @sechroom/cli@next
54
54
  npx @sechroom/cli login
55
55
  ```
56
56
 
57
+ ## Develop
58
+
59
+ This is a **pnpm workspace member** (`frontend/apps/cli`). Install from the repo root
60
+ (`pnpm install`), then run scripts via the filter (or `pnpm <script>` from this dir):
61
+
62
+ ```bash
63
+ pnpm --filter @sechroom/cli run gen # regenerate the typed client
64
+ pnpm --filter @sechroom/cli run check-types
65
+ pnpm --filter @sechroom/cli run build
66
+ pnpm --filter @sechroom/cli run dev -- --help # tsx, no build
67
+ ```
68
+
57
69
  ## Generate the client (once, and after any API change)
58
70
 
59
71
  ```bash
60
72
  # defaults to https://app.sechroom.ai/api/openapi/v1.json
61
- npm run gen
62
- SECHROOM_OPENAPI_URL=https://<host>/api/openapi/v1.json npm run gen # other envs
73
+ pnpm --filter @sechroom/cli run gen
74
+ SECHROOM_OPENAPI_URL=https://<host>/api/openapi/v1.json pnpm --filter @sechroom/cli run gen # other envs
63
75
  ```
64
76
 
65
- `npm run gen` overwrites `src/generated/api.d.ts`. The **real generated types are
77
+ `gen` overwrites `src/generated/api.d.ts`. The **real generated types are
66
78
  committed** (regenerated from the live prod spec) so builds are hermetic — no
67
79
  live-API dependency at compile time; re-run `gen` after any API change. Generating
68
80
  against the live schema is what caught the original placeholder's shape drift
@@ -82,6 +94,9 @@ sechroom memory get mem_XXXX
82
94
  sechroom memory search "convention lifecycle drift" --limit 5
83
95
  sechroom worklog append --text "shipped CLI skeleton; pointers: ..." --source claude-code-chris
84
96
 
97
+ sechroom lookup mem_XXXX # what is this id? -> kind / title / view URL
98
+ sechroom lookup sechroom:mem_XXXX --json # namespaced form also resolves
99
+
85
100
  sechroom --json memory get mem_XXXX # agent-friendly
86
101
  ```
87
102
 
@@ -101,10 +116,11 @@ src/
101
116
  auth.ts OAuth auth-code+PKCE loopback (fixed-port DCR) + refresh + cache
102
117
  client.ts openapi-fetch client (auth + tenant middleware) + emit/fail
103
118
  config.ts base-url / tenant / token resolution + persistence
104
- generated/api.d.ts typed client — `npm run gen`; real types committed (hermetic)
119
+ generated/api.d.ts typed client — `pnpm run gen`; real types committed (hermetic)
105
120
  commands/
106
121
  memory.ts create / get / search
107
122
  worklog.ts append
123
+ lookup.ts resolve any id (mem_…/unprefixed/sechroom:<id>) -> kind/title/url
108
124
  ```
109
125
 
110
126
  ## Remaining before ship
@@ -123,9 +139,9 @@ Public **npmjs** under the `@sechroom` org is the host; **TeamCity** is the
123
139
  publisher (build config `Sechroom_PublishCli`). The full pipeline — steps,
124
140
  parameters, npm auth, provisioning, and how to run a publish — is documented in
125
141
  [`ci/PUBLISHING.md`](./ci/PUBLISHING.md). In short: a manual-trigger config runs
126
- `npm ci → gen → typecheck → build → publish` in a `node:20` container, authed by
127
- a masked `NPM_TOKEN` param; `next` stamps a per-build prerelease, `latest` ships
128
- `BASE_CLI_VERSION`.
142
+ `pnpm install → gen → check-types → build → publish` (filtered to `@sechroom/cli`)
143
+ in a `node:20` container, authed by a masked `NPM_TOKEN` param. Every publish gets a
144
+ fresh calendar version `YYYY.M.<n>` (own counter); the dist-tag separates next/latest.
129
145
 
130
146
  Why public npmjs: the CLI is customer-facing, and `npx @sechroom/cli` must work
131
147
  with zero `.npmrc`/token on the customer side. GitHub Packages or a private
package/dist/index.js CHANGED
@@ -309,6 +309,26 @@ function registerWorklog(program2) {
309
309
  });
310
310
  }
311
311
 
312
+ // src/commands/lookup.ts
313
+ function registerLookup(program2) {
314
+ program2.command("lookup <id>").description(
315
+ "Resolve a sechroom id to its kind, title, and view URL (mem_\u2026/wsp_\u2026/prj_\u2026, unprefixed, or sechroom:<id>)"
316
+ ).action(async (id, _opts, cmd) => {
317
+ const cfg = resolveConfig(cmd.optsWithGlobals());
318
+ const client = await makeClient(cfg);
319
+ const { data, error } = await client.GET("/lookup/{id}", {
320
+ params: { path: { id } }
321
+ });
322
+ if (error) fail(error);
323
+ if (data == null) {
324
+ process.stderr.write(`not found: ${id}
325
+ `);
326
+ process.exit(1);
327
+ }
328
+ emit(data, cmd.optsWithGlobals().json);
329
+ });
330
+ }
331
+
312
332
  // src/index.ts
313
333
  var program = new Command();
314
334
  program.name("sechroom").description("Sechroom CLI \u2014 thin generated client over the Sechroom HTTP API. An agent/human surface alongside MCP.").version("0.0.0").option("--base-url <url>", "API base URL (overrides config / SECHROOM_BASE_URL)").option("--tenant <tenant>", "Tenant id (required by the API; overrides config / SECHROOM_TENANT)").option("--json", "Emit compact JSON (for scripts and agents)", false);
@@ -334,6 +354,7 @@ config.command("show").description("Print persisted config").action(() => {
334
354
  });
335
355
  registerMemory(program);
336
356
  registerWorklog(program);
357
+ registerLookup(program);
337
358
  program.parseAsync().catch((err) => {
338
359
  process.stderr.write(`error: ${err instanceof Error ? err.message : String(err)}
339
360
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sechroom/cli",
3
- "version": "2026.6.1",
3
+ "version": "2026.6.2",
4
4
  "description": "Sechroom CLI — a thin, generated client over the Sechroom HTTP API. An agent/human surface alongside MCP.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -8,7 +8,7 @@
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/OcdLimited/sechroom.git",
11
- "directory": "tools/sechroom-cli"
11
+ "directory": "frontend/apps/cli"
12
12
  },
13
13
  "bin": {
14
14
  "sechroom": "./dist/index.js"
@@ -23,13 +23,6 @@
23
23
  "access": "public",
24
24
  "registry": "https://registry.npmjs.org/"
25
25
  },
26
- "scripts": {
27
- "gen": "openapi-typescript \"${SECHROOM_OPENAPI_URL:-https://app.sechroom.ai/api/openapi/v1.json}\" -o src/generated/api.d.ts",
28
- "build": "tsup src/index.ts --format esm --target node20 --clean",
29
- "dev": "tsx src/index.ts",
30
- "typecheck": "tsc --noEmit",
31
- "prepublishOnly": "npm run build"
32
- },
33
26
  "dependencies": {
34
27
  "commander": "^12.1.0",
35
28
  "open": "^10.1.0",
@@ -41,5 +34,11 @@
41
34
  "tsup": "^8.3.0",
42
35
  "tsx": "^4.19.0",
43
36
  "typescript": "^5.6.0"
37
+ },
38
+ "scripts": {
39
+ "gen": "openapi-typescript \"${SECHROOM_OPENAPI_URL:-https://app.sechroom.ai/api/openapi/v1.json}\" -o src/generated/api.d.ts",
40
+ "build": "tsup src/index.ts --format esm --target node20 --clean",
41
+ "dev": "tsx src/index.ts",
42
+ "check-types": "tsc --noEmit"
44
43
  }
45
- }
44
+ }