Lines 3-43javascript
3// comando. Valida licencia contra el control plane, baja el bot (gated) y lo deja
4// listo para que tu agente lo despliegue. Bilingüe (ES/EN).
6// npx forjabot init → asistente interactivo (elige idioma + licencia/gratis)
7// npx forjabot list → ver el catálogo
8// npx forjabot install <slug> [--key HZN-...]
9// npx forjabot update [dir] [--key HZN-...] → jala la versión nueva
11// Modo no-interactivo (para agentes/CI): pasa --yes y los datos por flags para que no
12// se cuelgue esperando un menú. Ej:
13// npx forjabot init --yes --giro barberia --email tu@correo.com
14// npx forjabot install barberia --key HZN-XXXX-XXXX-XXXX --yes
15// Flags de init: --giro --key --codigo (evento) --email --name/--negocio --que --ofrece --horario
16// --ubicacion --telefono --web --pagos --faq --reglas --tono --cerebro
17// --lang es|en --yes --no-agent-skill
18import { createInterface } from "node:readline/promises";
19import { emitKeypressEvents } from "node:readline";
20import { stdin as input, stdout as output } from "node:process";
21import { mkdirSync, writeFileSync, readFileSync, rmSync, readdirSync, existsSync, statSync, realpathSync } from "node:fs";
22import { homedir } from "node:os";
23import { join } from "node:path";
24import { execFileSync } from "node:child_process";
25import { randomUUID } from "node:crypto";
26import { fileURLToPath } from "node:url";
28const SERVER = process.env.FORJA_SERVER || process.env.HORIZONTES_SERVER || "https://horizontes-license-server.innovandohorizontes.workers.dev";
29const GET_URL = process.env.FORJA_GET_URL || "https://horizontesia.com";
HighSame File Env Network Execution
A single source file combines environment access, network access, and code or shell execution; review context before blocking.
bin/cli.jsView on unpkg · L23 30const CFG_DIR = join(homedir(), ".forja");
31const CFG_FILE = join(CFG_DIR, "config.json");
32const MARKER = ".horizontes-bot.json";
33const PLAN_RANK = { free: 0, community: 1, pro: 2, agency: 3 };
36 cyan: (s) => `\x1b[36m${s}\x1b[0m`, dim: (s) => `\x1b[2m${s}\x1b[0m`, b: (s) => `
37 green: (s) => `\x1b[32m${s}\x1b[0m`, red: (s) => `\x1b[31m${s}\x1b[0m`, yellow: (s) => `
40// ── i18n ─────────────────────────────────────────────────────────────────────
43 tagline: "bots de IA para tu negocio · por Horizontes IA",