Skip to content

Base, Visual Builder

Base is the visual drag-and-drop editor for building habits. It runs in the browser and lets you design, test, and export workflows without writing YAML by hand.

What it is

CapabilityDescription
Visual editorConnect bits with a node graph UI
YAML exportExport any workflow to version-controlled .habit or stack.yaml and multiple habits .yaml files
Template libraryBrowse and import community habits
Module managerInstall and manage bits available in your workspace
Binary exportPack a habit into a standalone executable or app
MirrorSend/receive habits to other devices via P2P (Mirror)

Base UI

How to run Base

bash
npx habits base

Base starts at http://localhost:3000/habits/base/ by default.

WARNING

Base exposes module installation and code execution endpoints. Do not expose it publicly on a production server.

Key workflows

Environment Variables

Configure Base by setting these variables before starting the server (inline, in a .env file in the working directory, or via the Admin panel service settings).

Opt-in features (disabled by default)

VariableDefaultDescription
HABITS_ALLOW_SERVEfalseSet to true to allow running habits directly from the Base UI. Spawns a Cortex subprocess. Keep false on shared/public instances.

Security controls (enabled by default)

VariableDefaultDescription
HABITS_ALLOW_EXECUTEtrueSet to false to disable the workflow execution endpoint (POST /api/execute).
HABITS_ALLOW_MODULES_INSTALLtrueSet to false to disable module installation endpoints.
HABITS_ALLOW_EXPORTtrueSet to false to disable binary/app export endpoints.
HABITS_ALLOW_FORMS_AUTHtrueSet to false to disable forms authentication endpoints.
HABITS_ALLOW_SECURITY_APItrueSet to false to disable security disclosure endpoints.

Server configuration

VariableDefaultDescription
HABITS_CORS_ORIGINS*Comma-separated list of allowed CORS origins. Set to your domain in production (e.g. https://your-domain.com).
HABITS_BODY_LIMIT_MB1000Maximum JSON body size in MB. Lower this (e.g. 10) on public-facing instances.

AI generation

VariableRequiredDescription
CLAUDE_API_KEYNoYour Anthropic API key (sk-ant-...). Pre-configures AI generation for all users. If omitted, users can enter their own key in the Generate modal.
HABITS_AI_DEBUGNoSet to true to keep temporary staging directories on disk after generation. Useful for debugging generated files.
HABITS_REF_PATHNoPath to reference materials (bits and example habits). Defaults to ~/.habits/reference.

Example: enabling serve and AI generation

bash
HABITS_ALLOW_SERVE=true CLAUDE_API_KEY=sk-ant-... npx habits@latest base

Or add them to a .env file in the same directory:

env
HABITS_ALLOW_SERVE=true
CLAUDE_API_KEY=sk-ant-...

For public/shared instances see the hardening guide for recommended settings.

Setting environment variables via the Admin panel

When Base is running as a managed service inside Admin, you configure its environment variables through the Admin UI instead of the command line.

  1. Open the Admin UI.
  2. Go to Services and find your Base service instance.
  3. Click the service to open its settings.
  4. Locate the Environment Variables section and add the key-value pairs you need (e.g. HABITS_ALLOW_SERVE = true).
  5. Save and restart the service. Admin will pass the variables to the Base process on startup.

This is the recommended approach when running Base in a multi-service deployment, as it keeps configuration centralised and avoids editing files on the server directly.

Relation to other tools

ToolRelation
Cortex ServerBase exports YAML; Cortex runs it
AdminAdmin can host a Base instance as a managed service
MirrorBase toolbar includes a Mirror button to send habits P2P

Released under the AGPL-3.0 License.