調用與構建 / CLI 命令全覽
CLI 命令全覽
全部命令
aero run <file.aero | 包目錄> [-O0|-O1|-O2|-O3] [--target <triple>] 編譯並運行
aero build [file.aero | dir] [-O<n>] [--target] [--shared] [--pyext] [--cpp] 編譯
aero new <name> 生成包骨架(Aero.toml + src/main.aero)
aero check <file|dir> 只編譯檢查,不運行、不產文件
aero test [file.aero] 跑測試(默認 tests/ 下全部 .aero)
aero bench <file.aero> [--iterations N] [--samples N] 基準測試
aero fmt <file.aero> [--check] [--width N] [--indent N] 格式化
aero clippy <file.aero> 靜態 lint(100+ 規則)
aero cov <file.aero> 語句覆蓋率
aero --lsp | aero lsp 起 LSP 伺服器
aero lock [dir] 解析依賴並(重新)生成 Aero.lock
aero install [name] 從 GitHub 生態安裝包
aero publish <dir> 發佈庫包到 registry
aero ls 列出 registry 裏的包與版本
aero registry 打印 registry 位置常用組合
# 編譯並運行
aero run hello.aero
# 產出獨立可執行文件
aero build hello.aero
# 產出共享庫 .dll/.so/.dylib
aero build lib.aero --shared
# 產出 Python 擴展 .pyd/.so
aero build kernel.aero --pyext
# 產出 C++ 綁定(共享庫 + .hpp)
aero build lib.aero --cpp優化級別
-O0 / -O1 / -O2 / -O3,默認 O2。
環境變量
LLVM_SYS_221_PREFIX | LLVM 22 安裝前綴 |
AERO_LINKER | 自定義鏈接器(交叉編譯用) |
AERO_COV | 覆蓋率插樁開關 |
PYTHON_HOME | Python 定位 |
ANDROID_NDK_HOME | NDK 定位 |