UNPKG

oneie

Version:

Build apps, websites, and AI agents in English. Zero-interaction setup for AI agents (Claude Code, Cursor, Windsurf). Download to your computer, run in the cloud, deploy to the edge. Open source and free forever.

50 lines (46 loc) 1.7 kB
import { exec } from "child_process"; import { promisify } from "util"; import fs from "fs/promises"; import path from "path"; const execAsync = promisify(exec); export async function cloneWeb(orgProfile) { const targetDir = path.join(process.cwd(), "web"); // Check if web already exists if (await fs.stat(targetDir).catch(() => null)) { console.log("⚠️ Web directory already exists, skipping clone"); return { alreadyExists: true }; } // Clone web repository (single source of truth) console.log("Cloning web repository..."); await execAsync("git clone https://github.com/one-ie/web.git web", { cwd: process.cwd(), }); console.log("✓ Cloned web repository"); // Install dependencies console.log("Installing dependencies..."); await execAsync("bun install", { cwd: targetDir }); console.log("✓ Installed dependencies"); // Create .env.local with organization details const envContent = `# ONE Platform Configuration # Generated by CLI on ${new Date().toISOString()} # Organization PUBLIC_ORG_NAME="${orgProfile.name}" PUBLIC_ORG_SLUG="${orgProfile.slug}" PUBLIC_ORG_DOMAIN="${orgProfile.domain}" # Convex Backend (update with your deployment) PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud CONVEX_DEPLOYMENT=dev:your-deployment # Better Auth BETTER_AUTH_SECRET= BETTER_AUTH_URL=http://localhost:4321 # OAuth (optional) GITHUB_CLIENT_ID= GITHUB_CLIENT_SECRET= GOOGLE_CLIENT_ID= GOOGLE_CLIENT_SECRET= `; await fs.writeFile(path.join(targetDir, ".env.local"), envContent, "utf-8"); console.log("✓ Created .env.local"); return { cloned: true }; } //# sourceMappingURL=clone-web.js.map