@helloworlkd/pam-cli 0.1.16 → 0.1.17

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
@@ -2,6 +2,8 @@
2
2
 
3
3
  CLI for persistent, portable, model-independent AI memory.
4
4
 
5
+ Published package: `@helloworlkd/pam-cli`.
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -26,10 +28,8 @@ cd your-project
26
28
  npm install -D @helloworlkd/pam-cli
27
29
  ```
28
30
 
29
- Local install creates `.ai-memory/` and supported agent/IDE integration files.
30
- After the first install, reload VS Code/Cursor windows, start a new Claude
31
- Code/OpenCode session, or restart/open a new Codex session so the client reloads
32
- project config.
31
+ Local install creates `.ai-memory/`. Run `pam init` after install to choose
32
+ which agent/IDE integration files to generate.
33
33
 
34
34
  ## Quick Start
35
35
 
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAanC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QA6BnD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAmBnC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAsCnD"}
@@ -1,21 +1,26 @@
1
- import { configureCodexGlobalIntegration, configureProjectIntegrations, initAutoCaptureConfig, initProjectMemory, } from '@helloworlkd/pam-core';
1
+ import { createInterface } from 'node:readline/promises';
2
+ import { stdin as input, stdout as output } from 'node:process';
3
+ import { configureCodexGlobalIntegration, configureProjectIntegrations, getAllProjectIntegrationTargets, initAutoCaptureConfig, initProjectMemory, } from '@helloworlkd/pam-core';
2
4
  export function registerInitCommand(program) {
3
5
  const init = program.command('init').description('Initialize memory storage');
4
6
  init
5
7
  .option('--codex-global', 'Also configure the global Codex MCP server in ~/.codex/config.toml')
6
- .option('--no-integrations', 'Skip agent and IDE integration files')
8
+ .option('--no-integrations', 'Skip project agent and IDE integration files')
9
+ .option('--all-integrations', 'Generate every supported project integration file')
10
+ .option('--integration <target>', 'Generate one project integration target. Repeatable. Targets: agents, claude, codex, copilot, cursor, opencode, mcp, vscode', collectIntegrationTarget, [])
7
11
  .action(async (options) => {
8
12
  const cwd = process.cwd();
9
13
  const path = await initProjectMemory(cwd);
10
14
  await initAutoCaptureConfig(path);
11
15
  console.log(`Memory initialized at: ${path}`);
12
- if (options.integrations !== false) {
13
- const { results } = await configureProjectIntegrations(cwd);
14
- console.log('\nProject integrations:');
15
- for (const result of results) {
16
- const suffix = result.reason ? ` (${result.reason})` : '';
17
- console.log(` ${result.status}: ${result.path}${suffix}`);
18
- }
16
+ const targets = await resolveIntegrationTargets(options);
17
+ if (targets.length > 0) {
18
+ const { results } = await configureProjectIntegrations(cwd, { targets });
19
+ printIntegrationResults(results);
20
+ }
21
+ else if (options.integrations !== false) {
22
+ console.log('\nProject integrations skipped.');
23
+ console.log('Run `pam init --integration <target>` or `pam init --all-integrations` when you know which tool files you want.');
19
24
  }
20
25
  if (options.codexGlobal) {
21
26
  const result = await configureCodexGlobalIntegration();
@@ -26,4 +31,69 @@ export function registerInitCommand(program) {
26
31
  }
27
32
  });
28
33
  }
34
+ function collectIntegrationTarget(value, previous) {
35
+ return [...previous, value];
36
+ }
37
+ async function resolveIntegrationTargets(options) {
38
+ if (options.integrations === false)
39
+ return [];
40
+ if (options.allIntegrations)
41
+ return getAllProjectIntegrationTargets();
42
+ const explicit = normalizeIntegrationTargets(options.integration ?? []);
43
+ if (explicit.length > 0)
44
+ return explicit;
45
+ if (!process.stdin.isTTY || !process.stdout.isTTY)
46
+ return [];
47
+ return promptForIntegrationTargets();
48
+ }
49
+ function normalizeIntegrationTargets(values) {
50
+ const allTargets = new Set(getAllProjectIntegrationTargets());
51
+ const normalized = values.flatMap((value) => value
52
+ .split(',')
53
+ .map((entry) => entry.trim().toLowerCase())
54
+ .filter(Boolean));
55
+ const invalid = normalized.filter((value) => !allTargets.has(value));
56
+ if (invalid.length > 0) {
57
+ console.error(`Invalid integration target(s): ${invalid.join(', ')}`);
58
+ console.error(`Valid targets: ${getAllProjectIntegrationTargets().join(', ')}`);
59
+ process.exit(1);
60
+ }
61
+ return [...new Set(normalized)];
62
+ }
63
+ async function promptForIntegrationTargets() {
64
+ const targets = getAllProjectIntegrationTargets();
65
+ console.log('\nWhich project integrations should PAM generate?');
66
+ targets.forEach((target, index) => {
67
+ console.log(` ${index + 1}. ${target}`);
68
+ });
69
+ console.log(' 0. none');
70
+ const rl = createInterface({ input, output });
71
+ try {
72
+ const answer = await rl.question('Select numbers or names separated by commas (default: none): ');
73
+ const trimmed = answer.trim();
74
+ if (!trimmed)
75
+ return [];
76
+ if (trimmed === '0' || trimmed.toLowerCase() === 'none')
77
+ return [];
78
+ const selected = trimmed.split(',').map((entry) => entry.trim());
79
+ const mapped = selected.map((entry) => {
80
+ const numeric = Number.parseInt(entry, 10);
81
+ if (Number.isFinite(numeric) && String(numeric) === entry) {
82
+ return targets[numeric - 1] ?? entry;
83
+ }
84
+ return entry;
85
+ });
86
+ return normalizeIntegrationTargets(mapped);
87
+ }
88
+ finally {
89
+ rl.close();
90
+ }
91
+ }
92
+ function printIntegrationResults(results) {
93
+ console.log('\nProject integrations:');
94
+ for (const result of results) {
95
+ const suffix = result.reason ? ` (${result.reason})` : '';
96
+ console.log(` ${result.status}: ${result.path}${suffix}`);
97
+ }
98
+ }
29
99
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,uBAAuB,CAAA;AAO9B,MAAM,UAAU,mBAAmB,CAAC,OAAgB;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,OAAiE;IAEjE,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;IACtC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;QACzD,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAAA;IAC5D,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloworlkd/pam-cli",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "PAM CLI - Command line interface for PAM",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,9 +45,9 @@
45
45
  "@modelcontextprotocol/sdk": "^1.29.0",
46
46
  "commander": "^15.0.0",
47
47
  "zod": "^4.4.3",
48
- "@helloworlkd/pam-core": "^0.1.9",
48
+ "@helloworlkd/pam-core": "^0.1.10",
49
49
  "@helloworlkd/pam-protocol": "^0.1.10",
50
- "@helloworlkd/pam-api": "^0.1.15"
50
+ "@helloworlkd/pam-api": "^0.1.16"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^25.9.3"
@@ -69,21 +69,13 @@ function scheduleDeferredInit(projectPath) {
69
69
 
70
70
  async function initializeProject(projectPath) {
71
71
  try {
72
- const { configureProjectIntegrations, initAutoCaptureConfig, initProjectMemory } =
73
- await import('@helloworlkd/pam-core')
72
+ const { initAutoCaptureConfig, initProjectMemory } = await import('@helloworlkd/pam-core')
74
73
  const memoryPath = await initProjectMemory(projectPath)
75
74
  await initAutoCaptureConfig(memoryPath)
76
- const { results } = await configureProjectIntegrations(projectPath)
77
- const changed = results.filter(
78
- (result) => result.status === 'created' || result.status === 'updated'
79
- )
80
75
 
81
76
  console.log(`[PAM] Project memory initialized at ${memoryPath}`)
82
- if (changed.length > 0) {
83
- console.log(`[PAM] Wrote ${changed.length} agent/IDE integration file(s).`)
84
- }
85
77
  console.log(
86
- '[PAM] Reload VS Code/Cursor, start a new Claude Code/OpenCode session, or restart/open a new Codex session.'
78
+ '[PAM] Run `pam init` to choose which agent/IDE integration files to generate.'
87
79
  )
88
80
  } catch (error) {
89
81
  console.warn(