Skip to main content
The HUD CLI provides a complete toolkit for creating, developing, and running MCP environments. Commands are organized into two main workflows:

Create & Deploy

Directory-based commands for creating environments:
  • hud init — Create new environment
  • hud deploy — Build remotely & deploy to platform
  • hud dev — Local development (hot-reload via --watch)
  • hud build — Local build for validation

Run & Evaluate

Target-based commands for using environments and agents:
  • hud analyze — Inspect capabilities (fast/live)
  • hud debug — 5‑phase compliance test
  • hud run — Execute (Python module/command/Docker)
  • hud eval — Run agents on tasks/datasets
  • hud rft — Fine-tune models (BETA, invite-only)

Installation

uv tool install hud-python@latest --python 3.12
hud --version

Commands

Create & Deploy

CommandInputDescriptionExample
hud initDirectoryCreate new environmenthud init my-env
hud deployDirectoryBuild remotely & deploy to platformhud deploy .
hud linkDirectoryLink to existing environmenthud link --id abc123

Local Development

CommandInputDescriptionExample
hud devDirectoryDevelopment server (--watch for hot-reload)hud dev . -w controller
hud buildDirectoryBuild image locally (for validation)hud build . --tag v1.0

Running Workflow

CommandInputDescriptionExample
hud analyzeImage or configInspect tools & capabilitieshud analyze org/env
hud debugImage/dir/config5‑phase compliance testhud debug my-env:latest
hud runModule/command/imageExecute server (local/remote)hud run controller --reload
hud evalTasks/datasetRun agent on taskshud eval tasks.json claude
hud rftTasks fileFine-tune models (BETA, invite-only)hud rft run tasks.json

Other Commands

CommandDescriptionExample
hud getDownload HF dataset to tasks filehud get hud-evals/2048-basic -o tasks.jsonl
hud quickstartClone quickstart repohud quickstart
hud cursor-listList Cursor MCP servershud cursor-list
hud versionShow CLI versionhud version
hud cloneClone any git repo (pretty output)hud clone https://github.com/...
hud setPersist API keys to ~/.hud/.envhud set HUD_API_KEY=...

Complete Workflows

Creating & Deploying an Environment

1

Initialize

Create a new HUD environment with minimal boilerplate:
hud init my-env && cd my-env
Creates Dockerfile, pyproject.toml, controller/ (MCP server), optional environment/ backend, tasks.json.
2

Deploy

Deploy directly to the HUD platform:
hud deploy
This builds your environment remotely on HUD’s infrastructure and deploys it. Or push to GitHub and connect on hud.ai for automatic rebuilds.

Local Development (Optional)

Use these commands when iterating on your environment locally before deploying:
# Development server (no auto-reload by default)
hud dev

# Enable hot-reload explicitly
hud dev -w controller -w environment

# Build locally to validate before deploying
hud build
hud dev runs your local development server; add --watch (-w) to enable automatic reloads. hud build creates a local Docker image and generates hud.lock.yaml for validation.

Running an Environment

1

Analyze

Quick inspection without running:
hud analyze hudpython/text_init    # Fast (from metadata)
hud analyze hudpython/text_init --live  # Full (runs container)
2

Debug

Test MCP protocol compliance:
hud debug hudpython/text_init:latest
Validates through 5 phases of initialization.
3

Run

Execute in production mode:
hud run hudpython/text_init:latest        # Remote (default)
hud run hudpython/text_init:latest --local  # Local Docker

Common Usage

Docker Images

# Basic
hud debug my-image:latest

# With options
hud debug my-image:latest -e DEBUG=true -p 8080:8080

# From registry
hud analyze ghcr.io/org/image:v1.0.0

Arbitrary Commands (Python/Node/etc.)

# Run any command as MCP server (stdio/http)
hud run --cmd "python -m controller" -t http -p 8765
hud run --cmd "node mcp-server.js"

Cursor Integration

# Debug Cursor server
hud debug --cursor my-dev-server

# List all servers
hud cursor-list

Output Formats

Interactive (Default)

hud analyze my-env

🔍 Analyzing MCP environment: my-env
 Connected successfully
 Found 12 tools

Available Tools:
 click - Click at coordinates
 type - Type text
  ...

JSON

hud analyze my-env --format json

{
  "tools": [{
    "name": "click",
    "description": "Click at coordinates",
    "parameters": {...}
  }]
}

Markdown

hud analyze my-env --format markdown > docs/tools.md

CI/CD Example

#!/bin/bash
set -e

# Test environment
hud debug "$IMAGE_NAME"

# Verify tools
TOOLS=$(hud analyze "$IMAGE_NAME" --format json | jq '.tools | length')
if [ "$TOOLS" -lt 3 ]; then
  echo "Not enough tools!"
  exit 1
fi

Python Scripting

import subprocess
import json

def get_tools(image):
    result = subprocess.run(
        ["hud", "analyze", image, "--format", "json"],
        capture_output=True,
        text=True,
        check=True
    )
    return json.loads(result.stdout)["tools"]

# Use
tools = get_tools("my-env:latest")
for tool in tools:
    print(f"- {tool['name']}: {tool['description']}")

Exit Codes

CodeMeaningDescription
0SuccessCommand completed
1General ErrorCommand failed
2Usage ErrorInvalid arguments
3Connection ErrorFailed to connect
4TimeoutOperation timed out
5Protocol ErrorMCP violation

Environment Variables

# Debug output
export HUD_CLI_DEBUG=true

# Custom timeout
export HUD_CLI_TIMEOUT=120

# Provider keys
export ANCHOR_API_KEY=...

Next Steps

Create & Deploy

Local Development

Running Commands