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
JavaScript
/**
* 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);