fraim-framework 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/setup.js +72 -39
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim-framework",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "FRAIM: Framework for Rigor-based AI Management - Where humans become AI managers through rigorous methodology",
5
5
  "main": "index.js",
6
6
  "bin": {
package/setup.js CHANGED
@@ -167,6 +167,67 @@ Owner: <agent>
167
167
  logSuccess('Project structure created');
168
168
  }
169
169
 
170
+ async function setupGitHubCLI() {
171
+ logStep('GitHub CLI Setup');
172
+ logInfo('To create GitHub labels automatically, you need GitHub CLI installed and authenticated.');
173
+
174
+ // Check if gh is installed
175
+ try {
176
+ execSync('gh --version', { stdio: 'pipe' });
177
+ logSuccess('GitHub CLI is already installed');
178
+ } catch (error) {
179
+ logWarning('GitHub CLI is not installed');
180
+ logInfo('Installing GitHub CLI...');
181
+ logInfo('📥 Download from: https://cli.github.com/');
182
+ logInfo('💻 Or use package manager:');
183
+ logInfo(' Windows: winget install GitHub.cli');
184
+ logInfo(' macOS: brew install gh');
185
+ logInfo(' Ubuntu/Debian: sudo apt install gh');
186
+ logInfo(' CentOS/RHEL: sudo yum install gh');
187
+
188
+ const waitForInstall = await askQuestion('Press Enter after installing GitHub CLI, or type "skip" to continue without it');
189
+ if (waitForInstall === 'skip') {
190
+ return false;
191
+ }
192
+
193
+ // Check again
194
+ try {
195
+ execSync('gh --version', { stdio: 'pipe' });
196
+ logSuccess('GitHub CLI is now available');
197
+ } catch (error) {
198
+ logWarning('GitHub CLI still not available, continuing without it');
199
+ return false;
200
+ }
201
+ }
202
+
203
+ // Check if authenticated
204
+ try {
205
+ execSync('gh auth status', { stdio: 'pipe' });
206
+ logSuccess('GitHub CLI is already authenticated');
207
+ return true;
208
+ } catch (error) {
209
+ logWarning('GitHub CLI is not authenticated');
210
+ logInfo('You need to authenticate with GitHub to create labels automatically.');
211
+ logInfo('🔐 Run: gh auth login');
212
+ logInfo(' This will open a browser for OAuth authentication');
213
+
214
+ const waitForAuth = await askQuestion('Press Enter after authenticating, or type "skip" to continue without authentication');
215
+ if (waitForAuth === 'skip') {
216
+ return false;
217
+ }
218
+
219
+ // Check authentication again
220
+ try {
221
+ execSync('gh auth status', { stdio: 'pipe' });
222
+ logSuccess('GitHub CLI is now authenticated');
223
+ return true;
224
+ } catch (error) {
225
+ logWarning('GitHub CLI authentication failed, continuing without it');
226
+ return false;
227
+ }
228
+ }
229
+ }
230
+
170
231
  function createGitHubLabels() {
171
232
  const labels = [
172
233
  { name: 'phase:design', color: '0e8a16', description: 'Design phase - RFC creation and review' },
@@ -175,7 +236,6 @@ function createGitHubLabels() {
175
236
  { name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
176
237
  { name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
177
238
  { name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
178
- { name: 'status:approved', color: '0e8a16', description: 'Approved and ready to merge' },
179
239
  { name: 'status:changes-requested', color: 'd93f0b', description: 'Changes requested in review' },
180
240
  { name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
181
241
  { name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
@@ -209,7 +269,6 @@ function createLabelsConfigFile() {
209
269
  { name: 'status:wip', color: 'fbca04', description: 'Work in progress' },
210
270
  { name: 'status:needs-review', color: 'd93f0b', description: 'Ready for review' },
211
271
  { name: 'status:complete', color: '0e8a16', description: 'Completed and approved' },
212
- { name: 'status:approved', color: '0e8a16', description: 'Approved and ready to merge' },
213
272
  { name: 'status:changes-requested', color: 'd93f0b', description: 'Changes requested in review' },
214
273
  { name: 'ai-agent:cursor', color: '5319e7', description: 'Assigned to Cursor AI agent' },
215
274
  { name: 'ai-agent:claude', color: 'c2e0c6', description: 'Assigned to Claude AI agent' },
@@ -361,19 +420,6 @@ async function runWizard() {
361
420
  // Check prerequisites
362
421
  logStep('Step 1: Checking Prerequisites');
363
422
 
364
- // Check if gh CLI is available
365
- let ghAvailable = false;
366
- try {
367
- execSync('gh --version', { stdio: 'pipe' });
368
- logSuccess('GitHub CLI (gh) is available');
369
- ghAvailable = true;
370
- } catch (error) {
371
- logWarning('GitHub CLI (gh) is not installed or not available');
372
- logInfo('You can still set up FRAIM, but GitHub labels will need to be created manually');
373
- logInfo('Install GitHub CLI: https://cli.github.com/');
374
- ghAvailable = false;
375
- }
376
-
377
423
  // Check if we're in a git repository
378
424
  try {
379
425
  execSync('git rev-parse --git-dir', { stdio: 'pipe' });
@@ -417,17 +463,18 @@ async function runWizard() {
417
463
 
418
464
  // Step 5: GitHub Labels
419
465
  logStep('Step 5: GitHub Labels');
420
- if (ghAvailable) {
421
- const setupLabels = await askQuestion('Would you like to create GitHub labels for FRAIM?', 'y');
422
-
423
- if (setupLabels === 'y' || setupLabels === 'yes') {
466
+ const setupLabels = await askQuestion('Would you like to create GitHub labels for FRAIM?', 'y');
467
+
468
+ if (setupLabels === 'y' || setupLabels === 'yes') {
469
+ const ghAvailable = await setupGitHubCLI();
470
+ if (ghAvailable) {
424
471
  createGitHubLabels();
425
472
  } else {
426
- logInfo('Skipping GitHub label setup');
473
+ logInfo('GitHub CLI not available - creating labels configuration file instead');
474
+ createLabelsConfigFile();
427
475
  }
428
476
  } else {
429
- logInfo('GitHub CLI not available - creating labels configuration file instead');
430
- createLabelsConfigFile();
477
+ logInfo('Skipping GitHub label setup');
431
478
  }
432
479
 
433
480
  // Step 6: Summary
@@ -436,13 +483,7 @@ async function runWizard() {
436
483
  logSuccess('FRAIM has been successfully set up in your repository!');
437
484
  logInfo('Next steps:');
438
485
  logInfo('1. Commit and push these files to GitHub');
439
-
440
- if (ghAvailable) {
441
- logInfo('2. GitHub labels have been created automatically');
442
- } else {
443
- logInfo('2. Import GitHub labels from .github/labels.json using the web interface');
444
- }
445
-
486
+ logInfo('2. Import GitHub labels from .github/labels.json using the web interface');
446
487
  logInfo('3. Create your first issue with phase labels');
447
488
  logInfo('4. Start coordinating your AI agents!');
448
489
 
@@ -464,14 +505,6 @@ function runSetup() {
464
505
 
465
506
  try {
466
507
  // Check prerequisites
467
- try {
468
- execSync('gh --version', { stdio: 'pipe' });
469
- } catch (error) {
470
- logError('GitHub CLI (gh) is not installed or not available');
471
- logInfo('Please install GitHub CLI: https://cli.github.com/');
472
- process.exit(1);
473
- }
474
-
475
508
  try {
476
509
  execSync('git rev-parse --git-dir', { stdio: 'pipe' });
477
510
  } catch (error) {
@@ -485,13 +518,13 @@ function runSetup() {
485
518
  ensureDirectory('.github/workflows');
486
519
  createAgentFolders();
487
520
  createGitHubWorkflows();
488
- createGitHubLabels();
521
+ createLabelsConfigFile();
489
522
 
490
523
  logHeader('🎉 Setup Complete!');
491
524
  logSuccess('FRAIM has been successfully set up in your repository!');
492
525
  logInfo('Next steps:');
493
526
  logInfo('1. Commit and push these files to GitHub');
494
- logInfo('2. The GitHub labels have been created automatically');
527
+ logInfo('2. Import GitHub labels from .github/labels.json using the web interface');
495
528
  logInfo('3. Create your first issue with phase labels');
496
529
  logInfo('4. Start coordinating your AI agents!');
497
530