Docs / Reference · CLI
ReferenceCLI Reference · forjabot
forjabot is Forja's installer. It pulls a bot from the catalog, drops it in your own cloud, and keeps it up to date. You don't install it: you run it with npx, and it finishes by printing clear steps your agent carries out — deploying, connecting channels, configuring. It has exactly five commands.
npx downloads and runs forjabot on the fly. You type npx forjabot <command> and that's it — the latest version every time, no npm install -g. Your agent (Claude Code or Codex) can run these commands for you; you just answer the business questions.
How It's Used
The shape is always the same: npx forjabot <command> [arguments] [--key HZN-…]. If you type npx forjabot with no command, it starts init (the wizard). Any word that isn't a valid command prints the command list and exits.
| Command | What It Does |
|---|---|
| init | Interactive wizard: language, license (or a free one), pick a business type, download, and business onboarding. |
| list | Shows the catalog of available bots. Doesn't require a license. |
| install <slug> | Installs a business type directly, skipping the wizard. |
| update | Pulls the bot's new version while keeping your config and knowledge base. |
| doctor | Diagnostic for the installed bot: files, config, version, license, and whether the bot responds online. |
Actual Flags and Arguments
The CLI has few flags. --key is the main one; --email and --name are for starting free without typing it in. Everything else is positional arguments.
| Element | Where | What It Is |
|---|---|---|
| --key HZN-… | init · install · update · doctor | Your license. Normalized to uppercase. If you don't pass it, the saved one is used. |
| --yes | init · install | Non-interactive: accepts the defaults without asking. For agents and CI (also FORJA_YES=1). |
| --giro <slug> | init | Picks the business type without going through the menu (same effect as install <slug> but inside the wizard). |
| --email · --name | init | For "start free" without typing it in (useful if your keyboard doesn't type @ in the terminal). |
| --cerebro · --tono · … | init | Fill in the onboarding without menus: --cerebro claude|chatgpt|grok, --tono cercano|formal|divertido, --negocio, --que, --ofrece (with prices), --horario, --ubicacion, --telefono, --web, --pagos, --faq, --reglas, --lang es|en. |
| <slug> | install | The bot/business type to install. Positional and required. See Available Business Types. |
| [dir] | update · doctor | The bot's folder. Optional: if you omit it, it's auto-detected from where you are. |
| HORIZONTES_KEY | environment variable | License via env. Second in the resolution order. |
| FORJA_SERVER · HORIZONTES_SERVER | environment variable | Overrides the license server. Advanced — you almost never touch this. |
Where the license comes from, in this order: the --key flag → the HORIZONTES_KEY variable → the one saved in ~/.forja/config.json. Whichever exists first wins.
When the CLI is run by your agent (Claude Code / Codex) or a CI, there are no arrow-key menus. Pass it everything via flags so it doesn't sit there waiting: npx forjabot init --yes --giro barberia --email tu@correo.com. If a required value is missing, the CLI fails with a code ([E-INPUT-REQUIRED], [E-GIRO-NOT-FOUND]) telling it which flag to pass — it never hangs.
The first time, init asks you Spanish or English and saves it. From then on every command speaks in that language. update also respects the language you used to install that particular bot.
init
The starting point. A wizard that takes you from zero to a bot ready to deploy, asking you one thing at a time.
- Usage
npx forjabot init— or simplynpx forjabot(with no command it starts the wizard).- What It Does
- 1) Picks a language (Spanish/English) and saves it. 2) License — three options you navigate with arrow keys ↑↓: paste your
HZN-XXXX-XXXX-XXXX, "start free" (creates you a license for the Starter bot), or "Get Forja+" (explains that the license comes with the Horizontes IA community). 3) Validates the license and prints your plan. 4) Shows the catalog filtered by your plan — premium ones show up locked as🔒 requires <plan>. 5) Downloads the bot and creates the./<slug>folder. 6) Stamps tier, language, and business type intowrangler.toml. 7) If it's the generic bot (Starter), picks the brain (Claude / OpenAI / Grok) and asks you ~6 business questions, writing yourmember/config.local.ts. - Flags
- Interactive with arrow-key ↑↓ menus. Accepts
--key HZN-…(skips pasting the license) and--email/--name(for starting free without typing it in). Your API key is never typed here: at deploy time, it goes in as a Cloudflare secret.
# wizard — no global install needed
$ npx forjabot init
◇ Forja
Idioma / Language
1. Español 2. English
› 2
Do you already have a license?
1. Yes, paste my license
2. No — start free (Starter bot)
› 2
Validating license… ✓ plan free
Available bots:
1. Starter Bot · generic
Downloading Starter Bot… ✓ 84 KB · v1.0.0
✓ Config ready · your bot already knows your business
✓ Bot installed → ./starter
list
The catalog, as-is. Useful for seeing which business types exist and which are available before installing.
- Usage
npx forjabot list- What It Does
- Queries the live catalog and prints, for each bot, its name, its business type, its status —available or coming soon— and a short description.
- Flags
- None. Doesn't require a license — anyone can see the catalog.
$ npx forjabot list
◇ Forja · AI bots for your business · by Horizontes IA
Restaurant restaurante available
Takes orders and reservations over WhatsApp, 24/7.
Real Estate inmobiliaria available
Qualifies buyers and schedules visits.
Hospitality hoteleria coming soon
Room bookings and event quotes.
install
The direct route: installs a business type by its slug, skipping the wizard. Ideal when you already know what you want and already have a saved license — or when you're setting up bots in bulk.
- Usage
npx forjabot install <slug>· with an explicit license:npx forjabot install barberia --key HZN-XXXX-XXXX-XXXX- What It Does
- Validates the license, downloads the bot, creates the
./<slug>folder, and stamps tier, language, and business type intowrangler.toml. Finishes with the steps your agent follows. Doesn't run onboarding (unlikeinit): your agent fills in the business config using the business type's template. - Flags
<slug>is required — if missing: "Missing bot. Useinstall <slug>orlist."--key HZN-…is optional if you already have a saved license; if it's missing entirely: "Missing license. Use--keyor runinit." If the bot is premium and your plan doesn't cover it, you'll see why + how to unlock it.
$ npx forjabot install barberia --key HZN-7Q2K-9F3D-VX8M
◇ Forja · AI bots for your business
Downloading barberia… ✓ 84 KB · v1.0.0
✓ Bot installed → ./barberia
What's next (your Claude Code agent does this for you):
1. cd barberia
2. tell your agent: "configure my chatbot" (skill /configurar-mi-chatbot)
3. connect your Cloudflare and your channels — the agent guides you.
update
Pulls the bot's new version without touching your work. Run this when we ship improvements.
- Usage
npx forjabot update— from inside the bot's folder, or from its parent folder (it's auto-detected). Alsonpx forjabot update <folder>.- What It Does
- Revalidates the license, compares your installed version against the catalog, and if there's a new one, downloads and extracts it preserving your stuff:
member/*.local.ts,member/kb/, your.env/.dev.vars, and the install state. If you're already up to date, it tells you and does nothing. - Flags
[dir]optional (the bot's folder).--key HZN-…for revalidation; without a license it can't update, but your bot keeps running on its current version.
$ npx forjabot update
◇ Forja · AI bots for your business
Revalidating license… ✓
Installed: v1.0.0 · Latest: v1.1.0
Downloading v1.1.0… ✓ 86 KB
✓ Updated to v1.1.0 (your config and your KB were preserved)
To publish the changes, tell your agent:
"reinstall dependencies and deploy my bot" (pnpm install && pnpm deploy)
update only brings the new files into your folder. The changes aren't live until your agent reinstalls dependencies and deploys (pnpm install && pnpm deploy). The CLI never deploys on its own.
doctor
The health checkup. When something feels off, run doctor: it checks the essentials and tells you ✓ what's fine, ⚠ what's worth a look, and ✗ what's broken, with a hint on how to fix it.
- Usage
npx forjabot doctor— from inside the bot's folder (or pass it:npx forjabot doctor <folder>).- What It Does
- Six checks: 1) finds the bot's folder and its install marker; 2) key files —
wrangler.toml,package.json,node_modules,member/config.local.ts; 3) reads theBOT_NAME, theBOT_NICHE, and the panel URL fromwrangler.toml; 4) your version vs. the catalog; 5) validates the license; 6) pings<panel>/admin/overview— a 200 or a 401 means the bot responds online. - Flags
[dir]optional.--key HZN-…for the license check (if not, it warns it's missing but runs the rest). Closes with a count of "things to check."
$ npx forjabot doctor
◇ Forja · AI bots for your business
✓ Bot found in ./barberia
✓ Installed: barberia v1.1.0
✓ wrangler.toml present
✓ package.json present
✓ Dependencies installed
✓ Business configured (member/config.local.ts)
✓ Business name: Barbershop El Filo
✓ Business type (niche): barberia
✓ You're on the latest version
✓ Active license (pro)
✓ The bot responds online (https://mi-bot.workers.dev)
All good. Your Bot is healthy.
login
Connects your terminal to your forjabots.com account — just like wrangler login or gh auth login. The browser opens on its own (sign in with Google or GitHub) and the terminal detects when you're done. Works the same on Windows, Mac, and Linux; if the browser doesn't open, the CLI prints the URL to open by hand.
- Usage
npx forjabot login— once per machine. The credentials are stored in~/.forja/credentials.json(yours only, restricted permissions).- What It Unlocks
- Your panel at
app.forjabots.com: your bots with live metrics, and automaticpairat deploy time. - Flags
--no-browserdoesn't try to open the browser (just prints the URL).--forcesigns in again even if there's already an active session.
$ npx forjabot login
Opening the browser to sign in (Google or GitHub)…
If it doesn't open: https://app.forjabots.com/api/cli/auth?...
✓ connected as tu@correo.com
Next: deploy your bot and run forjabot pair
pair
Links a bot that's already deployed to your app.forjabots.com panel. Registers the bot under your account and configures the Worker's secrets on its own (via wrangler) — you don't copy tokens by hand. It's idempotent: running it again doesn't duplicate or break anything.
- Usage
npx forjabot pair— from inside the bot's folder, after the deploy. Requires a session (loginfirst).- What It Does
- 1) verifies the bot responds; 2) registers it to your account; 3) sets
CONTROL_PLANE_TOKENandCONTROL_PLANE_URLon the Worker; 4) confirms the connection. When it's done, your bot shows up in your panel with its metrics. - Flags
--urlthe Worker's URL ifwrangler.tomldoesn't have it yet.--nameto rename it in the panel. If your bot is from before, runforjabot updatefirst (needs the version with the panel API).
$ npx forjabot pair
Verifying the bot… ✓
Registering to your account… ✓
Configuring secrets… ✓
✓ bot connected — see it at https://app.forjabots.com/dashboard
whoami · logout
whoami tells you which account the terminal is connected with (or if there's no session). logout deletes the local credentials from this machine.
Available Business Types
The <slug> you pass to install decides the bot's business type: when installing, the CLI stamps the matching BOT_NICHE into your wrangler.toml, which relabels the panel and switches on that business type's playbook. These are the slugs the CLI recognizes; anything that doesn't match one of them falls back to generico (the Starter bot, with its guided onboarding).
| Slug (install) | Business Type | BOT_NICHE |
|---|---|---|
| restaurante | Restaurant | restaurante |
| cafeteria | Coffee Shop | cafeteria |
| panaderia | Bakery | panaderia |
| barberia | Barbershop | barberia |
| salon · salon-de-belleza | Beauty Salon | salon |
| spa | Spa | spa |
| dentista | Dentist | dentista |
| clinica | Clinic | clinica |
| gimnasio | Gym | gimnasio |
| coach | Coach | coach |
| inmobiliaria | Real Estate | inmobiliaria |
| tienda | Store | tienda |
| crm · crm-ventas | CRM / Sales | crm |
| hoteleria | Hospitality | hoteleria |
salon-de-belleza and crm-ventas are aliases: they install the same business type as salon and crm. The actual availability (and what plan it requires) is driven by the live catalog — run list to see it.
Your language and your license live in ~/.forja/config.json. Each bot's installed version lives in .horizontes-bot.json, inside the bot's folder — that's what update and doctor compare against the catalog. Don't delete them.
The CLI is exactly these five: init · list · install · update · doctor. There's no forja crear, forja publicar, forja panel, or forja marca. The panel isn't a command: it lives on your own worker, at /admin. Deploying is done by your agent with pnpm deploy. And the branding (bot name and business name) is stamped in during init. To operate the bot that's already installed —reports, improvements, campaigns— use the Agent Commands.
