@elaraai/east-c-cli

中文文档
1.0.107发布于 2026/11/13BUSL-1.1ES Module零依赖构建来源已验证近 30 天下载 4030

Provides the east-c bin. A tiny launcher resolves the native binary for your platform from the matching per-platform package (@elaraai/east-c-cli-), pulled in via optional dependencies.

原始使用文档
文档目录11 节
  1. Build
  2. Usage
  3. Running a unit ( exec )
  4. How inputs are read
  5. Exiting with the parent
  6. Profiling
  7. Claude Code plugin
  8. License
  9. Ecosystem
  10. Links
  11. About Elara

east-c-cli

Command-line runner for east-c — execute compiled East IR natively from the terminal

License

east-c-cli is the command-line entry point for the C runtime. It links against east-c (core) and east-c-std (standard platform) to execute East IR programs.

Build

Requires CMake 3.16+ and a C11 compiler.

make build    # From libs/east-c/
make test
make clean

See docs/conventions/MAKEFILE_TARGETS.md.

Usage

# Run a Beast2-encoded IR file
./build/packages/east-c-cli/east-c run program.beast2

# Run a JSON-encoded IR file
./build/packages/east-c-cli/east-c run program.json

# With arguments
./build/packages/east-c-cli/east-c run program.beast2 --input '"hello"'

The CLI loads the standard platform from east-c-std by default. Custom platform functions can be linked at build time.

Running a unit (exec)

east-c exec <unit.beast2> is the command e3 runs: the machine-facing twin of run. The unit file names the work — a program to run over its inputs, or the parts of an output to merge — with the platforms, the threads the runner may use, the output's kind (a value the program returns, or an array, set, dict or fold it emits into), and where to write the output and a typed result: the outcome (ok, or failed with the message and its source locations), the peak memory, and the time spent loading, compiling, executing and writing. Paths in a unit may be relative to its file, so a unit and the files it names replay wherever they are moved together. A run unit says how its inputs are read (decode, below). It exits 0 when the outcome is ok and 1 when the result records a failure; -v prints where the time went and the peak memory.

How inputs are read

A collection input opens lazily, whatever it weighs: an indexed beast2 file is mapped, and a read decodes only the segments it reaches — its size, a keyed read and the $.for loop decode a segment at a time, and an operation the pager cannot serve decodes the input whole, once, when it first needs it. A loop holds only the segment it walks. Keyed reads keep the segments they decode, up to 256 MiB of decoded weight per input (EAST_PAGED_CACHE_BYTES; 1 keeps one segment), and reads in key order keep about two. --decode whole decodes every input before the program runs instead, which suits a program that reads at random across more than that, or loops over an input more than once: lazily, a read beyond the segments the pager keeps decodes its segment again. exec reads the same choice from its unit's decode. A value that is not a collection, and a collection whose elements hold a Ref or a function, is decoded whole either way.

east-c run task.beast2 -i rows.beast2 --decode whole -o out.beast2

With -v the runner says how each input opened, and what reading it came to: the segments a lazy input decoded, or what an input decoded whole holds in memory — the growth in resident memory across its decode, beside the size it weighs on disk, since a nested collection decodes at many times that size. Reads that decode segments again are said to, with what decoding the input whole would do instead.

A collection input may also be a manifest directory, the form e3 stages a stored collection in: the input file holds a manifest, and each segment it names is a standalone blob in <file>.segments/<sha256>.beast2. It opens over those files — lazily, a read opening only the segments it reaches, or whole — and weighs its segments in the -v account.

Exiting with the parent

With --exit-with-parent on its command line (any command, anywhere among the arguments) the runner watches its stdin on a thread of its own and exits with status 1 as soon as a read returns end of file or fails. A parent that spawns the runner with a stdin pipe it never writes to — as e3 does — takes the runner down with it when it dies, even while the body is computing. Without the flag, stdin is left alone.

east-c run task.beast2 --exit-with-parent -o out.beast2

On Windows the watcher reads a synchronous pipe or an overlapped one. Hand it an overlapped pipe — FILE_FLAG_OVERLAPPED, or Node's stdio 'overlapped', as e3 does: a read pending on a synchronous pipe holds the pipe's file-object lock, so any other use of stdin in the runner would wait until the parent is gone.

Profiling

east-c run task.beast2 -i rows.beast2 --profile
east-c exec unit.beast2 --profile
EAST_PROFILE=1 EAST_PROFILE_INTERVAL=300 east-c exec unit.beast2

prints, after the work (and after a failure's error), every East function and platform function it called, by self time, with its call count, its total time, and where it is: the name of the Let it was bound to when the IR has one, its definition site, and — when that differs — the site of the first call that reached it, which is what tells apart helpers a builder lowered to calls at their call sites. A platform function is an entry of its own, named after it and placed by the call that reached it, so the time spent inside it is not its caller's self time. So is a lazily read input's decoding: each segment its reads decode, and its whole decode when an operation the pager cannot serve needs one, is a call of one entry named after the input as -v names it (input 1), placed by the first read that decoded. Keyed reads at random beyond the segments the pager keeps (EAST_PAGED_CACHE_BYTES), or a scan repeated, show there; the reading function's total time keeps those decodes, and its self time does not.

EAST_PROFILE set to anything but 0 profiles without the flag, which is how a task run by e3 is profiled: e3 hands its environment to the runner, and the report lands in the task's log. EAST_PROFILE_INTERVAL=N (seconds) also prints the profile so far every N seconds while the work runs, a call still under way counted with its time so far; an interval that is not a number of seconds is said and ignored. east-py's runner prints the same report (the profiler is libeast-c's). Off, profiling costs one branch per call.

The ir toolbox (issue #627) works on IR files without running them:

# The canonical form of an IR file: loc_ids stripped, variables/labels renamed in
# the TypeScript lowering's order, captures recomputed, recursive type ids renumbered
east-c ir normalize program.json -o canonical.json

# Normalize two IR files and report the first structural difference (exit 1) or
# "identical" (exit 0); --raw compares as-is
east-c ir diff program.json rebuilt.beast2

# json <-> beast2 with the source map intact
east-c ir convert program.json -o program.beast2

Claude Code plugin

The East ecosystem also ships a Claude Code plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the elaraai marketplace:

# Inside Claude Code
/plugin marketplace add elaraai/east-workspace
/plugin install east@elaraai
# From a terminal
claude plugin marketplace add elaraai/east-workspace
claude plugin install east@elaraai

License

Business Source License 1.1 — see LICENSE.md. Same terms as east-c core.

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/east-c-cli 共发布 104 个版本,首次发布于 2026/06/09;过去 12 个月发布了 104 个版本。最新版本附带 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 天前

其他发布通道:beta → 0.0.0。

关于 @elaraai/east-c-cli 的常见问题

@elaraai/east-c-cli 是什么?

Provides the east-c bin. A tiny launcher resolves the native binary for your platform from the matching per-platform package (@elaraai/east-c-cli-), pulled in via optional dependencies.

如何安装 @elaraai/east-c-cli?

在项目目录运行 npm install @elaraai/east-c-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 east-c,可以用 npx east-c 直接运行。

@elaraai/east-c-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/elaraai__east-c-cli 是否存在。

@elaraai/east-c-cli 支持 ESM 还是 CommonJS?

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

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

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

@elaraai/east-c-cli 可以商用吗?

@elaraai/east-c-cli 使用 BUSL-1.1 许可。声明的许可为 BUSL-1.1,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@elaraai/east-c-cli 的下载量有多少?

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

@elaraai/east-c-cli 还在维护吗?

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