cursor-devops-commands 1.0.0

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 ADDED
@@ -0,0 +1,165 @@
1
+ # 🔧 Cursor DevOps Commands
2
+
3
+ > DevOps & Git Commands for Cursor IDE - Security, Deployment, Git Operations
4
+
5
+ [![npm version](https://badge.fury.io/js/cursor-devops-commands.svg)](https://www.npmjs.com/package/cursor-devops-commands)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## 🚀 Quick Install
9
+
10
+ ```bash
11
+ npx cursor-devops-commands
12
+ ```
13
+
14
+ One command installs 10 DevOps commands for Cursor.
15
+
16
+ ## What is DevOps Commands?
17
+
18
+ DevOps Commands provides:
19
+
20
+ - **Git Operations** - Auto-rebase, smart reviewer suggestions
21
+ - **Security Audits** - Pre-PR security scanning
22
+ - **Deployment Verification** - Post-deploy health checks
23
+
24
+ ## 📦 Command Bundles
25
+
26
+ | Bundle | Commands | Use Case |
27
+ |--------|----------|----------|
28
+ | **Minimal** | 4 | Git only |
29
+ | **Standard** | 7 | + Security |
30
+ | **Complete** | 10 | + Deployment |
31
+
32
+ ## 🔧 Commands Reference
33
+
34
+ ### 🔀 Git Operations
35
+
36
+ | Command | Description |
37
+ |---------|-------------|
38
+ | `/auto-rebase` | Rebase branch with conflict resolution help |
39
+ | `/suggest-reviewers` | Smart reviewer suggestions based on CODEOWNERS |
40
+ | `/find-shared` | Find shared code dependencies |
41
+ | `/decision-record` | Create architecture decision records |
42
+
43
+ ### 🔒 Security
44
+
45
+ | Command | Description |
46
+ |---------|-------------|
47
+ | `/security-audit` | Scan for secrets, vulnerabilities, supply chain risks |
48
+ | `/rollback-impact` | Assess rollback risk and dependencies |
49
+
50
+ ### 🚀 Deployment
51
+
52
+ | Command | Description |
53
+ |---------|-------------|
54
+ | `/post-deploy-check` | Verify feature health after deployment |
55
+ | `/metrics-report` | Generate metrics dashboard |
56
+
57
+ ## 💡 Example Usage
58
+
59
+ ### Auto-Rebase with Conflict Help
60
+
61
+ ```
62
+ /auto-rebase
63
+
64
+ ════════════════════════════════════════════════════════════════
65
+ ⚠️ BRANCH BEHIND MASTER
66
+ ════════════════════════════════════════════════════════════════
67
+
68
+ Your branch: feature/new-checkout
69
+ Behind master by: 12 commits
70
+
71
+ Potential conflicts detected in:
72
+ ❌ src/features/checkout/PackagesV2.tsx
73
+ ✅ src/components/ProtectionPackageCard.tsx (clean)
74
+
75
+ Options:
76
+ 1. Auto-rebase (attempt automatic merge)
77
+ 2. Manual rebase (I'll guide you)
78
+ 3. Skip
79
+
80
+ Choose: (1/2/3)
81
+ ```
82
+
83
+ ### Security Audit
84
+
85
+ ```
86
+ /security-audit
87
+
88
+ ════════════════════════════════════════════════════════════════
89
+ SECURITY SCAN RESULTS
90
+ ════════════════════════════════════════════════════════════════
91
+
92
+ | Severity | Count | Status |
93
+ |----------|-------|--------|
94
+ | 🔴 Critical | 0 | ✅ Pass |
95
+ | 🟠 High | 2 | ⚠️ Review |
96
+ | 🟡 Medium | 5 | 📝 Note |
97
+
98
+ 🟠 HIGH FINDINGS
99
+
100
+ 1. Potential XSS via dangerouslySetInnerHTML
101
+ File: src/components/RichText.tsx:45
102
+ Mitigation: Use DOMPurify.sanitize()
103
+ ```
104
+
105
+ ### Smart Reviewer Suggestions
106
+
107
+ ```
108
+ /suggest-reviewers
109
+
110
+ ════════════════════════════════════════════════════════════════
111
+ RECOMMENDED REVIEWERS
112
+ ════════════════════════════════════════════════════════════════
113
+
114
+ 🥇 PRIMARY (CODEOWNER)
115
+ ┌─────────────────────────────────────────────────────────────┐
116
+ │ @team-lead │
117
+ │ Owns: src/features/checkout/* (4 files) │
118
+ │ Expertise: 45 commits in affected files │
119
+ │ Workload: 2 pending reviews (✅ Available) │
120
+ └─────────────────────────────────────────────────────────────┘
121
+
122
+ Add recommended reviewers? (y/n)
123
+ ```
124
+
125
+ ## 🛠️ CLI Commands
126
+
127
+ ```bash
128
+ npx cursor-devops-commands # Interactive install
129
+ npx cursor-devops-commands --bundle complete -y # Non-interactive
130
+ npx cursor-devops-commands status # Check installation
131
+ npx cursor-devops-commands list # List all commands
132
+ npx cursor-devops-commands help # Show help
133
+ ```
134
+
135
+ ## 📂 Installation Structure
136
+
137
+ After installation:
138
+
139
+ ```
140
+ .cursor/
141
+ └── commands/
142
+ ├── auto-rebase.md
143
+ ├── suggest-reviewers.md
144
+ ├── find-shared.md
145
+ ├── decision-record.md
146
+ ├── security-audit.md
147
+ ├── rollback-impact.md
148
+ ├── post-deploy-check.md
149
+ └── metrics-report.md
150
+ ```
151
+
152
+ ## 🤝 Works With
153
+
154
+ - [Buddy OS](https://github.com/sharath317/buddy-os) - Role-aware autonomous agent
155
+ - [Cursor Full-Flow](https://github.com/sharath317/cursor-full-flow) - Jira to PR automation
156
+ - [Cursor Quality Suite](https://github.com/sharath317/cursor-quality-suite) - Testing & quality
157
+
158
+ ## 📄 License
159
+
160
+ MIT © Sharath Chandra
161
+
162
+ ---
163
+
164
+ **Secure, smart DevOps right in your editor.**
165
+
package/bin/cli.js ADDED
@@ -0,0 +1,312 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * cursor-devops-commands CLI
5
+ * DevOps & Git Commands for Cursor IDE
6
+ * Security, Deployment, Git Operations
7
+ */
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const readline = require('readline');
12
+
13
+ const VERSION = '1.0.0';
14
+ const CURSOR_DIR = '.cursor';
15
+ const COMMANDS_DIR = 'commands';
16
+
17
+ const colors = {
18
+ reset: '\x1b[0m',
19
+ bold: '\x1b[1m',
20
+ dim: '\x1b[2m',
21
+ red: '\x1b[31m',
22
+ green: '\x1b[32m',
23
+ yellow: '\x1b[33m',
24
+ blue: '\x1b[34m',
25
+ magenta: '\x1b[35m',
26
+ cyan: '\x1b[36m',
27
+ };
28
+
29
+ const log = {
30
+ info: (msg) => console.log(`${colors.cyan}ℹ${colors.reset} ${msg}`),
31
+ success: (msg) => console.log(`${colors.green}✓${colors.reset} ${msg}`),
32
+ warn: (msg) => console.log(`${colors.yellow}⚠${colors.reset} ${msg}`),
33
+ error: (msg) => console.log(`${colors.red}✗${colors.reset} ${msg}`),
34
+ step: (msg) => console.log(` ${colors.dim}→${colors.reset} ${msg}`),
35
+ header: (msg) => console.log(`\n${colors.bold}${colors.cyan}${msg}${colors.reset}\n`),
36
+ };
37
+
38
+ const BUNDLES = {
39
+ minimal: {
40
+ name: 'Minimal (Git Only)',
41
+ description: 'Essential git and repo management',
42
+ commands: ['git'],
43
+ count: 4,
44
+ },
45
+ standard: {
46
+ name: 'Standard (Git + Security)',
47
+ description: 'Git operations with security audits',
48
+ commands: ['git', 'security'],
49
+ count: 7,
50
+ },
51
+ complete: {
52
+ name: 'Complete (All DevOps)',
53
+ description: 'Full DevOps suite including deployment',
54
+ commands: ['git', 'security', 'deployment'],
55
+ count: 10,
56
+ },
57
+ };
58
+
59
+ function prompt(question, defaultValue = '') {
60
+ const rl = readline.createInterface({
61
+ input: process.stdin,
62
+ output: process.stdout,
63
+ });
64
+
65
+ const defaultText = defaultValue ? ` (${defaultValue})` : '';
66
+
67
+ return new Promise((resolve) => {
68
+ rl.question(`${question}${defaultText}: `, (answer) => {
69
+ rl.close();
70
+ resolve(answer || defaultValue);
71
+ });
72
+ });
73
+ }
74
+
75
+ function ensureDir(dir) {
76
+ if (!fs.existsSync(dir)) {
77
+ fs.mkdirSync(dir, { recursive: true });
78
+ }
79
+ }
80
+
81
+ function copyCommands(sourceDir, targetDir, categories) {
82
+ let copiedCount = 0;
83
+
84
+ categories.forEach((category) => {
85
+ const srcCategoryDir = path.join(sourceDir, category);
86
+
87
+ if (fs.existsSync(srcCategoryDir)) {
88
+ const files = fs.readdirSync(srcCategoryDir).filter((f) => f.endsWith('.md'));
89
+
90
+ files.forEach((file) => {
91
+ const srcFile = path.join(srcCategoryDir, file);
92
+ const tgtFile = path.join(targetDir, file);
93
+
94
+ if (!fs.existsSync(tgtFile)) {
95
+ fs.copyFileSync(srcFile, tgtFile);
96
+ log.step(`Installed: ${file}`);
97
+ copiedCount++;
98
+ } else {
99
+ log.step(`Exists: ${file} (skipped)`);
100
+ }
101
+ });
102
+ }
103
+ });
104
+
105
+ return copiedCount;
106
+ }
107
+
108
+ async function init(flags = {}) {
109
+ console.log(`
110
+ ${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
111
+ 🔧 CURSOR DEVOPS COMMANDS v${VERSION}
112
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
113
+ DevOps: Git Operations, Security & Deployment
114
+
115
+ `);
116
+
117
+ const projectDir = process.cwd();
118
+ const cursorDir = path.join(projectDir, CURSOR_DIR);
119
+ const commandsDir = path.join(cursorDir, COMMANDS_DIR);
120
+
121
+ log.header('📦 Select Command Bundle');
122
+
123
+ Object.entries(BUNDLES).forEach(([key, bundle], idx) => {
124
+ console.log(` ${idx + 1}. ${colors.bold}${bundle.name}${colors.reset}`);
125
+ console.log(` ${bundle.description} (${bundle.count} commands)\n`);
126
+ });
127
+
128
+ let selectedBundle = 'complete';
129
+ if (!flags.bundle && !flags.yes) {
130
+ const bundleAnswer = await prompt('Select bundle (1-3)', '3');
131
+ selectedBundle = Object.keys(BUNDLES)[parseInt(bundleAnswer, 10) - 1] || 'complete';
132
+ } else if (flags.bundle) {
133
+ selectedBundle = flags.bundle;
134
+ }
135
+
136
+ const bundle = BUNDLES[selectedBundle];
137
+ log.success(`Selected: ${bundle.name}`);
138
+
139
+ log.header('📥 Installing Commands');
140
+
141
+ ensureDir(commandsDir);
142
+
143
+ const packageDir = path.dirname(__dirname);
144
+ const packageCommandsDir = path.join(packageDir, 'commands');
145
+
146
+ const copiedCount = copyCommands(packageCommandsDir, commandsDir, bundle.commands);
147
+
148
+ console.log(`
149
+ ${colors.bold}${colors.green}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
150
+ ✓ INSTALLATION COMPLETE
151
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
152
+
153
+ ${colors.cyan}Commands installed:${colors.reset} ${copiedCount}
154
+ ${colors.cyan}Location:${colors.reset} ${commandsDir}
155
+
156
+ ${colors.bold}Commands Reference:${colors.reset}
157
+
158
+ ${colors.cyan}🔀 Git${colors.reset}
159
+ /auto-rebase Rebase feature branch with conflict resolution
160
+ /suggest-reviewers Smart reviewer suggestions
161
+ /find-shared Find shared code dependencies
162
+ /decision-record Create architecture decision records
163
+
164
+ ${colors.cyan}🔒 Security${colors.reset}
165
+ /security-audit Run security analysis
166
+ /rollback-impact Assess rollback risk
167
+
168
+ ${colors.cyan}🚀 Deployment${colors.reset}
169
+ /post-deploy-check Post-deployment verification
170
+ /metrics-report Generate metrics dashboard
171
+
172
+ ${colors.dim}Documentation: https://github.com/sharath317/cursor-devops-commands${colors.reset}
173
+ `);
174
+ }
175
+
176
+ async function status() {
177
+ const projectDir = process.cwd();
178
+ const commandsDir = path.join(projectDir, CURSOR_DIR, COMMANDS_DIR);
179
+
180
+ if (!fs.existsSync(commandsDir)) {
181
+ log.warn('DevOps Commands not installed. Run: npx cursor-devops-commands');
182
+ process.exit(0);
183
+ }
184
+
185
+ const commands = fs.readdirSync(commandsDir).filter((f) => f.endsWith('.md'));
186
+
187
+ console.log(`
188
+ ${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
189
+ 📊 DEVOPS COMMANDS STATUS
190
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
191
+
192
+ ${colors.cyan}Version:${colors.reset} ${VERSION}
193
+ ${colors.cyan}Commands:${colors.reset} ${commands.length} installed
194
+ ${colors.cyan}Location:${colors.reset} ${commandsDir}
195
+
196
+ ${colors.bold}Installed Commands:${colors.reset}`);
197
+
198
+ commands.forEach((cmd) => {
199
+ console.log(` - /${cmd.replace('.md', '')}`);
200
+ });
201
+
202
+ console.log('');
203
+ }
204
+
205
+ async function listCommands() {
206
+ const packageDir = path.dirname(__dirname);
207
+ const packageCommandsDir = path.join(packageDir, 'commands');
208
+
209
+ console.log(`
210
+ ${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
211
+ 📋 AVAILABLE COMMANDS
212
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
213
+ `);
214
+
215
+ const categories = ['git', 'security', 'deployment'];
216
+ const icons = { git: '🔀', security: '🔒', deployment: '🚀' };
217
+
218
+ categories.forEach((cat) => {
219
+ const catDir = path.join(packageCommandsDir, cat);
220
+ if (fs.existsSync(catDir)) {
221
+ console.log(`\n${icons[cat]} ${colors.bold}${cat.toUpperCase()}${colors.reset}`);
222
+
223
+ const files = fs.readdirSync(catDir).filter((f) => f.endsWith('.md'));
224
+ files.forEach((file) => {
225
+ const name = file.replace('.md', '');
226
+ console.log(` /${name}`);
227
+ });
228
+ }
229
+ });
230
+
231
+ console.log('');
232
+ }
233
+
234
+ function showHelp() {
235
+ console.log(`
236
+ ${colors.bold}cursor-devops-commands v${VERSION}${colors.reset}
237
+
238
+ DevOps & Git Commands for Cursor IDE
239
+
240
+ ${colors.bold}Usage:${colors.reset}
241
+ npx cursor-devops-commands [command] [options]
242
+
243
+ ${colors.bold}Commands:${colors.reset}
244
+ init Install commands (default)
245
+ status Show current configuration
246
+ list List all available commands
247
+ help Show this help
248
+
249
+ ${colors.bold}Options:${colors.reset}
250
+ --bundle Select bundle (minimal, standard, complete)
251
+ -y, --yes Non-interactive mode
252
+
253
+ ${colors.bold}Examples:${colors.reset}
254
+ npx cursor-devops-commands Interactive install
255
+ npx cursor-devops-commands --bundle complete Install all commands
256
+ npx cursor-devops-commands status Check installation
257
+
258
+ ${colors.bold}After Installation:${colors.reset}
259
+ /auto-rebase Rebase with conflict help
260
+ /security-audit Run security checks
261
+ /post-deploy-check Verify deployment
262
+ /suggest-reviewers Get reviewer suggestions
263
+
264
+ ${colors.dim}https://github.com/sharath317/cursor-devops-commands${colors.reset}
265
+ `);
266
+ }
267
+
268
+ const args = process.argv.slice(2);
269
+ const flags = {};
270
+ let command = null;
271
+ const skipNextArg = new Set();
272
+
273
+ args.forEach((arg, idx) => {
274
+ if (arg === '--bundle' && args[idx + 1]) {
275
+ skipNextArg.add(idx + 1);
276
+ }
277
+ });
278
+
279
+ args.forEach((arg, idx) => {
280
+ if (skipNextArg.has(idx)) {
281
+ return;
282
+ } else if (arg === '-y' || arg === '--yes') {
283
+ flags.yes = true;
284
+ } else if (arg === '--bundle' && args[idx + 1]) {
285
+ flags.bundle = args[idx + 1];
286
+ } else if (!arg.startsWith('-') && command === null) {
287
+ command = arg;
288
+ }
289
+ });
290
+
291
+ switch (command) {
292
+ case 'init':
293
+ case null:
294
+ init(flags);
295
+ break;
296
+ case 'status':
297
+ status();
298
+ break;
299
+ case 'list':
300
+ listCommands();
301
+ break;
302
+ case 'help':
303
+ case '-h':
304
+ case '--help':
305
+ showHelp();
306
+ break;
307
+ default:
308
+ log.error(`Unknown command: ${command}`);
309
+ console.log('Run "npx cursor-devops-commands help" for usage');
310
+ process.exit(1);
311
+ }
312
+