@elaraai/e3-ui-cli

中文文档
1.0.107发布于 2026/11/13AGPL-3.0-or-laterTypeScriptES Module构建来源已验证近 30 天下载 3415

Browse an e3 repository in the terminal, and render east-ui components to PNG

原始使用文档
文档目录15 节
  1. Features
  2. Installation
  3. Terminal UI
  4. Screenshots
  5. Headless servers & CI
  6. Sources
  7. Programmatic API
  8. Development
  9. Query plans: one unit against pieces
  10. Query plans at scale
  11. Documentation
  12. License
  13. Ecosystem
  14. Links
  15. About Elara

e3-ui CLI

Browse an e3 repository in the terminal, and render east-ui / e3-ui components to PNG.

License Node Version

e3-ui CLI is two things in one command. With no subcommand it is a full-screen terminal UI over an e3 repository — local or remote — showing a workspace's task and dataset status, its dataflow runs (start and cancel them, and watch the budget they run under), every task's output as a lazily paged value tree, its logs and run history, editable inputs, and its records — their rows, through any of their indexes, and their commits. With shot / shots it renders East UI components — East functions returning a UIComponentType — to PNG images using headless Chromium, for automating UI/UX reviews and generating screenshots. The East→React renderer is pre-bundled into the package; the component is injected as data at runtime, so the only runtime dependency of the screenshots is the browser engine, and the terminal UI never needs one.

Features

  • Terminal UI (e3-ui [repo] [workspace]): the workspace dashboard — and, while a deploy runs, its file sources and records at their steps — /run and /stop with a live event feed and the scheduler (the cores and memory in use, units waiting for room and requeued, each task's peak memory), task views (a paged value tree with /find and /goto, stdout and stderr with tail-follow, the run history, a ui() task's manifest), editable inputs with a commit bar and conflict detection, records (a read-only view of their rows, through any of their indexes, and their commits), a command box with completion, vim-style keys and the mouse, remote repositories over the same credentials as e3 auth.
  • Component screenshots: render a .ts/.tsx source (--from-source) or serialized .beast2/.json IR (--from-ir) to a PNG.
  • Live task screenshots: render a deployed e3 UI task's output with real, already-computed workspace data (--from-task).
  • Self-contained: the renderer (React + Chakra UI v3 + the full component set) is pre-bundled; no app server or build step at use time.
  • Consistent with e3-cli: extension-based format detection with a --from override, -o/--output, and esbuild TypeScript loading.

Installation

npm install -g @elaraai/e3-ui-cli   # small — downloads no browser
e3-ui ./my-repo                     # the terminal UI needs nothing else
e3-ui install-browser               # for screenshots: fetch the version-matched headless Chromium once

Terminal UI

e3-ui                                    # $E3_REPO, then the current directory
e3-ui ./my-repo main                     # a workspace's dashboard
e3-ui ./my-repo main --task forecast     # straight to a task (--input <name> for an input)
e3-ui https://e3.example.com/repos/demo  # remote — after: e3-ui auth login https://e3.example.com
e3-ui https://e3.example.com             # a bare origin: the repositories list
e3-ui --no-mouse --ascii ./my-repo       # keyboard only, box-drawing off (also E3_UI_ASCII=1)
e3-ui -j 8 --memory 16G ./my-repo        # the embedded server's budget, as for e3 dataflow run

A local repository is served by an embedded @elaraai/e3-api-server for the session, whose runs go under the budget -j / --memory set (default: E3_JOBS / E3_MEMORY, else the machine's); a remote one is reached with the token e3-ui auth login saved (the same device flow and ~/.e3/credentials.json store as e3 auth, so either login serves both). Everything is one screen at a time — repositories, workspaces, a workspace's dashboard, a task (1 Output · 2 Stdout · 3 Stderr · 4 Runs, plus 5 Reads for a ui() task), an input, a record (1 State · 2 History) — with a command box along the bottom:

TypeEffect
/task <name> · /input <name> · /record <name> · /workspace <name> · /repo <path|url>open things; plain text without / fuzzy-jumps to any of them
/run [--force | --force-task <task>…] [--filter <task>] · /stopstart / cancel the dataflow (r / x prefill them): --force re-runs every task, --force-task the tasks it names, --filter one task by its exact name with the tasks it depends on; the header pill and the execution panel follow it live, with the cores and memory the server's budget holds
/find <key> · /goto <row|N%> · /save [file]in a value tree: exact "key", prefix, or struct-key fields a|b; jump; write the .beast2 bytes
/index <name> · /index primaryin a record: page through one of its indexes (/find then searches the index's key), or its rows again
e a x t · ⏎ APPLY · esc DISCARDin an input: edit a leaf, add, remove, tag / set; the commit bar sums the pending changes
?help for the page you are on; q quits, esc goes back

Keys are vim-friendly (j k h l, gg G, ^u ^d), the mouse scrolls, selects and drags the scrollbar, and the terminal is restored on every exit path. Without a TTY on both ends (e3-ui | cat, CI) the UI refuses with exit 1 and points at e3 workspace status / e3 dataset get instead. State (the last repository and workspace, each value tree's expand-set) lives in $XDG_STATE_HOME/e3-ui/state.json (E3_UI_STATE overrides; mode 0600); E3_UI_DEBUG=1 writes a debug.log beside it. Below 60×16 the app refuses; narrower terminals get tighter tables. The design and its mocks are in docs/tui/DESIGN_TUI.md.

Screenshots

# A .tsx exporting an East function returning a UIComponentType:
e3-ui shot --from-source ./dashboard.tsx -o dashboard.png

# Pick one export, set a viewport, also emit standalone HTML:
e3-ui shot --from-source ./widgets.tsx --export statCard --viewport 800x600 --html

# Serialized component IR (e.g. produced by an e3 export):
e3-ui shot --from-ir ./component.beast2 -o component.png

# A live e3 UI task's rendered output (dataflow must have already run):
e3-ui shot --from-task main.dashboard --repo ./my-repo -o dashboard.png

The CLI depends on playwright-core (no install-time browser download). e3-ui install-browser fetches the chromium-headless-shell build (~100 MB lighter than full Chromium, no X11/D-Bus libraries) into the shared playwright cache, version-matched to the CLI. On a fresh Linux server, add the OS libraries in the same step:

sudo e3-ui install-browser --with-deps   # Linux only; Windows/macOS need no system libraries

If the CLI already finds a system-installed Chrome/Chromium/Edge, install-browser is optional — the launch order is:

  1. E3_UI_CHROMIUM_PATH (or PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH) — an explicit executable wins.
  2. The playwright-managed cache (what install-browser fills; honors PLAYWRIGHT_BROWSERS_PATH).
  3. A system Chrome / Chromium / Edge at the standard per-OS locations. Ubuntu's snap chromium is detected and skipped — its confinement breaks automation; use Google Chrome's .deb or install-browser instead.

Under the hood the CLI starts a throwaway local web server for its prebuilt renderer, launches headless Chromium at it, injects your component, and screenshots the result. Chromium runs sandbox-off (playwright's default) — appropriate for rendering trusted local components, and why running as root on a server just works.

Headless servers & CI

e3-ui doctor   # diagnoses the browser setup: env overrides, launch cascade, remediation
  • Share one browser cache across users/agents with PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers (set it for both install-browser and shot).
  • Reinstalling/upgrading the CLI can move to a new browser revision — if shot reports a missing executable, re-run e3-ui install-browser.
  • Docker: mcr.microsoft.com/playwright images work out of the box, or add e3-ui install-browser --with-deps to your own image.

Sources

One screenshot verb, one source per run (mirroring e3-cli's --from-zip / --from-source):

SourceDescription
--from-source <file>A .ts/.tsx component source. Static and State-only components render with no backend. Runs the file and its imports as Node code (like ts-node) — only point it at code you trust.
--from-ir <file>Serialized component IR (.beast2/.json); - reads from stdin.
--from-task <ws.task> --repo <repo>A live e3 UI task's output with real bound data (via @elaraai/e3-api-client). The workspace dataflow must have already produced the task output.

e3-ui shot --help lists all flags (--export, --output, --html, --viewport, --dpr, --full-page, --element, --wait, --timeout, --storage-key).

--from-source also accepts a file exporting an e3 ui() task (e.g. a create-e3 --ui scaffold's src/ui/index.tsx) — the task's stored component function is rendered. Tasks with compute-time inputs can't render standalone; use --from-task against a deployed workspace for those.

Programmatic API

import { renderToPng } from "@elaraai/e3-ui-cli";

await renderToPng({
    input: { path: "./dashboard.tsx" },
    output: "dashboard.png",
});

Development

make build, make test, make lint from this directory. See MAKEFILE_TARGETS.md for the full target list. The browser app under app/ is bundled into dist/app by scripts/build-app.mjs as the second half of make build. The terminal UI lives under src/tui/ (an Ink app over a reducer store; every view has a frame spec against an in-memory API fake); E3_UI_INTEGRATION=1 make test also runs the integration smoke over a real embedded server and a repository seeded at test time, the query builder's plans against a real e3 on every runner it finds — east-node, and east-c when it is on PATH (src/query-plans.spec.ts) — and their equivalence (src/query-equivalence.spec.ts, below).

Query plans: one unit against pieces

src/query-equivalence.spec.ts holds that a plan changes what a query costs, never its answer (#942). Every query of east's corpus that checks over the shared fixture's root as an e3 root, and every question of the benchmark, that the planner splits runs as one one-shot call and as a split call over many small pieces (E3_TEST_PIECE_BYTES): the answers are byte-equal, Floats within rounding, and on east-node, east-c and east-py, at -j 1 and -j 4, every piece and merge writes the same bytes. The data is the fixture scaled so each collection is several pieces, and the benchmark's generator at a small size. It runs on every runner it finds, so put this tree's east-c and east-py first on PATH — a runner from another release need not speak this tree's unit protocol. e3 looks a runner up in every node_modules/.bin and the first .venv above the repository and the working directory before PATH, so a checkout's own node_modules/.bin/east-c, above a worktree inside it, runs ahead of PATH's: both specs name the file e3 runs for each runner, and refuse one that is not a build of this tree.

cmake -S ../../../east-c -B ../../../east-c/build -DCMAKE_BUILD_TYPE=Release
cmake --build ../../../east-c/build --target east-c-cli -j
(cd ../../../east-py && uv venv && uv pip install scikit-build-core cython numpy setuptools ninja \
  && CMAKE_GENERATOR=Ninja uv sync --all-packages --no-build-isolation --reinstall-package elaraai-east-py)
mkdir -p /tmp/east-py-bin && ln -sf "$PWD/../../../east-py/.venv/bin/east-py" /tmp/east-py-bin/east-py
export PATH="$PWD/../../../east-c/build/packages/east-c-cli:/tmp/east-py-bin:$PWD/node_modules/.bin:$PATH"

npm run build
E3_UI_INTEGRATION=1 node --enable-source-maps --test-reporter=spec --test dist/query-equivalence.spec.js

Query plans at scale

src/query-scale.spec.ts is the benchmark of the query builder's split calls (#941, #1093, #942), run by hand: make test and CI skip it. It writes orders of the shared query fixture's types, seeded, with 100,000 customers and a shipment for each shipped order; computes each benchmark query's answer from the generator as it writes them; takes them into a repository; and runs each query as the builder plans it, every dataset weighed by e3's status, its stored bytes and rows — a split call on east-c, or for the join of the orders with their shipments, both larger than a piece, a re-keyed join's two — in this process through e3-core, with a server's ceilings raised and every execution forgotten first, holding every answer to that oracle. It reports each query's time, the time e3 took to plan the pieces and to run its units, the pieces' work per order per core, the CPU it and its runners used per order, each piece's peak and the load the run started under; a re-keyed join's row is both its calls'. Beside them it reports the path the planner picks for each query by its estimates (#1143), with the budget's cores to run pieces on, and both paths' estimated and measured times.

# east-c built Release from this tree, first on PATH — never the -O0 `make build`
cmake -S ../../../east-c -B ../../../east-c/build-release -DCMAKE_BUILD_TYPE=Release
cmake --build ../../../east-c/build-release --target east-c-cli -j
export PATH="$PWD/../../../east-c/build-release/packages/east-c-cli:$PATH"

make build
E3_QUERY_SCALE=1 E3_QUERY_SCALE_SIZES=1g,4g E3_QUERY_SCALE_DIR=/var/tmp/e3-query-scale \
  node --test-reporter=spec --test dist/query-scale.spec.js
VariableDefault
E3_QUERY_SCALE—1 runs it
E3_QUERY_SCALE_SIZES100m100m, 1g, 4g, 16g — 2.9, 29, 116 and 463 million orders, about 36 B each stored — or a number of orders, comma-separated
E3_QUERY_SCALE_DIR$TMPDIR/e3-query-scalethe data, its repositories and the report, kept between runs: put it on a disk, since 16g takes 17 GB of orders and 1.1 GB of shipments — a shipment's carrier and days follow from its order's id, so they store in under 3 B an order — and as much again in its repository
E3_QUERY_SCALE_QUERIESallq1 the sum, q2 four totals, q3 revenue by region (the customers read whole), q4 the distinct customer ids, q5 a reduce by customer, q6 the ids of the largest 0.1%, q6t the same sorted, top 100 (the sort's first rows kept in the pieces), q7 revenue by carrier, the shipments joined (re-keyed)
E3_QUERY_SCALE_RUNS1cold runs of each query
E3_QUERY_SCALE_ONE_SHOT—1 also runs each query as the one-shot call the builder would make, within E3_QUERY_SCALE_ONE_SHOT_MS (120 000), and holds each pick to the faster path, or to within 20% of it (#1143)
E3_QUERY_SCALE_NOTE—a line the report heads its tables with: the machine, say

The report names the file e3 runs for east-c and the version it gives. It must be the first east-c on PATH: e3 looks first in every node_modules/.bin and the first .venv above the data's directory and the working directory, and the run refuses to start when one holds another east-c, which it would run instead — so run it from a directory with none above it, as /var/tmp. The budget is e3's own, E3_JOBS and E3_MEMORY or what the process may use. Each table is printed and appended to report.md in the data directory, with the rows in report.jsonl. Times move with what else the machine runs: the report names the load each call started under, so run it on a quiet machine and compare runs made back to back; the CPU per order (Linux, from /proc) moves least, since a runner waiting for a core uses none. Under a cgroup memory limit, which counts the file cache and the writes in flight, a call that writes a large intermediate runs slower — the re-keyed join at 16 GB took 541 s in a 5 GiB scope and 312 s outside it (#1093) — so run it outside one.

Documentation

License

Dual-licensed under AGPL-3.0 and a commercial license. See LICENSE.md.

Ecosystem

  • East: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.

    • @elaraai/east: Core language SDK with type system, expressions, and reference JS compiler
  • East Node: Node.js platform functions for I/O, databases, and system operations.

  • East C: C11 native runtime for executing East IR. Tarballed for linux-x64 and linux-arm64, attached to each GitHub Release.

    • east-c: Core runtime — type system, IR interpreter, 200+ builtins, serialization (Beast2, JSON, CSV, East text)
    • east-c-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-c-cli: CLI for running East IR programs natively
  • East Python: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.

    • east-py: Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
    • east-py-std: Console, FileSystem, Fetch, Crypto, Time, Path, Random
    • east-py-io: SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
    • east-py-cli: CLI for running East IR programs in Python
    • east-py-datascience (PyPI) + @elaraai/east-py-datascience (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
  • East UI: Typed UI component definitions and React renderer, plus VS Code preview.

  • e3 — East Execution Engine: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.

About Elara

East is developed by Elara AI Pty Ltd, an AI-powered platform that creates economic digital twins of businesses that optimize performance. Elara combines business objectives, decisions and data to help organizations make data-driven decisions across operations, purchasing, sales and customer engagement, and project and investment planning. East powers the computational layer of Elara solutions, enabling the expression of complex business logic and data in a simple, type-safe and portable language.


Developed by Elara AI Pty Ltd.

版本与发布记录

@elaraai/e3-ui-cli 共发布 80 个版本,首次发布于 2026/07/02;过去 12 个月发布了 80 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.107latest2026/11/13今天
1.0.1062026/11/094 天前
1.0.1052026/11/085 天前
1.0.1042026/11/067 天前
1.0.1032026/11/049 天前
1.0.1022026/11/0310 天前

关于 @elaraai/e3-ui-cli 的常见问题

@elaraai/e3-ui-cli 是什么?

Browse an e3 repository in the terminal, and render east-ui components to PNG

如何安装 @elaraai/e3-ui-cli?

在项目目录运行 npm install @elaraai/e3-ui-cli,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@elaraai/east(1.0.107)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 e3-ui,可以用 npx e3-ui 直接运行。

@elaraai/e3-ui-cli 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elaraai/e3-ui-cli 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@elaraai/e3-ui-cli 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.2.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@elaraai/e3-ui-cli 可以商用吗?

@elaraai/e3-ui-cli 使用 AGPL-3.0-or-later 许可。最严格的 Copyleft:除分发外,通过网络向用户提供基于它的服务也需要开源对应源码。闭源 SaaS 使用前务必评估。以上为概括,不构成法律意见,请以许可原文为准。

@elaraai/e3-ui-cli 的下载量有多少?

根据 npm 官方下载统计,@elaraai/e3-ui-cli 在 2026/10/13 – 2026/11/11 这 30 天内被下载 3,415 次,日均约 114 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elaraai/e3-ui-cli 还在维护吗?

最新版本 1.0.107 发布于 2026/11/13(今天);至今共发布 80 个版本,其中过去 12 个月发布了 80 个;首次发布于 2026/07/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。