UNPKG

oneie

Version:

šŸ¤ ONE Personal Collaborative Intelligence - Creates personalized AI workspace from your me.md profile. Simple: npx oneie → edit me.md → generate personalized agents, workflows & missions. From students to enterprises, ONE adapts to your context.

270 lines (229 loc) • 9.65 kB
#!/usr/bin/env node /** * ONE Framework Installer * Usage: npx oneie (installs framework) * Then use Claude Code with /one slash command */ import { FrictionlessInstaller } from './frictionless-installer.js'; import { TransformativeAI } from './transformative-ai-engine.js'; import fs from 'fs'; import path from 'path'; class OneCLI { constructor() { this.projectRoot = process.cwd(); this.oneInstalled = this.checkInstallation(); } async run() { const args = process.argv.slice(2); const command = args[0]; // Default behavior: install the framework if (!command || command === 'install' || command === 'init') { await this.install(); return; } // Handle help requests if (command === '--help' || command === '-h' || command === 'help') { this.showHelp(); return; } // For existing installations, show how to use /one if (this.oneInstalled) { console.log('šŸŽÆ ONE Framework is already installed!'); console.log('\nUse Claude Code and type: /one\n'); console.log('Then you can:'); console.log(' • Create missions with clear objectives'); console.log(' • Break missions into actionable stories'); console.log(' • Execute with 18+ specialized agents'); console.log(' • Follow workflows, tasks, and checklists\n'); } else { // Install if not present await this.install(); } } checkInstallation() { return fs.existsSync(path.join(this.projectRoot, 'one')); } async install() { const installer = new FrictionlessInstaller(); await installer.install(); this.oneInstalled = true; } async processRequest(userInput) { try { const ai = new TransformativeAI(); await ai.processRequest(userInput); } catch (error) { console.error('šŸ”§ AI processing temporarily unavailable.'); console.log('šŸ’” Try using direct commands instead:'); console.log(' npx oneie one:agent - Access AI specialists'); console.log(' npx oneie one:mission - Mission management'); console.log(' npx oneie one:story - Story creation'); console.log(' npx oneie help - Show all options'); } } async handleUpgrade(args) { const upgradeType = args[1]; // --trial or --premium if (upgradeType === '--trial') { await this.startFreeTrial(); } else if (upgradeType === '--premium') { await this.upgradeToPremium(); } else { await this.showUpgradeOptions(); } } async startFreeTrial() { console.log('šŸŽ Starting your 7-day FREE trial...\n'); // Simulate trial setup console.log('✨ Setting up premium features...'); await this.sleep(1000); console.log('šŸ” Activating specialized agents...'); await this.sleep(1000); console.log('šŸš€ Unlocking viral growth workflows...'); await this.sleep(1000); console.log('\nšŸŽ‰ FREE TRIAL ACTIVATED!\n'); console.log('You now have access to:'); console.log(' šŸ¤– 50+ Specialized Agents'); console.log(' šŸš€ Viral Growth Workflows'); console.log(' 🧠 AI-Powered Intelligence'); console.log(' šŸ’¼ Enterprise Features\n'); console.log('Try these premium commands:'); console.log(' npx oneie "Generate 20 marketing specialists"'); console.log(' npx oneie "Create viral marketing campaign"'); console.log(' npx oneie "Build enterprise API with microservices"\n'); // Create trial config const trialConfig = { trial: true, startDate: new Date().toISOString(), expiryDate: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(), features: ['premium-agents', 'viral-workflows', 'ai-intelligence'] }; const fs = await import('fs'); fs.writeFileSync('.one-trial', JSON.stringify(trialConfig, null, 2)); console.log('šŸ’” Trial expires in 7 days. Upgrade anytime with:'); console.log(' npx oneie upgrade --premium\n'); } async upgradeToPremium() { console.log('šŸ’° Upgrading to ONE Premium...\n'); console.log('šŸ” Premium Features Include:'); console.log(' ✨ 50+ Specialized AI Agents'); console.log(' šŸš€ Viral Growth Orchestrator'); console.log(' šŸŽÆ Content Multiplication Engine'); console.log(' šŸ’¼ Enterprise Workflows'); console.log(' 🧠 AI-Powered Market Intelligence'); console.log(' šŸŽØ Advanced UI/UX Specialists'); console.log(' šŸ”§ Backend Architecture Experts\n'); console.log('šŸ’³ Pricing:'); console.log(' šŸ’Ž Premium: $49/month'); console.log(' šŸ¢ Enterprise: $199/month\n'); console.log('🌐 Visit: https://one.ai/upgrade'); console.log('šŸ“§ Email: premium@one.ai'); console.log('šŸ’¬ Chat: Live support available\n'); console.log('šŸŽ Special offer: Use code TRANSFORM50 for 50% off first month!'); } async showUpgradeOptions() { console.log('🌟 ONE Premium - Unlock Your Full Potential\n'); console.log('šŸ†“ Current (Free):'); console.log(' āœ… 3 Core Agents'); console.log(' āœ… Basic Workflows'); console.log(' āœ… Standard Templates'); console.log(' āœ… Unlimited Usage\n'); console.log('šŸ’Ž Premium ($49/month):'); console.log(' šŸš€ 50+ Specialized Agents'); console.log(' šŸŽÆ Viral Growth Workflows'); console.log(' 🧠 AI Intelligence Suite'); console.log(' šŸ’¼ Enterprise Templates'); console.log(' šŸŽØ Advanced UI/UX Tools'); console.log(' ⚔ Priority Processing\n'); console.log('šŸ¢ Enterprise ($199/month):'); console.log(' 🌟 Everything in Premium'); console.log(' šŸ”§ Custom Agent Creation'); console.log(' šŸ“Š Advanced Analytics'); console.log(' šŸ› ļø Custom Integrations'); console.log(' šŸ‘„ Dedicated Support\n'); console.log('Commands:'); console.log(' npx oneie upgrade --trial # Start 7-day free trial'); console.log(' npx oneie upgrade --premium # View premium options'); console.log(' npx oneie upgrade --help # More information\n'); } sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } async showOneInterface() { console.log('šŸŽÆ ONE Framework - Mission Control\n'); // Check for existing foundation const hasFoundation = this.checkFoundation(); console.log('Current Status:'); if (hasFoundation) { console.log('āœ… Foundation loaded'); console.log('āœ… 18 agents ready'); console.log('āœ… Teams assembled\n'); } else { console.log('šŸ”„ Foundation setup needed'); console.log('āœ… 18 agents ready'); console.log('āœ… Teams assembled\n'); } // Show beautiful menu console.log('What would you like to do?'); console.log('[1] View Active Missions'); console.log('[2] Create New Mission'); console.log('[3] Continue Story'); console.log('[4] Summon Agent'); console.log('[5] Check Team Status'); console.log('[6] Generate Playbook\n'); console.log('Select a number or describe what you want to accomplish.\n'); } checkFoundation() { const foundationPath = path.join(this.projectRoot, 'one', 'data'); return fs.existsSync(foundationPath); } async createFoundation() { // Simulate foundation creation await this.sleep(500); console.log('šŸ“Š Analyzing your project structure...'); await this.sleep(500); console.log('šŸŽÆ Setting up mission templates...'); await this.sleep(500); console.log('šŸ‘„ Activating AI agent teams...'); await this.sleep(300); } async handleOneCommand(args) { // Delegate to the main CLI with the one:* command const { exec } = await import('child_process'); const { promisify } = await import('util'); const execAsync = promisify(exec); try { const command = `node one/tools/cli.js ${args.join(' ')}`; const { stdout, stderr } = await execAsync(command); if (stdout) console.log(stdout); if (stderr) console.error(stderr); } catch (error) { console.error('Error executing command:', error.message); console.log('\nšŸ’” Available one:* commands:'); console.log(' npx oneie one:mission - Mission management'); console.log(' npx oneie one:story - Story creation'); console.log(' npx oneie one:agent - Agent summoning'); console.log(' npx oneie one:team - Team coordination'); console.log(' npx oneie one:playbook - Playbook generation'); console.log(' npx oneie one:tools - Development tools'); } } showHelp() { console.log('šŸš€ ONE Framework - Mission-Driven Development\n'); console.log('Usage:'); console.log(' npx oneie - Install ONE framework'); console.log(' npx oneie install - Install in current project'); console.log(' npx oneie help - Show this help\n'); console.log('After installation:'); console.log(' Use Claude Code and type: /one'); console.log('\nThe ONE framework provides:'); console.log(' šŸŽÆ Mission-driven development with clear objectives'); console.log(' šŸ“– Story-based execution that achieves outcomes'); console.log(' šŸ¤– 18+ specialized agents organized by teams'); console.log(' šŸ”„ Proven workflows, tasks, and checklists'); console.log(' šŸ‘„ Cross-functional team coordination\n'); console.log('šŸ’« Beautiful mission-driven development awaits!'); } } // Run CLI const cli = new OneCLI(); cli.run().catch(console.error);