|
7 | 7 | } from '../server/transport.js'; |
8 | 8 | import { ClaudeConfigManager } from '../platform/claude/config.js'; |
9 | 9 | import { VSCodeConfigManager } from '../platform/vscode/config.js'; |
| 10 | +import { CursorConfigManager } from '../platform/cursor/config.js'; |
10 | 11 |
|
11 | 12 | export const cmd = () => { |
12 | 13 | const exe = yargs(hideBin(process.argv)); |
@@ -129,6 +130,69 @@ export const cmd = () => { |
129 | 130 | ); |
130 | 131 | }); |
131 | 132 |
|
| 133 | + exe.command('cursor', 'Manage Cursor integration', (yargs) => { |
| 134 | + return yargs |
| 135 | + .command( |
| 136 | + 'enable', |
| 137 | + 'Enable ArgoCD MCP server in Cursor', |
| 138 | + (yargs) => { |
| 139 | + return yargs |
| 140 | + .option('workspace', { |
| 141 | + type: 'boolean', |
| 142 | + description: 'Install in current workspace directory' |
| 143 | + }) |
| 144 | + .option('url', { |
| 145 | + type: 'string', |
| 146 | + description: 'ArgoCD base URL (falls back to ARGOCD_BASE_URL env var)' |
| 147 | + }) |
| 148 | + .option('token', { |
| 149 | + type: 'string', |
| 150 | + description: 'ArgoCD API token (falls back to ARGOCD_API_TOKEN env var)' |
| 151 | + }); |
| 152 | + }, |
| 153 | + async ({ workspace, url, token }) => { |
| 154 | + const manager = new CursorConfigManager(workspace); |
| 155 | + try { |
| 156 | + console.log(`Configuration file: ${manager.getConfigPath()}`); |
| 157 | + const wasEnabled = await manager.enable(validateUrl(url), validateToken(token)); |
| 158 | + if (wasEnabled) { |
| 159 | + console.log('✓ ArgoCD MCP server configuration updated in Cursor'); |
| 160 | + } else { |
| 161 | + console.log('✓ ArgoCD MCP server enabled in Cursor'); |
| 162 | + } |
| 163 | + } catch (error) { |
| 164 | + console.error('Failed to enable ArgoCD MCP server:', (error as Error).message); |
| 165 | + process.exit(1); |
| 166 | + } |
| 167 | + } |
| 168 | + ) |
| 169 | + .command( |
| 170 | + 'disable', |
| 171 | + 'Disable ArgoCD MCP server in Cursor', |
| 172 | + (yargs) => { |
| 173 | + return yargs.option('workspace', { |
| 174 | + type: 'boolean', |
| 175 | + description: 'Install in current workspace directory' |
| 176 | + }); |
| 177 | + }, |
| 178 | + async ({ workspace }) => { |
| 179 | + const manager = new CursorConfigManager(workspace); |
| 180 | + try { |
| 181 | + console.log(`Configuration file: ${manager.getConfigPath()}`); |
| 182 | + const wasEnabled = await manager.disable(); |
| 183 | + if (wasEnabled) { |
| 184 | + console.log('✓ ArgoCD MCP server disabled in Cursor'); |
| 185 | + } else { |
| 186 | + console.log('ArgoCD MCP server was not enabled'); |
| 187 | + } |
| 188 | + } catch (error) { |
| 189 | + console.error('Failed to disable ArgoCD MCP server:', (error as Error).message); |
| 190 | + process.exit(1); |
| 191 | + } |
| 192 | + } |
| 193 | + ); |
| 194 | + }); |
| 195 | + |
132 | 196 | exe.command('vscode', 'Manage VS Code integration', (yargs) => { |
133 | 197 | return yargs |
134 | 198 | .command( |
|
0 commit comments