@vibe-assurance/cli 1.0.4 → 1.0.6

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
@@ -1,6 +1,6 @@
1
1
  # @vibe-assurance/cli
2
2
 
3
- Connect Claude Code to your Vibe Assurance governance platform.
3
+ Connect AI coding agents to your Vibe Assurance governance platform via the Model Context Protocol (MCP).
4
4
 
5
5
  ## Installation
6
6
 
@@ -16,13 +16,13 @@ npm install -g @vibe-assurance/cli
16
16
  ```
17
17
  This opens your browser for authentication.
18
18
 
19
- 2. **Configure Claude Code:**
19
+ 2. **Configure your MCP client:**
20
20
  ```bash
21
21
  vibe setup-claude
22
22
  ```
23
- This adds the Vibe Assurance MCP server to your Claude Code configuration.
23
+ This adds the Vibe Assurance MCP server to your MCP client configuration.
24
24
 
25
- 3. **Restart Claude Code** and start using governance tools!
25
+ 3. **Restart your AI agent** and start using governance tools!
26
26
 
27
27
  ## Usage
28
28
 
@@ -32,24 +32,39 @@ npm install -g @vibe-assurance/cli
32
32
  |---------|-------------|
33
33
  | `vibe login` | Authenticate with Vibe Assurance |
34
34
  | `vibe logout` | Clear stored credentials |
35
- | `vibe mcp-server` | Start the MCP server (used by Claude Code) |
36
- | `vibe setup-claude` | Configure Claude Code to use Vibe Assurance |
35
+ | `vibe mcp-server` | Start the MCP server (used by AI coding agents) |
36
+ | `vibe setup-claude` | Configure MCP client to use Vibe Assurance |
37
+ | `vibe --version` | Show CLI version |
37
38
 
38
- ### Available Tools in Claude Code
39
+ ### MCP Tools
39
40
 
40
- Once configured, Claude Code has access to these tools:
41
+ Once configured, your AI coding agent has access to these tools:
42
+
43
+ #### Roles (AI Analyst Prompts)
44
+
45
+ | Tool | Description |
46
+ |------|-------------|
47
+ | `vibe_get_role` | Get an AI analyst role prompt by ID |
48
+ | `vibe_list_roles` | List all available roles |
49
+ | `vibe_update_role` | Update a role's system prompt |
50
+ | `vibe_create_role` | Create a new custom role |
51
+
52
+ #### Context & Templates
41
53
 
42
54
  | Tool | Description |
43
55
  |------|-------------|
44
- | `vibe_get_role` | Get an AI analyst role prompt |
45
- | `vibe_list_roles` | List available roles |
46
- | `vibe_get_context` | Get your governance context (CRs, risks, vulns) |
56
+ | `vibe_get_context` | Get your governance context (CRs, risks, vulns, next CR ID) |
47
57
  | `vibe_get_template` | Get a document template |
48
58
  | `vibe_list_templates` | List available templates |
49
- | `vibe_store_artifact` | Store a created document |
59
+
60
+ #### Artifacts (Governance Documents)
61
+
62
+ | Tool | Description |
63
+ |------|-------------|
64
+ | `vibe_store_artifact` | Store a created document (CR, risk, vulnerability, etc.) |
50
65
  | `vibe_update_artifact` | Update an existing artifact |
51
66
  | `vibe_list_artifacts` | List your stored artifacts |
52
- | `vibe_get_artifact` | Get a specific artifact |
67
+ | `vibe_get_artifact` | Get a specific artifact by ID |
53
68
  | `vibe_delete_artifact` | Delete an artifact |
54
69
 
55
70
  ### Example Session
@@ -57,7 +72,7 @@ Once configured, Claude Code has access to these tools:
57
72
  ```
58
73
  User: Create a change request for adding user authentication
59
74
 
60
- Claude: I'll help you create a change request. Let me get your context first.
75
+ AI Agent: I'll help you create a change request. Let me get your context first.
61
76
 
62
77
  [Calls vibe_get_context]
63
78
  [Calls vibe_get_role("implementation-planner")]
@@ -66,12 +81,7 @@ Claude: I'll help you create a change request. Let me get your context first.
66
81
  Based on your governance context, your next CR ID is CR-2026-001.
67
82
 
68
83
  [Creates the CR documents...]
69
-
70
- Done! Would you like me to store this in Vibe Assurance?
71
-
72
- User: Yes
73
-
74
- Claude: [Calls vibe_store_artifact(...)]
84
+ [Calls vibe_store_artifact(...)]
75
85
 
76
86
  Your CR-2026-001 has been stored! View it at:
77
87
  https://vibeassurance.app/governance/artifacts/CR-2026-001
@@ -103,8 +113,8 @@ If the system keychain is unavailable, credentials fall back to `~/.vibe/credent
103
113
  ## Requirements
104
114
 
105
115
  - **Node.js 18** or later
106
- - **Vibe Assurance account**
107
- - **Claude Code**
116
+ - **Vibe Assurance account** - [Sign up](https://vibeassurance.app)
117
+ - **MCP-compatible AI agent** (e.g., Claude Code, Gemini CLI, or any MCP client)
108
118
 
109
119
  ## Troubleshooting
110
120
 
@@ -115,7 +125,7 @@ Run `vibe login` to authenticate. If you see this error during MCP server startu
115
125
  ### MCP server not connecting
116
126
 
117
127
  1. Run `vibe setup-claude` again
118
- 2. Restart Claude Code completely (not just reload)
128
+ 2. Restart your AI agent completely
119
129
  3. Check that `vibe` command is in your PATH
120
130
 
121
131
  ### "Port 38274 is already in use"
@@ -155,10 +165,7 @@ vibe logout
155
165
  rm -rf ~/.vibe/
156
166
  ```
157
167
 
158
- Then remove the MCP configuration from Claude Code:
159
- 1. Open `~/.claude/mcp.json` (or your platform's config location)
160
- 2. Remove the `vibeassurance` entry from `mcpServers`
161
- 3. Restart Claude Code
168
+ Then remove the MCP configuration from your AI agent's config file.
162
169
 
163
170
  ## Security
164
171
 
@@ -171,8 +178,8 @@ Then remove the MCP configuration from Claude Code:
171
178
 
172
179
  MIT
173
180
 
174
- ## Related
181
+ ## Links
175
182
 
176
- - [Vibe Assurance](https://vibeassurance.app) - Governance platform
177
- - [Claude Code](https://claude.ai/code) - AI coding assistant
178
- - [MCP Protocol](https://modelcontextprotocol.io) - Model Context Protocol
183
+ - [Vibe Assurance](https://vibeassurance.app) - AI Governance Platform
184
+ - [MCP Protocol](https://modelcontextprotocol.io) - Model Context Protocol specification
185
+ - [Documentation](https://agent-platform-prod.azurewebsites.net/docs-cli.html) - CLI setup guide
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-assurance/cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Vibe Assurance CLI - Connect AI coding agents to your governance platform via MCP",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -90,7 +90,10 @@ async function deleteCredentials() {
90
90
  }
91
91
 
92
92
  /**
93
- * Check if credentials exist and are valid (not expired)
93
+ * Check if credentials exist and can be used (valid or refreshable)
94
+ * Returns true if:
95
+ * - Access token exists and is not expired, OR
96
+ * - Access token is expired but refresh token exists (will auto-refresh on API call)
94
97
  * @returns {Promise<boolean>}
95
98
  */
96
99
  async function hasValidCredentials() {
@@ -99,14 +102,19 @@ async function hasValidCredentials() {
99
102
  return false;
100
103
  }
101
104
 
102
- // Check if token is expired (with 5 minute buffer)
105
+ // Check if access token is expired (with 5 minute buffer)
103
106
  if (creds.expiresAt) {
104
107
  const expiresAt = new Date(creds.expiresAt);
105
108
  const now = new Date();
106
109
  const bufferMs = 5 * 60 * 1000; // 5 minutes
107
110
 
108
111
  if (expiresAt.getTime() - bufferMs < now.getTime()) {
109
- return false;
112
+ // Access token expired - check if we have a refresh token
113
+ // If we do, the API client will auto-refresh on first request
114
+ if (creds.refreshToken) {
115
+ return true; // Can refresh, so credentials are usable
116
+ }
117
+ return false; // No refresh token, truly expired
110
118
  }
111
119
  }
112
120
 
package/src/mcp/tools.js CHANGED
@@ -50,6 +50,79 @@ const tools = [
50
50
  }
51
51
  },
52
52
 
53
+ {
54
+ name: 'vibe_update_role',
55
+ description: 'Update an AI analyst role\'s system prompt in Vibe Assurance. Use this to modify role instructions, add new guidance, or fix issues in role prompts.',
56
+ inputSchema: {
57
+ type: 'object',
58
+ properties: {
59
+ roleId: {
60
+ type: 'string',
61
+ description: 'Role ID to update (e.g., "implementation-planner", "security-auditor")'
62
+ },
63
+ systemPrompt: {
64
+ type: 'string',
65
+ description: 'The full updated system prompt content (markdown format). This should be the COMPLETE prompt, not a partial update.'
66
+ },
67
+ name: {
68
+ type: 'string',
69
+ description: 'Optional: Updated role name'
70
+ },
71
+ description: {
72
+ type: 'string',
73
+ description: 'Optional: Updated role description'
74
+ },
75
+ version: {
76
+ type: 'string',
77
+ description: 'Optional: New version number (e.g., "1.1.0")'
78
+ }
79
+ },
80
+ required: ['roleId', 'systemPrompt']
81
+ },
82
+ handler: async ({ roleId, ...updates }) => {
83
+ return await api.put(`/api/mcp/roles/${roleId}`, updates);
84
+ }
85
+ },
86
+
87
+ {
88
+ name: 'vibe_create_role',
89
+ description: 'Create a new AI analyst role in Vibe Assurance. Use this to add custom roles with specific instructions.',
90
+ inputSchema: {
91
+ type: 'object',
92
+ properties: {
93
+ roleId: {
94
+ type: 'string',
95
+ description: 'Unique role ID (lowercase, hyphenated, e.g., "custom-reviewer")'
96
+ },
97
+ name: {
98
+ type: 'string',
99
+ description: 'Display name for the role (e.g., "Custom Code Reviewer")'
100
+ },
101
+ description: {
102
+ type: 'string',
103
+ description: 'Brief description of what this role does'
104
+ },
105
+ systemPrompt: {
106
+ type: 'string',
107
+ description: 'The full system prompt content (markdown format)'
108
+ },
109
+ version: {
110
+ type: 'string',
111
+ description: 'Version number (default: "1.0.0")'
112
+ },
113
+ tier: {
114
+ type: 'string',
115
+ enum: ['free', 'starter', 'pro', 'agency', 'enterprise'],
116
+ description: 'Access tier (default: "free")'
117
+ }
118
+ },
119
+ required: ['roleId', 'name', 'systemPrompt']
120
+ },
121
+ handler: async (params) => {
122
+ return await api.post('/api/mcp/roles', params);
123
+ }
124
+ },
125
+
53
126
  {
54
127
  name: 'vibe_get_context',
55
128
  description: 'Get your current governance context including existing CRs, open risks, vulnerabilities, and the next available CR ID. Use this before creating new CRs to ensure proper ID sequencing.',