All posts
May 18, 2026

Mastering yeet-scripts: Real-Time AI & System Observability

Learn how to build lightweight, high-performance observability tools using yeet-scripts. Master the V8 runtime and real-time GraphQL system data.

As builders, we are often stuck between two worlds: heavy monitoring dashboards that are too slow to react, and arcane shell scripts that are impossible to maintain. Enter yeet-scripts, a Lovable Skill designed for creating hyper-specialized, real-time observability tools.

Yeet scripts are single JavaScript files executed by the yeet daemon. They don't just log data; they live inside a V8 isolate, subscribing to a pervasive system graph that monitors everything from CPU and memory to Docker containers and GPU thermals.

What It Does

Unlike standard Node.js scripts, yeet-scripts operate in a restricted, high-performance environment. This is not a general-purpose runtime; it is a surgical tool for data visualization and system reaction. By utilizing the yeet daemon's GraphQL engine, your scripts can query or subscribe to hardware metrics with millisecond precision.

Whether you are debugging a memory leak in a production container or building a custom dashboard for your local GPU temp, yeet-scripts provides the bridge between the system raw-data and a clean, programmable JavaScript interface.

How to Install

To start building with this skill, add it to your project via the Lovable CLI:

lovable add yeet-scripts

The Mental Model: No Node, No Browser

The most important thing to grasp about yeet-scripts is that it is not Node.js. There is no package.json, no node_modules, and no fs module. It is a pure V8 isolate.

Instead of standard APIs, the host injects specialized globals:

  • yeet: The bridge for arguments and data queries.
  • tty and style: Low-level terminal control for building UI.
  • console: Standard logging.
  • Standard timers: setInterval and setTimeout are your primary ways to keep scripts alive.

When to Use It

You should reach for yeet-scripts when you need to:

  1. Build Real-time TUI Tools: Fast-refreshing terminal interfaces that display system health.
  2. Monitor AI Workloads: Tracking GPU usage or inference latency via the system graph.
  3. Debug High-Frequency Issues: Using the dumpjs pattern to capture snapshots of system states when specific conditions are met.
  4. Bridge Data to Presentation: Decoupling your data fetching (data.js) from your visual logic (render.js).

Quick Code Example

Here is a simple script that monitors host uptime and prints it with a colored style. Note the use of yeet.args and the manual destructuring of the GraphQL response.

// uptime-monitor.js
const query = "{ host { uptime { uptime } } }";

async function refresh() {
  // yeet.graph.query returns the full GraphQL envelope
  const { data, errors } = await yeet.graph.query(query);
  
  if (errors) {
    console.error("Query failed", errors);
    return;
  }

  const seconds = data.host.uptime.uptime;
  const color = yeet.args.alert ? [255, 40, 60] : [0, 240, 240];
  
  console.log(style.fg(`System Uptime: ${seconds}s`, ...color));
}

// Keep the script alive with an interval
const interval = Number(yeet.args.interval) || 1000;
setInterval(refresh, interval);

High-Frequency Gotchas

To build effectively, keep these specific constraints in mind:

  • Strict Types for Args: yeet.args values are always strings or booleans. If you need a number (like for a timeout), you must wrap it in Number().
  • GraphQL Destructuring: Beginners often try to access result.data directly. Always check for the errors array in the returned envelope.
  • Subscriptions: Unlike many libraries where a subscription returns a function to stop, yeet.graph.subscribe returns a ticket string. You must pass this string to yeet.graph.unsubscribe(ticket) to halt the stream.
  • No Buffer: If you are handling binary data, use Uint8Array. The Node Buffer global does not exist here.

Patterns Worth Copying

The best yeet developers use the tri-file convention:

  • data.js: Handles the watch() logic and graph subscriptions.
  • render.js: Manages tty and style to draw the interface.
  • dumpjs: A specialized debugger version of your script that simply outputs raw data to a file or pipe for analysis.

Ready to build your next-generation observability tool? Install the skill and dive into the documentation.

Explore more at lovable.dev/skill/yeet-scripts.

Related posts