CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Elixir CLI

$ elixir 官方出品 低风险
Elixir · 代码托管与研发协同 · Apache-2.0 · macos / linux / windows

面向 Erlang BEAM 虚拟机的官方 Elixir 运行时启动器(elixir)、编译器(elixirc)及配套 mix 构建工具。适合运行 .exs 脚本与 Mix 工程任务(mix test、mix compile),但 CLI 本身无原生 JSON 输出模式。

FCRS-1.0 综合评分
75 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install elixir
CLI vs MCP 选型建议 仅 CLI 可用

本地 BEAM 虚拟机运行时与 Mix 工程工具链,直接在磁盘上执行代码编译与测试。

Agent 友好度体检单

— 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 14 / 25

支持 elixir -e 与 NO_COLOR=1 非交互执行,但缺少原生 --json 诊断,且全新环境中 mix 可能提示安装 Hex/rebar3。

  • elixir -e executes expressions headlessly
  • Fresh mix invocations can prompt for Hex/rebar3 unless --force is used
安全与权限边界 20 / 25

本地运行为主,提供 mix format --check-formatted 等只读检查,仅 mix hex.publish 涉及远程发布。

  • Read-only format/compile checks available via mix flags
安装与运行摩擦 12 / 15

可通过 Homebrew、apt 或 mise/asdf 跨平台安装,但依赖对应版本的 Erlang/OTP。

  • Requires compatible Erlang/OTP runtime
能力覆盖与边际价值 12 / 15

BEAM 工程必备入口,内置 mix 统一管理编译、依赖、格式化与 ExUnit 测试。

  • Bundled mix handles compilation, dependencies, formatting, and ExUnit tests
维护与来源背书 9 / 10

由 Elixir 核心团队以 Apache-2.0 协议长期维护。

  • Official elixir-lang/elixir repository
文档与可验证性 8 / 10

HexDocs 文档极其详尽,mix help <task> 查询方便。

  • Structured hexdocs.pm reference and CLI --help

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件
凭证存储位置

运行时执行无需认证;仅在使用 mix hex.publish 发布包时会读取 ~/.hex/hex.config 中的加密密钥。

潜在副作用
只读查询 本地写入 远端写入
费用与配额提示

Apache-2.0 开源语言与运行时,完全免费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Elixir CLI (elixir) Agent Rules
- Always pass `-e` or a script path to `elixir`; never invoke `iex` in non-TTY agent shells.
- Use `mix test --warnings-as-errors` and `mix format --check-formatted` for deterministic project verification.

Agent 高频安全命令配方

只读查询(安全推荐)

查看 Elixir 与 Erlang/OTP 版本
elixir --version

不启动交互式终端,直接报告已安装的 Elixir 与 BEAM OTP 版本。

执行只读 Elixir 表达式
elixir -e "IO.puts(System.version())"

在 BEAM 虚拟机中求值单行表达式并立即退出。

受控写入与预演

启用严格告警运行 Mix 测试
mix test --warnings-as-errors

编译并运行项目测试套件,将任何编译告警视为失败。

核心优势

  • + 内置 mix 一次涵盖格式化校验、编译与快速 ExUnit 测试。
  • + elixir -e 与 elixir --version 可干净运行,无交互阻塞。

注意事项与踩坑点

  • ! 不装第三方 formatter 时无内置 --json 诊断或测试输出。
  • ! 全新容器首次运行 mix 可能因确认安装 hex 或 rebar3 而阻塞,需预先运行 mix local.hex --force。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI