@fyow/copilot-everything 1.0.8 → 1.0.9

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": "@fyow/copilot-everything",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Everything you need for GitHub Copilot CLI - agents, skills, instructions, and hooks configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -41,6 +41,7 @@ Options:
41
41
  --ai <type> Target AI platform: copilot (default), claude, or all
42
42
  --force Overwrite existing files (except MCP config)
43
43
  --force-mcp Force overwrite MCP config (~/.copilot/mcp-config.json)
44
+ -y, --yes Skip confirmation prompts for force operations
44
45
  --skip-agents Skip agent installation
45
46
  --skip-skills Skip skills installation
46
47
  --skip-hooks Skip hooks installation
@@ -50,9 +51,10 @@ Options:
50
51
  Examples:
51
52
  copilot-everything init
52
53
  copilot-everything init --force-mcp
54
+ copilot-everything init --force-mcp -y
53
55
  copilot-everything init --ai copilot
54
56
  copilot-everything init --ai claude
55
- copilot-everything init --ai all --force
57
+ copilot-everything init --ai all --force -y
56
58
 
57
59
  Learn more: https://github.com/fyow/copilot-everything
58
60
  `;
@@ -72,7 +74,10 @@ if (flags.h || flags.help || !command) {
72
74
  // Execute command
73
75
  switch (command) {
74
76
  case 'init':
75
- init(flags);
77
+ init(flags).catch(err => {
78
+ console.error('Error:', err.message);
79
+ process.exit(1);
80
+ });
76
81
  break;
77
82
  default:
78
83
  console.error(`Unknown command: ${command}`);
@@ -82,10 +82,28 @@ function copyFile(src, dest, options = {}) {
82
82
  }
83
83
  }
84
84
 
85
+ const readline = require('readline');
86
+
87
+ /**
88
+ * Prompt user for confirmation
89
+ */
90
+ function confirm(message) {
91
+ return new Promise((resolve) => {
92
+ const rl = readline.createInterface({
93
+ input: process.stdin,
94
+ output: process.stdout
95
+ });
96
+ rl.question(`${message} (y/N): `, (answer) => {
97
+ rl.close();
98
+ resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
99
+ });
100
+ });
101
+ }
102
+
85
103
  /**
86
104
  * Main init function
87
105
  */
88
- function init(flags = {}) {
106
+ async function init(flags = {}) {
89
107
  const targetDir = process.cwd();
90
108
  const aiType = flags.ai || 'copilot';
91
109
  const force = flags.force || false;
@@ -93,6 +111,7 @@ function init(flags = {}) {
93
111
  const skipAgents = flags['skip-agents'] || false;
94
112
  const skipSkills = flags['skip-skills'] || false;
95
113
  const skipHooks = flags['skip-hooks'] || false;
114
+ const yes = flags.yes || flags.y || false;
96
115
 
97
116
  console.log('');
98
117
  console.log('🚀 copilot-everything init');
@@ -103,6 +122,30 @@ function init(flags = {}) {
103
122
  console.log(`⚡ Force MCP overwrite: ${forceMcp ? 'yes' : 'no'}`);
104
123
  console.log('');
105
124
 
125
+ // Confirm if using force flags
126
+ if ((force || forceMcp) && !yes) {
127
+ const warnings = [];
128
+ if (force) {
129
+ warnings.push(' ⚠️ --force will overwrite existing agent, skill, and instruction files');
130
+ }
131
+ if (forceMcp) {
132
+ warnings.push(' ⚠️ --force-mcp will overwrite ~/.copilot/mcp-config.json (your API keys!)');
133
+ }
134
+
135
+ console.log('⚠️ Warning:');
136
+ warnings.forEach(w => console.log(w));
137
+ console.log('');
138
+
139
+ const confirmed = await confirm('Do you want to continue?');
140
+ if (!confirmed) {
141
+ console.log('');
142
+ console.log('❌ Operation cancelled.');
143
+ console.log('');
144
+ return;
145
+ }
146
+ console.log('');
147
+ }
148
+
106
149
  const options = { force };
107
150
  let totalCopied = 0;
108
151
  let totalSkipped = 0;