HellScript Language

Purpose-built DSL for web automation with fuel metering and type safety

What is HellScript?

HellScript is a domain-specific language designed for browser automation. It combines the power of declarative workflows with imperative control flow, type safety, and built-in fuel metering.

Basic Syntax

workflow "My First Workflow" {
  version = "1.0.0"
  mode = browser_automation

  param url: String = "https://example.com"
  param username: String
  param password: String

  step "Navigate to site" {
    navigate(url)
    wait_for_selector("#login-form")
  }

  step "Login" {
    fill_input("#username", username)
    fill_input("#password", password)
    click("button[type='submit']")

    wait_for_url_pattern("/dashboard")
  }

  step "Extract data" {
    var title = document.title
    var text = query_selector(".welcome-message").innerText

    return {
      title: title,
      message: text
    }
  }
}

Key Features

Type Safety

HellScript is statically typed with runtime validation:

param email: String       // Required parameter
param count: Number = 10  // Optional with default
var result: String        // Type-safe variable

Fuel Metering

Every operation consumes fuel to prevent runaway execution and enable usage-based pricing:

  • • Browser actions: 100-1000 fuel units
  • • Network requests: 50-500 fuel units
  • • DOM queries: 10-100 fuel units
  • • LLM calls: 1000-10000 fuel units

HTTP-Only Mode

For simple workflows, skip the browser and use HTTP-only mode (10x faster):

workflow "API Scraping" {
  version = "1.0.0"
  mode = http_only

  step "Fetch data" {
    var response = http.get("https://api.example.com/data")
    return response.json()
  }
}

Standard Library

HellScript includes a comprehensive standard library:

  • Browser Actions: navigate, click, fill_input, wait_for_selector
  • DOM Manipulation: query_selector, document.title, element.innerText
  • HTTP Client: http.get, http.post, http.put, http.delete
  • Data Processing: JSON, String, Array utilities
  • Error Handling: try/catch blocks, retry logic

See the Standard Library Reference for complete documentation.

AI-Powered Authoring

You don't have to write HellScript manually. Hellcat's discovery mode uses Gemini AI to automatically author workflows from natural language descriptions:

$ hellcat run "create an account on github.com"

⚡ Discovering workflow...
✓ Workflow authored automatically
✓ Executing...

📚 Learn More

Syntax Reference - Complete language syntax
Standard Library - Built-in functions and modules
AI Discovery - Automatic workflow authoring