@vibe-assurance/cli 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-assurance/cli",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Vibe Assurance CLI - Connect Claude Code to your governance platform",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -4,25 +4,24 @@ const os = require('os');
4
4
  const chalk = require('chalk');
5
5
 
6
6
  /**
7
- * Possible locations for Claude Code MCP configuration
8
- * Ordered by preference (first existing one will be used)
7
+ * Claude Code MCP configuration paths
8
+ *
9
+ * Per Claude Code documentation:
10
+ * - User (global): ~/.claude.json - MCP servers available across all projects
11
+ * - Project: .mcp.json in project root - Team-shared servers
12
+ *
13
+ * We default to user-level config for global availability
9
14
  */
10
- const MCP_CONFIG_PATHS = [
11
- // Standard location
12
- path.join(os.homedir(), '.claude', 'mcp.json'),
13
- // macOS Application Support
14
- path.join(os.homedir(), 'Library', 'Application Support', 'Claude', 'mcp.json'),
15
- // Windows AppData
16
- path.join(os.homedir(), 'AppData', 'Roaming', 'Claude', 'mcp.json'),
17
- // Linux config
18
- path.join(os.homedir(), '.config', 'claude', 'mcp.json')
19
- ];
15
+ const USER_CONFIG_PATH = path.join(os.homedir(), '.claude.json');
16
+ const PROJECT_CONFIG_NAME = '.mcp.json';
20
17
 
21
18
  /**
22
19
  * MCP server configuration for Vibe Assurance
20
+ * Uses stdio transport type for local CLI execution
23
21
  */
24
22
  const VIBE_MCP_CONFIG = {
25
23
  vibeassurance: {
24
+ type: 'stdio',
26
25
  command: 'vibe',
27
26
  args: ['mcp-server']
28
27
  }
@@ -32,43 +31,37 @@ const VIBE_MCP_CONFIG = {
32
31
  * Setup Claude command
33
32
  *
34
33
  * Configures Claude Code to use the Vibe Assurance MCP server
35
- * by adding the vibeassurance entry to mcp.json
34
+ * by adding the vibeassurance entry to ~/.claude.json
35
+ *
36
+ * Per Claude Code docs, user-level config goes in ~/.claude.json
36
37
  */
37
38
  async function setupClaude() {
38
39
  console.log(chalk.blue('Configuring Claude Code to use Vibe Assurance MCP server...\n'));
39
40
 
40
- // Find existing config file or determine default path
41
- let configPath = null;
41
+ const configPath = USER_CONFIG_PATH;
42
42
  let existingConfig = {};
43
43
 
44
- for (const p of MCP_CONFIG_PATHS) {
45
- if (fs.existsSync(p)) {
46
- configPath = p;
47
- try {
48
- const content = fs.readFileSync(p, 'utf8');
49
- existingConfig = JSON.parse(content);
50
- console.log(chalk.gray(`Found existing config at: ${p}`));
51
- } catch (err) {
52
- console.log(chalk.yellow(`Found config file but couldn't parse it, will overwrite: ${p}`));
53
- existingConfig = {};
54
- }
55
- break;
44
+ // Read existing config if it exists
45
+ if (fs.existsSync(configPath)) {
46
+ try {
47
+ const content = fs.readFileSync(configPath, 'utf8');
48
+ existingConfig = JSON.parse(content);
49
+ console.log(chalk.gray(`Found existing config at: ${configPath}`));
50
+ } catch (err) {
51
+ console.log(chalk.yellow(`Config file exists but couldn't parse JSON. Will merge carefully.`));
52
+ existingConfig = {};
56
53
  }
57
- }
58
-
59
- // If no existing config found, use the default path
60
- if (!configPath) {
61
- configPath = MCP_CONFIG_PATHS[0];
54
+ } else {
62
55
  console.log(chalk.gray(`Creating new config at: ${configPath}`));
63
56
  }
64
57
 
65
58
  // Check if vibeassurance is already configured
66
59
  if (existingConfig.mcpServers?.vibeassurance) {
67
60
  console.log(chalk.yellow('Vibe Assurance is already configured in Claude Code.'));
68
- console.log('Updating configuration...');
61
+ console.log('Updating configuration...\n');
69
62
  }
70
63
 
71
- // Merge configuration
64
+ // Merge configuration (preserve all existing settings)
72
65
  const newConfig = {
73
66
  ...existingConfig,
74
67
  mcpServers: {
@@ -77,36 +70,32 @@ async function setupClaude() {
77
70
  }
78
71
  };
79
72
 
80
- // Ensure directory exists
81
- const configDir = path.dirname(configPath);
82
- if (!fs.existsSync(configDir)) {
83
- fs.mkdirSync(configDir, { recursive: true });
84
- console.log(chalk.gray(`Created directory: ${configDir}`));
85
- }
86
-
87
73
  // Write configuration
88
74
  fs.writeFileSync(configPath, JSON.stringify(newConfig, null, 2));
89
75
 
90
76
  // Success output
91
- console.log();
92
77
  console.log(chalk.green('Success!') + ' Claude Code has been configured.\n');
93
78
 
94
79
  console.log('Configuration written to:');
95
- console.log(chalk.gray(` ${configPath}\n`));
80
+ console.log(chalk.cyan(` ${configPath}\n`));
96
81
 
97
82
  console.log('The following MCP server was added:');
98
- console.log(chalk.gray(' vibeassurance: vibe mcp-server\n'));
83
+ console.log(chalk.gray(' vibeassurance:'));
84
+ console.log(chalk.gray(' type: stdio'));
85
+ console.log(chalk.gray(' command: vibe mcp-server\n'));
99
86
 
100
87
  console.log(chalk.blue('Next steps:'));
101
- console.log(' 1. Restart Claude Code');
88
+ console.log(' 1. Restart Claude Code (close and reopen)');
102
89
  console.log(' 2. The vibe_* tools will be available automatically');
103
90
  console.log(' 3. Try asking: "Get my governance context"\n');
104
91
 
105
92
  console.log(chalk.gray('Available tools after restart:'));
106
- console.log(chalk.gray(' - vibe_get_role : Get AI analyst role prompts'));
107
- console.log(chalk.gray(' - vibe_get_context : Get CRs, risks, vulnerabilities'));
93
+ console.log(chalk.gray(' - vibe_get_role : Get AI analyst role prompts'));
94
+ console.log(chalk.gray(' - vibe_list_roles : List all available roles'));
95
+ console.log(chalk.gray(' - vibe_get_context : Get CRs, risks, vulnerabilities'));
96
+ console.log(chalk.gray(' - vibe_get_template : Get document templates'));
108
97
  console.log(chalk.gray(' - vibe_store_artifact: Store created documents'));
109
- console.log(chalk.gray(' - ...and more\n'));
98
+ console.log(chalk.gray(' - vibe_list_artifacts: List stored documents\n'));
110
99
  }
111
100
 
112
101
  module.exports = setupClaude;