Installation Guide
Install the hoox CLI, bootstrap the monorepo with hoox onboard, and verify system prerequisites.
This page
This guide walks you through installing the @hoox-sh/hoox-cli tool, cloning the microservices monorepo, running hoox onboard, and validating local prerequisites.
📋 System Prerequisites
1. 🧅 Bun JavaScript Runtime (Version ≥ 1.2)
Hoox uses Bun as its package manager, script runner, and test engine. The CLI is a Bun bundle and will not run under Node.
- macOS / Linux:
curl -fsSL https://bun.sh/install | bash - Windows (via PowerShell):
powershell -c "irm https://bun.sh/install.ps1 | iex"
2. ⚡ Cloudflare® Account
All Hoox workers run on Cloudflare® Workers (V8 isolates). A free account is enough for typical retail volume:
- Account: Register free (Workers, D1, KV, Queues, R2, Vectorize — free-tier limits apply).
- API token: Created during
hoox onboard(or pass--token/--accountnon-interactively). The Cloudflare “Edit Cloudflare Workers” template is not enough — D1 list returns 401 until D1:Edit is added.
| Scope | Permission | Why |
|---|---|---|
| Account · Workers Scripts | Edit | Deploy workers |
| Account · Workers KV Storage | Edit | CONFIG_KV / sessions |
| Account · Workers R2 Storage | Edit | Reports / PYNE bars |
| Account · D1 | Edit | wrangler d1 list / schema (401 without this) |
| Account · Queues | Edit | Trade queue |
| Account · Vectorize | Edit | Gateway / Telegram RAG (hoox-rag-index) |
| Account · Workers Observability | Read (optional) | Trace / logs |
| Account · Workers AI | Edit (optional) | agent-worker |
| Account · Account Settings | Read | whoami / account id |
| User · Membership | Read | Token verification |
Prefer an API token over wrangler login on a remote or headless box — OAuth times out and stale-tab state mismatches are common. Keep the token in CLOUDFLARE_API_TOKEN; never write it into wrangler.jsonc.
The CLI ships with Wrangler as a dependency — you do not need a separate global wrangler install for normal operator workflows. Prefer hoox / hx commands over raw Wrangler for provision, secrets, and deploy.
3. 🐳 Docker & Docker Compose (Optional)
For isolated local mesh / self-host profiles:
- Check status:
docker compose version
📦 Install the CLI (Recommended)
# Install globally using Bun (the only supported path)
curl -fsSL https://bun.sh/install | bash
# Put ~/.bun/bin on PATH (the installer prints the line for your shell)
bun add -g @hoox-sh/hoox-cli
Warning
npm install -g @hoox-sh/hoox-cli aborts. The published tarball currently
ships optionalDependencies["@hoox-sh/hoox-tui"] = "workspace:*", which npm
cannot resolve. Use Bun. The CLI will not run under Node even if extract
succeeded.
Verify the binary (alias hx is identical):
hoox --version
# e.g. 0.13.x
hx --version
🛠️ Clone the Workspace
Workers are git submodules. Clone recursively:
git clone --recursive https://github.com/hoox-sh/hoox.git
cd hoox
If you already cloned without submodules:
git submodule update --init --recursive
# or: hoox clone --all
From source (contributors) — install workspace deps and build the local CLI if needed:
bun install
bun run build:cli # optional; monorepo scripts can invoke packages/cli
./packages/cli/bin/hoox.js --help
Warning
You MUST use git clone --recursive or run git submodule update --init --recursive after cloning. If you omit submodules, the worker directories
under workers/ will be empty and setup gates will abort deployment.
🪄 Bootstrap with hoox onboard
hoox onboard is the recommended entry point. It writes wrangler.jsonc, collects secrets, generates keys, applies the D1 schema, pushes secrets, and deploys the dashboard (init + setup in one shot).
# From the monorepo (first run discovers & remembers the path)
hoox onboard
# Non-interactive
hoox onboard --token cfut_xxx --account xxx --preset full
For fine-grained control, run the two steps separately:
hoox init # Step 1: write wrangler.jsonc, collect integration secrets
hoox setup # Step 2: generate keys, apply D1 schema, push secrets, deploy dashboard
hoox init copies each worker's wrangler.jsonc.example → wrangler.jsonc (the real files are gitignored). Dashboard OpenNext needs workers/dashboard/wrangler.jsonc. There is no hoox init --self-hosted Cloudflare-free config path — for VPS/air-gap use bun run docker:prod / bun run server.js (or hoox init --self-hosted to print those instructions).
Exchange / Telegram / wallet secrets stay empty until you supply them — that is expected. Mesh keys (INTERNAL_KEY_BINDING, …) are generated by hoox setup.
The wizard walks through:
Cloudflare® authentication — API token and Account ID.
Microservice profile — enable/disable edge workers (gateway, trade, agent, pyne, web3, …).
Local credentials — generates
.dev.vars(mode0600) and initial KV structures.Infrastructure provisioning — D1, KV, and related resources.
Setup gates — aborts if worker trees are still empty after submodule clone, or if init did not produce a valid
wrangler.jsonc.
┌────────────────────────────────────────────────────────┐
│ hoox Setup & Initialization │
├────────────────────────────────────────────────────────┤
│ ✔ bun found │
│ ✔ git found │
│ ✔ Cloudflare® credentials verified │
│ │
│ Enable central Gateway Worker? [Y/n]: y │
│ Enable Multi-Exchange trade-worker? [Y/n]: y │
│ Enable agent-worker AI Risk Manager? [Y/n]: y │
└────────────────────────────────────────────────────────┘
📍 Run from any directory (monorepo remember)
After you have used the CLI once inside the monorepo, the path is saved to
~/.hoox/config/monorepo.json. Later you can call hoox / hx from any folder
(e.g. ~/Videos) and the CLI will chdir into the monorepo automatically.
# First time: inside the clone (remembers the path)
cd ~/Git/hoox
hoox doctor
# Later: any working directory
cd ~/Videos
hx check setup
hx doctor # Source: remembered · Runtime root: /…/hoox
Resolution order: HOOX_REPO env → walk up from cwd → remembered monorepo
file → ~/.hoox/repo (managed global clone via hoox doctor --fix-runtime).
| Override | Purpose |
|---|---|
HOOX_REPO=/path/to/hoox | Force monorepo root |
HOOX_HOME=~/.hoox | Home for config / data / global repo (default) |
HOOX_CLI_SILENT=1 | Hide the one-line “using monorepo at …” notice |
🔍 Verifying Local Prerequisites
# Pre-flight tools on the machine
hoox check prerequisites
# Full bootstrap validation (config, infra, secrets presence, db)
hoox check setup
# Live worker /health probes
hoox check health
hoox check setup only fails secrets when declared names are missing on Cloudflare® (with hoox secrets sync hints). Healthy local .dev.vars and complete remote name lists stay quiet.
Tip
Got installation issues? Run hoox repair check to analyze path resolution,
missing env vars, or empty worker submodules, and recover the workspace.
🔗 Next Steps
- Configuration Matrix — Environment variables and KV registries.
- 5-Minute Quick Start Guide — Deploy and fire a simulated trade webhook.