Elyra
Elyra The coding agent eTerm The terminal that knows where each command ends Huskarl AI colleagues on your own Mac Starf An activity monitor for Apple silicon that never invents a number etrans An SSH and SFTP client for macOS Elyra VM Virtual machines for macOS, Linux and Windows on your Mac Litr A small, native web browser for macOS Notr A notebook for macOS e The native code editor Elyra Grove Native local development environment Askr The real server for Laravel & PHP Elyra Framework Rust + Svelte 5 framework for desktop apps Elyra Conductor Local project conductor Refr Local-first PDF workspace for macOS Elyra Workspace A desktop workspace for coding agents eDock A container runtime for the Mac Elyra SQL Server MySQL-compatible SQL server in Rust Elyra Félagi Agents as teammates on one board Elyra SQL Client Native desktop SQL workbench Elyra SQL Anywhere Replication-ready SQL engine Elyra Sjá SEO & GEO workspace for macOS Elyra DataGrid Server-driven data grid for Laravel
Reference
Ratatosk CLI
Roadmap
RFC 0001: make:resource
RFC 0002: live queries
RFC 0003: MCP server
RFC 0004: MCP resource templates
RFC 0005: a Laravel backend
RFC 0006: Laravel broadcasting
RFC 0007: offline and sync
RFC 0008: Laravel notifications
RFC 0009: Files
RFC 0010: Laravel abilities
RFC 0011: an assistant in the app
RFC 0012: @elyra/ui
RFC 0013: the assistant sees the window
RFC 0014: Elyra Inspector
RFC 0015: presence
RFC 0016: capabilities per window
RFC 0017: record invalidation
RFC 0018: the assistant's answer, streamed
RFC 0019: a window from the tray
RFC 0020: an app that stays in the tray
RFC 0021: a server chosen at sign-in
RFC 0022: signed in to more than one server
RFC 0023: private channels a window listens to
RFC 0024: updates from the backend
RFC 0025: commands and configuration
RFC 0026: the running app, for coding agents
RFC 0027: the assistant's code mode
RFC 0028: the tray's icon, and the app's
RFC 0029: installers
RFC 0030: the app's identity on Windows
RFC 0031: a token per workspace
RFC 0032: the microphone
RFC 0033: diagnostics the user can send
RFC 0034: one screen in several states at once
RFC 0035: point at it, and hand it to the agent
RFC 0036: rata check, the app checked as a whole
RFC 0037: Theme Studio
RFC 0038: edit it in its own app
RFC 0039: a write shown at once in every window
RFC 0040: the two halves agree
RFC 0041: Quick Look
RFC 0042: follow a colleague
RFC 0043: every write seen
RFC 0044: composite keys
RFC 0045: bigint all the way
RFC 0046: pivot columns
RFC 0047: relations on any key
RFC 0048: more providers
RFC 0049: OpenAI web search
RFC 0050: integer-keyed arguments
RFC 0051: citations
RFC 0052: open documents
RFC 0053: exit hooks
RFC 0054: the gui feature
RFC 0055: menus that change
RFC 0056: the framework's own words
RFC 0057: rata upgrade
RFC 0058: @elyra/charts
RFC 0059: all of WireCharts
RFC 0060: exporting a chart
RFC 0061: zoom
RFC 0062: printing
RFC 0063: linked charts
RFC 0064: report pages
RFC 0065: marks
RFC 0066: taking a table out
RFC 0067: totals
RFC 0068: columns the user picks
RFC 0069: filters
RFC 0070: saved views
RFC 0071: lists over Laravel
RFC 0072: targets
RFC 0073: every row out
RFC 0074: grouped rows
RFC 0075: pinned columns
RFC 0076: views on the server
RFC 0077: every match selected
RFC 0078: editing in the table
RFC 0079: many cells at once
RFC 0080: a value for the selected rows
RFC 0081: a new row in the table
RFC 0082: a related record in a cell
RFC 0083: a filter by a related record
RFC 0084: one write for many rows
RFC 0085: the keys shown
RFC 0086: many rows in Laravel
RFC 0087: many rows deleted
RFC 0088: the trash
Release notes
Changelog
Elyra

Commands

A command is the compiled equivalent of a Laravel controller action. Annotate an async fn with #[command] and register it with commands![...].

use elyra::{command, commands, App, Ctx};

#[command]
async fn greet(ctx: Ctx, name: String) -> String {
    format!("Hello, {name}!")
}

App::new().commands(commands![greet, add]).run();

How it works

#[command] turns the function into a zero-sized type of the same name that implements the Command trait — so the function name doubles as the value you pass to commands![...]. Arguments are decoded from a compact MessagePack array; the return value is encoded as a named map (see wire format). The function itself stays, as name::run (below).

The Ctx

The first parameter is always the context and is passed through untouched. Use it to resolve services from the container:

#[command]
async fn greet(ctx: Ctx, name: String) -> String {
    let cfg = ctx.get::<Config>();     // Arc<Config>, panics if unbound
    format!("{} {name}", cfg.greeting)
}

Name it _ctx if unused.

Arguments and return types

  • Arguments must be simple identifiers with types that implement serde::Deserialize and specta::Type (for codegen).
  • The return type must implement serde::Serialize + specta::Type.
  • Structs are serialized as named maps → plain JS objects, resilient to field reordering across versions.
#[derive(serde::Serialize, serde::Deserialize, specta::Type)]
struct Point { x: i64, y: i64 }

#[command]
async fn shift(_ctx: Ctx, p: Point) -> Point { Point { x: p.x + 1, y: p.y + 1 } }

Zero-argument commands ignore the request body entirely.

A map keyed by integers (HashMap<i64, u32>) works from the page, though a JavaScript object's keys are strings: when the arguments don't decode as sent, a map key that's a string of digits is read as the integer its type asks for (RFC 0050). Only map keys: "3" for a u32 argument or field is still an error, as is a key like "3.0" or "three", with the message it always had.

#[command]
async fn set_quantities(_ctx: Ctx, by_line: HashMap<i64, u32>) -> Result<()> { … }
await api.set_quantities({ 3: 2, 7: 1 });

Fallible commands (Result)

Return Result<T, E> where E: Display. Ok(v) is serialized as T; Err(e) becomes an error response — the frontend promise rejects with a CommandError. Codegen surfaces T:

#[command]
async fn checked_div(_ctx: Ctx, a: i64, b: i64) -> Result<i64, String> {
    if b == 0 { Err("cannot divide by zero".into()) } else { Ok(a / b) }
}
try { await api.checked_div(1, 0); } catch (e) { /* CommandError */ }

elyra::Result<T> is the convenient shape when a command mixes kinds of failure: ? converts a ValidationErrors bag (which reaches the frontend as a ValidationError, fields intact) and — with the database feature — a query error, and elyra::Error::command(msg) covers the rest:

#[command]
async fn rename(ctx: Ctx, id: i64, name: String) -> elyra::Result<User> {
    let db = ctx.get::<Database>();
    Validator::new(&serde_json::json!({ "name": name }))
        .rule("name", "required|max:80")
        .validate()?;
    let mut user = User::find(&db, id).await?.ok_or_else(|| elyra::Error::command("no such user"))?;
    user.name = name;
    user.save(&db).await?;
    Ok(user)
}

Calling from the frontend

import { invoke } from "@elyra/runtime";
const greeting = await invoke<string>("greet", "world");

// or the typed facade after `rata codegen`:
import { api } from "./bindings";
const greeting = await api.greet("world");

Calling from Rust

The function is still there, as run on the command, with its own types:

#[command]
async fn add(_ctx: Ctx, a: i64, b: i64) -> i64 { a + b }

#[command]
async fn add_twice(ctx: Ctx, a: i64) -> i64 {
    let once = add::run(ctx.clone(), a, a).await;
    add::run(ctx, once, once).await
}

run has the function's signature, async or not, its doc comment and its attributes (an #[allow(..)] on the command applies to it). It's the function, not the pipeline: no middleware, no can = "…" check, no window scope, no rate limit. Those limit what the webview may reach; Rust is the app calling itself. Validation in the body runs either way. To test the pipeline, use TestApp::invoke.

Live commands (live)

#[command(live)] lets the frontend subscribe to a command's result: Elyra records the tables it reads, re-runs it when one of them is written, and pushes the new result to the windows watching — see live queries. A live command must only read; a write inside one fails. In tests:

let mut count = app.live::<i64>("posts_count", ()).await;
app.invoke_ok::<i64>("posts_store", ("hello",)).await;
assert_eq!(*count.next().await, 1);

On the frontend, codegen gives each live command a store — see live queries.

Gating a command (can = "…")

Capability::Commands opens all of /__cmd/* in one grant, so a script that gets into the page reaches every command you register. Mark the ones that shouldn't be in that blanket:

#[command(can = "posts.delete")]
async fn delete_post(ctx: Ctx, id: i64) -> elyra::Result<()> {
    // … unchanged
}

The command is now denied to the frontend until the app grants the ability:

App::new()
    .commands(commands![delete_post])
    .allow_ability("posts.delete")   // or "posts.*"

Without the grant the call answers 403 and names what's missing. Rust-side callers — providers, queue jobs, TestApp — are unaffected. See security.

Where its record is

link says where the record a command touches lives in the app. When the app's assistant runs the command, its step in the panel becomes a link there (RFC 0013).

#[command(live, can = "customers.view", link = "/customers/{id}")]
async fn customers_show(ctx: Ctx, id: i64) -> elyra::Result<Customer> { … }

#[command(can = "customers.create", link = "/customers/{result.id}")]
async fn customers_store(ctx: Ctx, input: CustomerInput) -> elyra::Result<Customer> { … }
  • It's an app path, starting with /. {name} is an argument, and {result.field} a field of what the command returned. A placeholder that's neither, a missing / or a space is a compile error.
  • The values are URL-encoded. A call whose value is missing, empty or not a string, number or boolean gets no link, and neither does a call that failed.
  • make:resource writes it on _index, _show, _store and _update.

Limitations (deliberate)

  • The macro assumes the first parameter is the Ctx.
  • No generics, no Option<Ctx>, no self receivers.
  • Numeric codegen: 64-bit integers render as number — see codegen.

Cancellation

A slow or long-running command can be cancelled from the frontend with invokeCancellable — the Rust task is aborted at its next .await. Cancelling rejects the result promise with a CommandError.

import { invokeCancellable } from "@elyra/runtime";

const job = invokeCancellable<Report>("build_report", opts);
onDestroy(() => job.cancel());     // stop it when the component unmounts
const report = await job.result;

The generated api.* uses the plain (non-cancellable) invoke; reach for invokeCancellable when you specifically need to abort. Because abortion happens at await points, make cancellable commands .await periodically (I/O, chunks) for prompt cancellation.

Progress

There's no special progress channel — emit on the event bus, which is exactly what it's for:

#[command]
async fn build_report(ctx: Ctx) -> Report {
    let bus = ctx.get::<EventBus>();
    for (i, step) in steps.iter().enumerate() {
        let pct = ((i as f64 / steps.len() as f64) * 100.0) as u8;
        let _ = bus.emit("report:progress", &pct);
        // … do the step …
    }
    report
}
import { channel, invokeCancellable } from "@elyra/runtime";

let pct = 0;
const off = channel<number>("report:progress").subscribe((p) => { if (p != null) pct = p; });
const job = invokeCancellable<Report>("build_report");
onDestroy(() => { job.cancel(); off(); });
const report = await job.result;

Errors on the wire

A failed command responds with x-elyra-status: error and an x-elyra-error-kind telling the frontend what kind of failure it was:

Kind Meaning Frontend type
command the command's own Err (message verbatim) CommandError
validation a ValidationErrors bag ValidationError (parsed errors)
panic the handler panicked CommandError (kind panic)
cancelled aborted via invokeCancellable().cancel() CommandError
forbidden missing IPC token or capability ForbiddenError
bad-request body too large / nested too deep CommandError
unauthenticated, denied, not-found, conflict, offline, queued, … a Laravel backend's answer, or a write saved offline CommandError with that kind
your own Err(Error::with_kind("archived", "This customer is archived")) CommandError with that kind

A command picks a kind with elyra::Error::with_kind(kind, message), and the frontend reads it as CommandError.kind. The Laravel backend uses these:

Kind When
offline no answer from the server (connection, DNS, TLS, timeout)
unauthenticated the server says the token is gone (401, 419)
denied the server's policy said no (403)
not-found 404
too-many-requests 429
server 5xx

They reach the frontend from a command and from a live query's re-run alike.

A panicking command answers with an error instead of hanging the caller: every command runs on its own task, so a panic (including a missing container binding, which panics by design) becomes a 500 with the panic message, and is logged at error level.

Input limits

Request bodies are capped at 16 MiB (App::max_request_body) and MessagePack nested deeper than 64 levels is rejected before it reaches serde — a ~10 KB body of nested arrays would otherwise overflow the stack. See security.

Related