@faff/create
Version:
FAF format creator - MCP Anthropic approved, Chrome Extension Google approved - F1-inspired engineering, championship-grade testing
152 lines • 6.17 kB
JavaScript
import inquirer from 'inquirer';
import { exec } from 'child_process';
import { promisify } from 'util';
const execAsync = promisify(exec);
const ORANGE = '\x1b[38;5;208m';
const CYAN = '\x1b[36m';
const RESET = '\x1b[0m';
const BOLD = '\x1b[1m';
const packages = [
{
name: 'FAF CLI - Universal AI context generator',
value: 'cli',
description: 'Install faf-cli globally for any project',
command: 'npm install -g faf-cli'
},
{
name: 'Claude FAF MCP - Claude Desktop integration',
value: 'mcp',
description: 'MCP server for Claude Desktop (official Anthropic registry)',
command: 'npx -y claude-faf-mcp'
},
{
name: 'Both CLI + MCP - Complete FAF ecosystem',
value: 'both',
description: 'Install both CLI and MCP for maximum power',
command: 'npm install -g faf-cli && npx -y claude-faf-mcp'
},
{
name: 'Show info - Learn about FAF',
value: 'info',
description: 'Display information about the FAF ecosystem',
command: ''
}
];
async function showWelcome() {
console.log('');
console.log(`${BOLD}${ORANGE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
console.log(`${BOLD}${ORANGE} .FAF - Foundational AI-Context Format${RESET}`);
console.log(`${BOLD}${CYAN} Only Anthropic Approved MCP for Persistent Project Context${RESET}`);
console.log(`${BOLD}${ORANGE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${RESET}`);
console.log('');
}
async function showInfo() {
console.log('');
console.log(`${BOLD}${ORANGE}About FAF:${RESET}`);
console.log('');
console.log(`${CYAN}FAF (.faf)${RESET} is the universal format that brings Project DNA to ANY AI.`);
console.log('From Claude to OpenAI Codex to Gemini, from CLI to MCP to Chrome Extension.');
console.log('');
console.log(`${BOLD}Available Packages:${RESET}`);
console.log('');
console.log(` ${ORANGE}faf-cli${RESET} - Universal CLI (5,100+ downloads)`);
console.log(` ${ORANGE}claude-faf-mcp${RESET} - MCP server (3,600+ downloads, official Anthropic)`);
console.log('');
console.log(`${BOLD}Quick Start:${RESET}`);
console.log('');
console.log(` ${CYAN}npm install -g faf-cli${RESET} # Install CLI`);
console.log(` ${CYAN}faf init${RESET} # Initialize project`);
console.log(` ${CYAN}faf auto${RESET} # Generate .faf file`);
console.log('');
console.log(`${BOLD}Resources:${RESET}`);
console.log('');
console.log(` Website: ${CYAN}https://faf.one${RESET}`);
console.log(` npm Org: ${CYAN}https://npmjs.com/org/faff${RESET}`);
console.log(` CLI Package: ${CYAN}https://npmjs.com/package/faf-cli${RESET}`);
console.log(` MCP Package: ${CYAN}https://npmjs.com/package/claude-faf-mcp${RESET}`);
console.log('');
console.log(`${BOLD}${ORANGE}Championship-grade performance. F1-inspired engineering. Built by wolfejam.${RESET}`);
console.log('');
}
async function installPackage(choice) {
const selected = packages.find(p => p.value === choice);
if (!selected || !selected.command) {
return;
}
console.log('');
console.log(`${BOLD}${ORANGE}Installing: ${selected.description}${RESET}`);
console.log('');
console.log(`${CYAN}Running: ${selected.command}${RESET}`);
console.log('');
try {
const { stdout, stderr } = await execAsync(selected.command);
if (stdout) {
console.log(stdout);
}
if (stderr && !stderr.includes('npm WARN')) {
console.error(stderr);
}
console.log('');
console.log(`${BOLD}${ORANGE}✓ Installation complete!${RESET}`);
console.log('');
if (choice === 'cli' || choice === 'both') {
console.log(`${BOLD}Next steps:${RESET}`);
console.log('');
console.log(` ${CYAN}faf init${RESET} # Initialize FAF in your project`);
console.log(` ${CYAN}faf auto${RESET} # Generate .faf file automatically`);
console.log(` ${CYAN}faf score${RESET} # Check AI-readiness score`);
console.log('');
}
if (choice === 'mcp' || choice === 'both') {
console.log(`${BOLD}Claude MCP Setup:${RESET}`);
console.log('');
console.log(`Add to ${CYAN}~/Library/Application Support/Claude/claude_desktop_config.json${RESET}:`);
console.log('');
console.log(` {`);
console.log(` "mcpServers": {`);
console.log(` "faf": {`);
console.log(` "command": "npx",`);
console.log(` "args": ["-y", "claude-faf-mcp"]`);
console.log(` }`);
console.log(` }`);
console.log(` }`);
console.log('');
}
}
catch (error) {
console.error('');
console.error(`${BOLD}${ORANGE}✗ Installation failed${RESET}`);
console.error('');
if (error instanceof Error) {
console.error(error.message);
}
process.exit(1);
}
}
async function main() {
showWelcome();
const { choice } = await inquirer.prompt([
{
type: 'list',
name: 'choice',
message: 'What would you like to install?',
choices: packages.map(p => ({
name: p.name,
value: p.value
}))
}
]);
if (choice === 'info') {
showInfo();
process.exit(0);
}
await installPackage(choice);
}
main().catch(error => {
console.error('');
console.error(`${BOLD}${ORANGE}Error:${RESET}`, error.message);
console.error('');
process.exit(1);
});
//# sourceMappingURL=index.js.map