@elaraai/east-node-cli

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

Command-line interface for running East IR programs with Node.js

原始使用文档
文档目录23 节
  1. Installation
  2. Usage
  3. Running Programs
  4. Running a unit ( exec )
  5. Exiting with the Parent
  6. Version Information
  7. Transpiling IR to TypeScript
  8. Exporting functions for another language
  9. CLI Reference
  10. east-node run
  11. east-node exec
  12. east-node transpile
  13. east-node export-functions
  14. east-node version
  15. Supported File Formats
  16. How Inputs Are Read
  17. Platform Packages
  18. Creating Platform Packages
  19. Claude Code plugin
  20. License
  21. Ecosystem
  22. Links
  23. About Elara

East Node CLI

Command-line interface for running East IR programs with Node.js

License Node Version

East Node CLI provides a command-line interface for executing compiled East IR programs using Node.js platform implementations.

Installation

# Install the CLI
npm install -g @elaraai/east-node-cli

# Install platform packages (required)
npm install @elaraai/east-node-std
npm install @elaraai/east-node-io  # if using I/O functions

Usage

Running Programs

# Run with standard platform
east-node run ./program.beast2 -p @elaraai/east-node-std

# Run with multiple platforms
east-node run ./db-query.beast2 \
    -p @elaraai/east-node-std \
    -p @elaraai/east-node-io

# Run with input files
east-node run ./transform.beast2 \
    -p @elaraai/east-node-std \
    -i input.json \
    -i config.east

# Run with output file
east-node run ./process.beast2 \
    -p @elaraai/east-node-std \
    -i input.beast2 \
    -o result.json

# Verbose mode
east-node run ./program.beast2 -p @elaraai/east-node-std -v

Running a unit (exec)

east-node 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, see How Inputs Are Read). 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.

Exiting with the Parent

With --exit-with-parent on its command line (run and exec) the runner watches its stdin from a worker thread, reading it through a socket on the worker's own event loop, and kills its own process as soon as stdin ends, closes or cannot be read. 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. The watcher never blocks in a read, so it never holds up the runner's own exit. The runner opens process.stdin before the watcher reads, so it keeps full use of its stdin over any pipe — on Windows a read pending on a synchronous pipe holds the pipe's file-object lock, and opening stdin after it (as the first import of node:process does) would otherwise wait until the parent is gone. Without the flag, stdin is left alone.

east-node run ./task.beast2 --exit-with-parent -p @elaraai/east-node-std -o out.beast2

Version Information

# Show CLI version
east-node version

# Show CLI and platform versions
east-node version -p @elaraai/east-node-std -p @elaraai/east-node-io

Transpiling IR to TypeScript

# Print an IR program as East.function builder source
east-node transpile ./program.beast2 -o program.ts

# Every IR file in a directory, plus the IR each printed module builds
# back — the round-trip check
east-node transpile ./ir/ -o ./ts/ --rebuild ./rebuilt/

The printed module imports @elaraai/east and rebuilds the same IR (equal under east-c ir normalize): the $-forms for statements, expression methods and East.value(..., T) constructions for values. Builtins the TypeScript surface has no spelling for print through East.builtin(...). east-py transpile is the python twin; the two printers and the cross-language sweep are described in docs/conventions/EAST_CODEGEN.md.

Exporting functions for another language

# Write a module's `eastFunctions` export as a function manifest that a python
# package (or another TypeScript package) imports with East.import_function /
# East.importFunction; -p names the platform packages implementing any
# platform calls the functions make
east-node export-functions dist/pricing.js -o pricing.functions.beast2 -p @elaraai/east-node-std

CLI Reference

east-node run

Execute an East IR program.

east-node run <ir_file> [options]

Arguments:
  ir_file                    Path to IR file (.beast2, .beast, .east, or .json)

Options:
  -p, --package <package>    Platform package to load (can be repeated)
  -i, --input <file>         Input data file (can be repeated)
  -o, --output <file>        Output file path for result
  --decode <mode>            How collection inputs are read: lazy (the default) or whole
  -v, --verbose              Enable verbose output
  --exit-with-parent         Exit as soon as stdin reaches end of file — for a parent
                             that holds a stdin pipe it never writes to
  -h, --help                 Display help

east-node exec

Execute a unit, the runner protocol (see Running a unit).

east-node exec <unit> [options]

Arguments:
  unit                       The unit file (.beast2); relative paths in it are relative to its directory

Options:
  -v, --verbose              Print each input's account, where the time went and the peak memory
  --exit-with-parent         Exit as soon as stdin reaches end of file

east-node transpile

Print an East IR program as TypeScript East.function builder source.

east-node transpile <input> [options]

Arguments:
  input                      Path to an IR file (.beast2, .beast, .east, or .json), or a directory of them

Options:
  -o, --output <path>        Write the module here (a directory when <input> is one; default: stdout)
  --name <name>              The module-level export bound to the rebuilt function (default: main)
  --import-from <specifier>  The module the printed source imports East from (default: @elaraai/east)
  --rebuild <path>           Import the printed module and write the IR it builds here
                             (.beast2 or .json; a directory in directory mode)

east-node export-functions

Write a module's eastFunctions export (name → East.function result) as a function manifest.

east-node export-functions <module> -o <file> [options]
east-node export-functions <module> --batch <file> [--name <name>] [--package-version <version>]

Arguments:
  module                       Path to the built module exporting `eastFunctions`

Options:
  -o, --output <file>          The manifest to write (.beast2)
  --batch <file>               Write several manifests from one import of the module: a beast2
                               batch (FunctionExportBatchType), each entry its own output, -p
                               packages and --only functions; the entries run in order, the first
                               that fails ending the export
  -p, --package <package...>   Platform packages implementing the functions' platform calls
                               (every dependency must be provided by one; recorded as its provider)
  --name <name>                The package name importers use (default: the module file's stem)
  --package-version <version>  The version recorded in the manifest (default: 0.0.0)
  --only <name...>             Export only these functions of `eastFunctions` (default: all)

east-node version

Show version information.

east-node version [options]

Options:
  -p, --package <package>    Platform package to check (can be repeated)

Supported File Formats

ExtensionFormat
.beast2, .beastBinary East format
.eastText East format
.jsonJSON format

How Inputs Are Read

Indexed .beast2 collection inputs (Array/Set/Dict) open lazily, whatever they weigh: size, iteration and keyed reads are served from the blob's segment index with O(segment) decoded memory, and any other operation transparently decodes the whole value once. 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, and east-c and east-py take it alike. Semantics are identical either way: it is a memory and time choice, not a behavior toggle.

east-node run ./lookup.beast2 -p @elaraai/east-node-std -i table.beast2 --decode whole

With -v the runner says how each input opened, what a lazy input's reads came to, and what an input decoded whole holds in memory — the growth in resident memory across its decode, beside what it weighs on disk, since a nested collection decodes at many times that. A lazy input's reads come to the segments they decoded of its segments and the fences they probed, and the bytes they read; when an operation the pager cannot serve decoded it whole, to the resident memory that added; and when they decoded segments again, to how many decodes of how many segments, since decoding the input whole would decode each once. east-c and east-py say each in the same words, but for the bytes read.

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.

Inputs open frozen — a frozen value cannot be mutated, and a frozen collection compares by value — so a lazy open serves every element shape but one that carries a Ref or a function, whose identity a fresh decode of each segment would lose; that shape decodes whole. The same rule applies in the east-c and east-py runners.

Platform Packages

Platform packages provide the runtime implementations for East platform functions:

Creating Platform Packages

Any npm package can provide platform functions by following this convention:

  1. Export a ./platform subpath that default-exports PlatformFunction[]
  2. Export ./package.json for version discovery

See the design document for details.

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

Dual-licensed:

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. Distributed via npm (launcher + per-platform optional dependencies) and as tarballs on each GitHub Release.

    • @elaraai/east-c-cli: npm launcher — installs the matching native binary as an optional dependency
    • east-c: Core runtime — type system, IR interpreter, 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.


Developed by Elara AI Pty Ltd

版本与发布记录

@elaraai/east-node-cli 共发布 144 个版本,首次发布于 2025/12/11;过去 12 个月发布了 144 个版本。最新版本附带 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.1-beta.39。

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

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

Command-line interface for running East IR programs with Node.js

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

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

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

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

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

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

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

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

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

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

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

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

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

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