oneie 1.2.0 → 1.2.2

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.
@@ -0,0 +1,776 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * ONE Personal Installer
5
+ * Creates personalized collaborative intelligence space based on me.md
6
+ */
7
+
8
+ import fs from 'fs-extra';
9
+ import path from 'path';
10
+ import chalk from 'chalk';
11
+ import inquirer from 'inquirer';
12
+ import { MissionSystem } from './mission-system.js';
13
+ import { StorySystem } from './story-system.js';
14
+ import { TaskSystem } from './task-system.js';
15
+ import { AgentInstaller } from '../one/tools/agent-installer.js';
16
+
17
+ export class OneInstaller {
18
+ constructor(projectPath = process.cwd()) {
19
+ this.projectPath = projectPath;
20
+ this.oneDir = path.join(projectPath, '.one');
21
+ this.meFile = path.join(projectPath, 'me.md');
22
+ this.scaffoldDir = path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'scaffold');
23
+
24
+ // Initialize agent installer for Claude Code integration
25
+ this.agentInstaller = new AgentInstaller({
26
+ sourceAgentsPath: path.join(path.dirname(new URL(import.meta.url).pathname), '..', 'one', 'agents'),
27
+ targetAgentsPath: path.join(projectPath, '.claude', 'agents'),
28
+ commandsPath: path.join(projectPath, '.claude', 'commands')
29
+ });
30
+ }
31
+
32
+ async install(options = {}) {
33
+ console.log(chalk.cyan.bold('\\nšŸš€ ONE - Personal Collaborative Intelligence\\n'));
34
+
35
+ // Check if already installed (unless it's a marketing upgrade)
36
+ if (await this.isInstalled() && !options.includeMarketing) {
37
+ console.log(chalk.yellow('⚔ ONE is already installed here!'));
38
+ console.log(chalk.gray('Use: npx oneie generate # Generate content from your me.md'));
39
+ console.log(chalk.gray('Use: npx oneie update-me # Edit your me.md profile'));
40
+ return;
41
+ }
42
+
43
+ // Special handling for marketing upgrade
44
+ if (options.includeMarketing && await this.isInstalled()) {
45
+ console.log(chalk.blue('šŸŽÆ Adding marketing team agents to existing installation...'));
46
+ await this.installClaudeCodeAgents(options);
47
+ console.log(chalk.green('\\nāœ… Marketing agents installation complete!'));
48
+ console.log(chalk.cyan('\\nšŸš€ Try your new marketing agents:'));
49
+ console.log(' one:marketing-director "Create a marketing strategy"');
50
+ console.log(' one:marketing-viral-growth "Design viral content campaign"');
51
+ return;
52
+ }
53
+
54
+ try {
55
+ // Step 1: Welcome and explanation
56
+ await this.showWelcome();
57
+
58
+ // Step 2: Create me.md through guided questions
59
+ const profile = await this.createPersonalProfile(options);
60
+
61
+ // Step 3: Create .one directory structure
62
+ await this.createOneStructure();
63
+
64
+ // Step 4: Generate personalized content based on me.md
65
+ await this.generatePersonalizedContent(profile);
66
+
67
+ // Step 5: Install Claude Code agent system
68
+ await this.installClaudeCodeAgents(options);
69
+
70
+ // Step 6: Show next steps
71
+ await this.showCompletion();
72
+
73
+ } catch (error) {
74
+ console.error(chalk.red('āŒ Installation failed:'), error.message);
75
+ process.exit(1);
76
+ }
77
+ }
78
+
79
+ async isInstalled() {
80
+ return await fs.pathExists(this.oneDir) && await fs.pathExists(this.meFile);
81
+ }
82
+
83
+ async showWelcome() {
84
+ console.log(chalk.blue('šŸ‘‹ Welcome to ONE!'));
85
+ console.log('');
86
+ console.log('ONE creates a personalized collaborative workspace just for you.');
87
+ console.log('It reads your personal profile and generates:');
88
+ console.log(chalk.cyan(' • AI agents tailored to your role and expertise'));
89
+ console.log(chalk.cyan(' • Workflows that match your working style'));
90
+ console.log(chalk.cyan(' • Templates for your industry and projects'));
91
+ console.log(chalk.cyan(' • Mission/Story structure for your goals'));
92
+ console.log('');
93
+ console.log('Let\'s create your personal profile...');
94
+ console.log('');
95
+ }
96
+
97
+ async createPersonalProfile(options = {}) {
98
+ console.log(chalk.blue('šŸ“ Creating Your Personal Profile'));
99
+ console.log('');
100
+
101
+ // Auto mode with default values
102
+ if (options.auto) {
103
+ const defaultProfile = {
104
+ name: 'Developer',
105
+ role: 'Software Developer',
106
+ experience: '3',
107
+ skills: ['JavaScript/TypeScript', 'React/Vue/Angular', 'Node.js'],
108
+ currentProject: 'Building a web application',
109
+ challenges: 'Learning new technologies and scaling the project',
110
+ company: 'Personal project',
111
+ companySize: 'Solo/Personal',
112
+ industry: 'Technology',
113
+ learningStyle: 'Hands-on examples and tutorials',
114
+ workStyle: 'Fast iteration and MVP approach'
115
+ };
116
+
117
+ const meContent = this.generateMeMarkdown(defaultProfile);
118
+ await fs.writeFile(this.meFile, meContent);
119
+
120
+ console.log(chalk.green('\\nāœ… Created default personal profile: me.md'));
121
+ console.log(chalk.gray('Edit me.md to customize your profile, then run: npx oneie generate'));
122
+
123
+ return defaultProfile;
124
+ }
125
+
126
+ const questions = [
127
+ {
128
+ type: 'input',
129
+ name: 'name',
130
+ message: 'What\'s your name?',
131
+ validate: input => input.length > 0 || 'Please enter your name'
132
+ },
133
+ {
134
+ type: 'input',
135
+ name: 'role',
136
+ message: 'What\'s your role/job title?',
137
+ default: 'Developer'
138
+ },
139
+ {
140
+ type: 'input',
141
+ name: 'experience',
142
+ message: 'How many years of experience do you have?',
143
+ default: '3'
144
+ },
145
+ {
146
+ type: 'checkbox',
147
+ name: 'skills',
148
+ message: 'What are your main skills/technologies?',
149
+ choices: [
150
+ 'JavaScript/TypeScript',
151
+ 'React/Vue/Angular',
152
+ 'Node.js',
153
+ 'Python',
154
+ 'Java',
155
+ 'C#/.NET',
156
+ 'Go',
157
+ 'Rust',
158
+ 'AWS/Cloud',
159
+ 'Docker/Kubernetes',
160
+ 'Databases',
161
+ 'Mobile Development',
162
+ 'Machine Learning',
163
+ 'DevOps',
164
+ 'Design/UX',
165
+ 'Project Management',
166
+ 'Other'
167
+ ]
168
+ },
169
+ {
170
+ type: 'input',
171
+ name: 'currentProject',
172
+ message: 'What are you currently working on?',
173
+ default: 'Building a web application'
174
+ },
175
+ {
176
+ type: 'input',
177
+ name: 'challenges',
178
+ message: 'What are your main challenges right now?',
179
+ default: 'Learning new technologies and scaling the project'
180
+ },
181
+ {
182
+ type: 'input',
183
+ name: 'company',
184
+ message: 'What company/organization do you work for?',
185
+ default: 'Personal project'
186
+ },
187
+ {
188
+ type: 'list',
189
+ name: 'companySize',
190
+ message: 'What\'s your company size?',
191
+ choices: [
192
+ 'Solo/Personal',
193
+ 'Startup (2-10 people)',
194
+ 'Small company (11-50)',
195
+ 'Medium company (51-200)',
196
+ 'Large company (201-1000)',
197
+ 'Enterprise (1000+)'
198
+ ]
199
+ },
200
+ {
201
+ type: 'input',
202
+ name: 'industry',
203
+ message: 'What industry/domain do you work in?',
204
+ default: 'Technology'
205
+ },
206
+ {
207
+ type: 'list',
208
+ name: 'learningStyle',
209
+ message: 'How do you prefer to learn?',
210
+ choices: [
211
+ 'Hands-on examples and tutorials',
212
+ 'Documentation and written guides',
213
+ 'Video content and demonstrations',
214
+ 'Interactive coding and experimentation',
215
+ 'Discussion and collaboration'
216
+ ]
217
+ },
218
+ {
219
+ type: 'list',
220
+ name: 'workStyle',
221
+ message: 'What\'s your preferred working style?',
222
+ choices: [
223
+ 'Fast iteration and MVP approach',
224
+ 'Careful planning and documentation',
225
+ 'Test-driven development',
226
+ 'Agile/Scrum methodology',
227
+ 'Flexible and adaptive'
228
+ ]
229
+ }
230
+ ];
231
+
232
+ const answers = await inquirer.prompt(questions);
233
+
234
+ // Create me.md content
235
+ const meContent = this.generateMeMarkdown(answers);
236
+ await fs.writeFile(this.meFile, meContent);
237
+
238
+ console.log(chalk.green('\\nāœ… Created your personal profile: me.md'));
239
+
240
+ return answers;
241
+ }
242
+
243
+ generateMeMarkdown(profile) {
244
+ return `# Me - ${profile.name}
245
+
246
+ ## Personal Info
247
+ ${profile.role} with ${profile.experience} years of experience
248
+ Industry: ${profile.industry}
249
+ Company: ${profile.company} (${profile.companySize})
250
+
251
+ ### Skills & Technologies
252
+ ${profile.skills.map(skill => `- ${skill}`).join('\\n')}
253
+
254
+ ### Learning & Work Style
255
+ - Learning preference: ${profile.learningStyle}
256
+ - Work approach: ${profile.workStyle}
257
+
258
+ ## Current Work
259
+ **Project:** ${profile.currentProject}
260
+
261
+ **Main Challenges:**
262
+ ${profile.challenges}
263
+
264
+ ## Goals
265
+ - Complete current project successfully
266
+ - Learn and grow technical skills
267
+ - Build effective workflows and processes
268
+
269
+ ## Company Context
270
+ Working at ${profile.company} (${profile.companySize})
271
+ ${profile.industry} industry focus
272
+
273
+ ---
274
+
275
+ *This profile helps ONE create personalized agents, workflows, and templates just for you.*
276
+ *Edit this file anytime to update your ONE workspace.*
277
+ `;
278
+ }
279
+
280
+ async createOneStructure() {
281
+ console.log(chalk.blue('\\nšŸ—ļø Creating .one workspace structure...'));
282
+
283
+ // Create directory structure
284
+ const dirs = [
285
+ '.one',
286
+ '.one/agents',
287
+ '.one/missions',
288
+ '.one/stories',
289
+ '.one/tasks',
290
+ '.one/workflows',
291
+ '.one/templates',
292
+ '.one/knowledge',
293
+ '.one/spaces'
294
+ ];
295
+
296
+ for (const dir of dirs) {
297
+ await fs.ensureDir(path.join(this.projectPath, dir));
298
+ }
299
+
300
+ // Copy scaffold files if they exist
301
+ if (await fs.pathExists(this.scaffoldDir)) {
302
+ await fs.copy(this.scaffoldDir, this.oneDir, { overwrite: false });
303
+ }
304
+
305
+ console.log(chalk.green('āœ… Created .one workspace structure'));
306
+ }
307
+
308
+ async generatePersonalizedContent(profile) {
309
+ console.log(chalk.blue('\\nšŸ¤– Generating personalized content...'));
310
+
311
+ // Generate personalized agents
312
+ await this.generatePersonalAgents(profile);
313
+
314
+ // Generate workflow templates
315
+ await this.generateWorkflowTemplates(profile);
316
+
317
+ // Generate mission templates
318
+ await this.generateMissionTemplates(profile);
319
+
320
+ // Create initial space configuration
321
+ await this.createSpaceConfig(profile);
322
+
323
+ console.log(chalk.green('āœ… Generated personalized content'));
324
+ }
325
+
326
+ async generatePersonalAgents(profile) {
327
+ const agents = [];
328
+
329
+ // Core agents everyone gets
330
+ agents.push({
331
+ name: 'Personal Assistant',
332
+ description: `Your personal AI assistant who knows about your role as ${profile.role} and your work in ${profile.industry}.`,
333
+ expertise: ['project coordination', 'personal productivity', profile.role.toLowerCase()],
334
+ context: profile
335
+ });
336
+
337
+ // Skill-based agents
338
+ if (profile.skills.includes('JavaScript/TypeScript')) {
339
+ agents.push({
340
+ name: 'JavaScript Specialist',
341
+ description: 'Expert in JavaScript/TypeScript development and modern frameworks.',
342
+ expertise: ['JavaScript', 'TypeScript', 'Node.js', 'web development'],
343
+ context: profile
344
+ });
345
+ }
346
+
347
+ if (profile.skills.includes('React/Vue/Angular')) {
348
+ agents.push({
349
+ name: 'Frontend Specialist',
350
+ description: 'React, Vue, and Angular expert for frontend development.',
351
+ expertise: ['React', 'Vue', 'Angular', 'frontend', 'UI/UX'],
352
+ context: profile
353
+ });
354
+ }
355
+
356
+ if (profile.skills.includes('Python')) {
357
+ agents.push({
358
+ name: 'Python Specialist',
359
+ description: 'Python development expert for backend and data work.',
360
+ expertise: ['Python', 'backend development', 'data analysis'],
361
+ context: profile
362
+ });
363
+ }
364
+
365
+ // Role-based agents
366
+ if (profile.role.toLowerCase().includes('manager') || profile.role.toLowerCase().includes('lead')) {
367
+ agents.push({
368
+ name: 'Team Leadership Advisor',
369
+ description: 'Guidance on team management, project coordination, and leadership.',
370
+ expertise: ['team management', 'project leadership', 'communication'],
371
+ context: profile
372
+ });
373
+ }
374
+
375
+ // Save agent configurations
376
+ for (const agent of agents) {
377
+ const agentFile = path.join(this.oneDir, 'agents', `${agent.name.toLowerCase().replace(/\\s+/g, '-')}.yaml`);
378
+ const agentConfig = {
379
+ name: agent.name,
380
+ description: agent.description,
381
+ expertise: agent.expertise,
382
+ personalContext: {
383
+ userRole: profile.role,
384
+ userSkills: profile.skills,
385
+ userIndustry: profile.industry,
386
+ userCompany: profile.company,
387
+ userWorkStyle: profile.workStyle,
388
+ userLearningStyle: profile.learningStyle
389
+ },
390
+ prompts: {
391
+ system: `You are ${agent.name}, specifically helping ${profile.name}, a ${profile.role} working in ${profile.industry}.
392
+ Adapt your communication style to their preference for ${profile.learningStyle.toLowerCase()} and their ${profile.workStyle.toLowerCase()} approach.
393
+ Their main skills: ${profile.skills.join(', ')}
394
+ Current focus: ${profile.currentProject}
395
+ Main challenges: ${profile.challenges}`,
396
+ greeting: `Hi ${profile.name}! I'm your ${agent.name}, here to help with your work as a ${profile.role}. What can I assist you with today?`
397
+ }
398
+ };
399
+
400
+ await fs.writeFile(agentFile, `---
401
+ name: ${agentConfig.name}
402
+ description: |
403
+ ${agentConfig.description}
404
+
405
+ Personalized for ${profile.name} (${profile.role})
406
+ Context: ${profile.industry} industry, ${profile.company}
407
+
408
+ expertise: ${JSON.stringify(agentConfig.expertise)}
409
+ context: ${JSON.stringify(agentConfig.personalContext)}
410
+ ---
411
+
412
+ # ${agent.name}
413
+
414
+ **Your personalized AI specialist for ${agent.expertise.join(', ')}**
415
+
416
+ ## About You
417
+ I know you're ${profile.name}, working as a ${profile.role} at ${profile.company} in the ${profile.industry} industry.
418
+
419
+ You prefer ${profile.learningStyle.toLowerCase()} and work with a ${profile.workStyle.toLowerCase()} approach.
420
+
421
+ ## How I Help
422
+ Based on your profile, I'm specialized to help you with:
423
+ ${agent.expertise.map(skill => `- ${skill}`).join('\\n')}
424
+
425
+ ## Your Context
426
+ - **Current Project:** ${profile.currentProject}
427
+ - **Main Challenges:** ${profile.challenges}
428
+ - **Skills:** ${profile.skills.join(', ')}
429
+ - **Experience:** ${profile.experience} years
430
+
431
+ I'll adapt my suggestions to match your experience level and preferred learning style.
432
+ `);
433
+ }
434
+
435
+ console.log(chalk.cyan(` āœ“ Created ${agents.length} personalized agents`));
436
+ }
437
+
438
+ async generateWorkflowTemplates(profile) {
439
+ const workflows = [];
440
+
441
+ // Development workflows based on skills
442
+ if (profile.skills.some(skill => ['JavaScript/TypeScript', 'React/Vue/Angular', 'Node.js'].includes(skill))) {
443
+ workflows.push({
444
+ name: 'web-development-workflow',
445
+ title: 'Web Development Workflow',
446
+ description: `Personalized web development workflow for ${profile.name}`,
447
+ steps: [
448
+ 'Project planning and requirements',
449
+ 'Setup development environment',
450
+ 'Implement core features',
451
+ 'Testing and quality assurance',
452
+ 'Deployment and monitoring'
453
+ ],
454
+ tools: profile.skills.filter(skill =>
455
+ ['JavaScript/TypeScript', 'React/Vue/Angular', 'Node.js', 'Docker/Kubernetes'].includes(skill)
456
+ ),
457
+ adaptedFor: profile.workStyle
458
+ });
459
+ }
460
+
461
+ // Save workflow templates
462
+ for (const workflow of workflows) {
463
+ const workflowFile = path.join(this.oneDir, 'workflows', `${workflow.name}.yaml`);
464
+ await fs.writeFile(workflowFile, `name: ${workflow.name}
465
+ title: ${workflow.title}
466
+ description: ${workflow.description}
467
+ personalizedFor: ${profile.name}
468
+ userContext:
469
+ role: ${profile.role}
470
+ experience: ${profile.experience}
471
+ workStyle: ${profile.workStyle}
472
+ skills: ${JSON.stringify(profile.skills)}
473
+
474
+ steps:
475
+ ${workflow.steps.map(step => ` - ${step}`).join('\\n')}
476
+
477
+ tools:
478
+ ${workflow.tools.map(tool => ` - ${tool}`).join('\\n')}
479
+
480
+ adaptations:
481
+ workStyle: ${workflow.adaptedFor}
482
+ learningStyle: ${profile.learningStyle}
483
+ `);
484
+ }
485
+
486
+ console.log(chalk.cyan(` āœ“ Created ${workflows.length} personalized workflows`));
487
+ }
488
+
489
+ async generateMissionTemplates(profile) {
490
+ // Create mission templates based on their current project and challenges
491
+ const missionTemplates = [
492
+ {
493
+ name: 'current-project-mission',
494
+ objective: profile.currentProject,
495
+ challenges: profile.challenges.split(',').map(c => c.trim()),
496
+ skills: profile.skills,
497
+ timeline: this.estimateProjectTimeline(profile),
498
+ personalContext: profile
499
+ },
500
+ {
501
+ name: 'skill-development-mission',
502
+ objective: `Develop advanced skills in ${profile.skills.slice(0, 3).join(', ')}`,
503
+ challenges: ['Learning new concepts', 'Applying knowledge practically', 'Building portfolio projects'],
504
+ skills: profile.skills,
505
+ timeline: '1-3 months',
506
+ personalContext: profile
507
+ }
508
+ ];
509
+
510
+ for (const template of missionTemplates) {
511
+ const templateFile = path.join(this.oneDir, 'templates', `${template.name}.yaml`);
512
+ await fs.writeFile(templateFile, `name: ${template.name}
513
+ objective: ${template.objective}
514
+ personalizedFor: ${profile.name}
515
+ userContext:
516
+ role: ${profile.role}
517
+ company: ${profile.company}
518
+ industry: ${profile.industry}
519
+ experience: ${profile.experience}
520
+
521
+ challenges:
522
+ ${template.challenges.map(challenge => ` - ${challenge}`).join('\\n')}
523
+
524
+ requiredSkills:
525
+ ${template.skills.slice(0, 5).map(skill => ` - ${skill}`).join('\\n')}
526
+
527
+ estimatedTimeline: ${template.timeline}
528
+ workStyle: ${profile.workStyle}
529
+ learningStyle: ${profile.learningStyle}
530
+
531
+ suggestedStories:
532
+ - "Plan and design ${template.objective}"
533
+ - "Research and learn required technologies"
534
+ - "Implement core functionality"
535
+ - "Test and validate solution"
536
+ - "Deploy and document results"
537
+ `);
538
+ }
539
+
540
+ console.log(chalk.cyan(` āœ“ Created ${missionTemplates.length} personalized mission templates`));
541
+ }
542
+
543
+ estimateProjectTimeline(profile) {
544
+ const experience = parseInt(profile.experience) || 1;
545
+ const complexity = profile.currentProject.toLowerCase();
546
+
547
+ if (complexity.includes('simple') || complexity.includes('basic')) {
548
+ return experience > 5 ? '1-2 weeks' : '2-4 weeks';
549
+ } else if (complexity.includes('complex') || complexity.includes('enterprise')) {
550
+ return experience > 5 ? '2-3 months' : '3-6 months';
551
+ } else {
552
+ return experience > 5 ? '3-6 weeks' : '6-8 weeks';
553
+ }
554
+ }
555
+
556
+ async createSpaceConfig(profile) {
557
+ const spaceConfig = {
558
+ version: '1.0.0',
559
+ personalSpace: {
560
+ owner: profile.name,
561
+ role: profile.role,
562
+ company: profile.company,
563
+ industry: profile.industry,
564
+ created: new Date().toISOString()
565
+ },
566
+ preferences: {
567
+ workStyle: profile.workStyle,
568
+ learningStyle: profile.learningStyle,
569
+ primarySkills: profile.skills.slice(0, 5)
570
+ },
571
+ agents: {
572
+ active: ['personal-assistant'],
573
+ available: []
574
+ },
575
+ defaultWorkflows: [
576
+ 'web-development-workflow'
577
+ ],
578
+ missionTemplates: [
579
+ 'current-project-mission',
580
+ 'skill-development-mission'
581
+ ]
582
+ };
583
+
584
+ const yaml = await import('js-yaml');
585
+ await fs.writeFile(
586
+ path.join(this.oneDir, 'spaces', 'personal.yaml'),
587
+ `# Personal Space Configuration for ${profile.name}
588
+
589
+ ${yaml.default.dump(spaceConfig, { indent: 2 })}`
590
+ );
591
+
592
+ console.log(chalk.cyan(' āœ“ Created personal space configuration'));
593
+ }
594
+
595
+ async installClaudeCodeAgents(options = {}) {
596
+ console.log(chalk.blue('\nšŸ”— Setting up Claude Code integration...'));
597
+
598
+ try {
599
+ // Install agents with selective installation based on options
600
+ const installOptions = {
601
+ coreOnly: options.coreOnly || false,
602
+ includeMarketing: options.includeMarketing || false,
603
+ includeTrialLicense: options.trial || false
604
+ };
605
+
606
+ await this.agentInstaller.install(installOptions);
607
+
608
+ // Create trial license if requested
609
+ if (options.trial) {
610
+ console.log(chalk.blue('šŸŽÆ Setting up trial license...'));
611
+ const licenseValidator = this.agentInstaller.licenseValidator;
612
+ await licenseValidator.createTrialLicense(7);
613
+ console.log(chalk.green('āœ… 7-day trial license created'));
614
+ }
615
+
616
+ } catch (error) {
617
+ console.log(chalk.yellow('āš ļø Claude Code integration setup failed:', error.message));
618
+ console.log(chalk.gray('You can install agents later with: npx oneie agents install'));
619
+ }
620
+ }
621
+
622
+ async showCompletion() {
623
+ console.log(chalk.green.bold('\\nšŸŽ‰ ONE Installation Complete!\\n'));
624
+
625
+ console.log(chalk.blue('šŸ“ Created:'));
626
+ console.log(' me.md # Your personal profile');
627
+ console.log(' .one/agents/ # Your personalized AI agents');
628
+ console.log(' .one/workflows/ # Workflows for your work style');
629
+ console.log(' .one/templates/ # Mission templates for your goals');
630
+ console.log(' .one/spaces/ # Your personal collaborative space');
631
+ console.log(' .claude/agents/ # Claude Code integrated agents');
632
+ console.log(' .claude/commands/ # Agent command files for Claude Code');
633
+
634
+ console.log(chalk.yellow('\\nšŸš€ Next Steps:'));
635
+ console.log(' npx oneie generate # Generate content from your me.md');
636
+ console.log(' npx oneie mission create # Start your first mission');
637
+ console.log(' npx oneie agents # Meet your personal agents');
638
+ console.log(' npx oneie update-me # Update your profile anytime');
639
+
640
+ console.log(chalk.cyan('\\nšŸ¤– Claude Code Integration:'));
641
+ console.log(' one:engineering-director # Access agents in Claude Code');
642
+ console.log(' one:license --status # Check premium agent access');
643
+ console.log(' one:license --trial # Try premium agents (7 days)');
644
+
645
+ console.log(chalk.gray('\\nšŸ’” Your workspace adapts as you update me.md'));
646
+ console.log(chalk.gray(' Add new skills, projects, or goals and regenerate content.'));
647
+ }
648
+
649
+ async generate() {
650
+ console.log(chalk.cyan.bold('\\nšŸ”„ Generating Content from Your Profile\\n'));
651
+
652
+ if (!await this.isInstalled()) {
653
+ console.log(chalk.red('āŒ ONE is not installed here.'));
654
+ console.log(chalk.gray('Run: npx oneie'));
655
+ return;
656
+ }
657
+
658
+ // Read current me.md
659
+ const meContent = await fs.readFile(this.meFile, 'utf8');
660
+ const profile = this.parseProfileFromMarkdown(meContent);
661
+
662
+ console.log(chalk.blue(`šŸ‘‹ Hi ${profile.name || 'there'}!`));
663
+ console.log(chalk.gray(`Reading your profile: ${profile.role} at ${profile.company}`));
664
+
665
+ // Regenerate personalized content
666
+ await this.generatePersonalizedContent(profile);
667
+
668
+ console.log(chalk.green('\\nāœ… Content regenerated based on your current me.md'));
669
+ console.log(chalk.cyan('Your agents, workflows, and templates are now up to date!'));
670
+ }
671
+
672
+ parseProfileFromMarkdown(content) {
673
+ // Simple markdown parser to extract profile info
674
+ const lines = content.split('\\n');
675
+ const profile = {
676
+ name: '',
677
+ role: '',
678
+ company: '',
679
+ industry: '',
680
+ skills: [],
681
+ experience: '',
682
+ workStyle: '',
683
+ learningStyle: '',
684
+ currentProject: '',
685
+ challenges: ''
686
+ };
687
+
688
+ let currentSection = '';
689
+
690
+ for (const line of lines) {
691
+ if (line.startsWith('# Me - ')) {
692
+ profile.name = line.replace('# Me - ', '').trim();
693
+ } else if (line.includes('Industry:')) {
694
+ profile.industry = line.split('Industry:')[1]?.trim() || '';
695
+ } else if (line.includes('Company:')) {
696
+ profile.company = line.split('Company:')[1]?.split('(')[0]?.trim() || '';
697
+ } else if (line.includes('**Project:**')) {
698
+ profile.currentProject = line.split('**Project:**')[1]?.trim() || '';
699
+ } else if (line.includes('**Main Challenges:**')) {
700
+ currentSection = 'challenges';
701
+ } else if (currentSection === 'challenges' && line.trim() && !line.startsWith('#')) {
702
+ profile.challenges = line.trim();
703
+ currentSection = '';
704
+ }
705
+ }
706
+
707
+ return profile;
708
+ }
709
+
710
+ async updateMe() {
711
+ console.log(chalk.cyan.bold('\\nāœļø Update Your Personal Profile\\n'));
712
+
713
+ if (!await this.isInstalled()) {
714
+ console.log(chalk.red('āŒ ONE is not installed here.'));
715
+ console.log(chalk.gray('Run: npx oneie'));
716
+ return;
717
+ }
718
+
719
+ // Read current me.md
720
+ const meContent = await fs.readFile(this.meFile, 'utf8');
721
+ console.log(chalk.blue('Current me.md:'));
722
+ console.log(chalk.gray(meContent.substring(0, 200) + '...'));
723
+ console.log('');
724
+
725
+ const { action } = await inquirer.prompt([
726
+ {
727
+ type: 'list',
728
+ name: 'action',
729
+ message: 'What would you like to do?',
730
+ choices: [
731
+ 'Edit me.md in your default editor',
732
+ 'Update profile through questions',
733
+ 'View current profile',
734
+ 'Regenerate content after changes'
735
+ ]
736
+ }
737
+ ]);
738
+
739
+ if (action === 'Edit me.md in your default editor') {
740
+ console.log(chalk.cyan('Opening me.md in your default editor...'));
741
+ console.log(chalk.gray('Save and close the file when done, then run: npx oneie generate'));
742
+
743
+ const { spawn } = await import('child_process');
744
+ const editor = process.env.EDITOR || 'nano';
745
+ spawn(editor, [this.meFile], { stdio: 'inherit' });
746
+
747
+ } else if (action === 'Update profile through questions') {
748
+ const profile = await this.createPersonalProfile({ skipWelcome: true });
749
+ console.log(chalk.green('\\nāœ… Profile updated!'));
750
+ console.log(chalk.cyan('Run: npx oneie generate # To update your workspace'));
751
+
752
+ } else if (action === 'View current profile') {
753
+ console.log(chalk.blue('\\nšŸ“„ Your Current Profile:\\n'));
754
+ console.log(meContent);
755
+
756
+ } else if (action === 'Regenerate content after changes') {
757
+ await this.generate();
758
+ }
759
+ }
760
+ }
761
+
762
+ // CLI functions
763
+ export async function install(options = {}) {
764
+ const installer = new OneInstaller();
765
+ return await installer.install(options);
766
+ }
767
+
768
+ export async function generate() {
769
+ const installer = new OneInstaller();
770
+ return await installer.generate();
771
+ }
772
+
773
+ export async function updateMe() {
774
+ const installer = new OneInstaller();
775
+ return await installer.updateMe();
776
+ }