命令行 × Agent

AnyLUT 命令行工具。

anylut 在不改动原文件的前提下编辑照片。它读取 RAW、JPEG 或 HEIC,应用一个小而无损的配方文件,再渲染出预览图或最终的 JPEG、PNG。它为本地 agent 和脚本设计,完全在你的 Mac 上运行。

Apple Silicon · macOS 14+ · 已签名并公证

安装

一条 Homebrew 命令。

需要 Apple Silicon Mac,系统为 macOS 14(Sonoma)或更高版本。升级用 brew upgrade anylut。

brew install hisea/anylut/anylut

Homebrew 会要求你信任非官方 tap。上面的命令写出了完整的公式名,只信任这一个公式。如果想用短名安装,请先显式信任:

brew tap hisea/anylut
brew trust --formula hisea/anylut/anylut
brew install anylut
Agent

让你的 agent 学会使用它。

skill anylut 让 agent 先运行 anylut guide,所以说明始终与已安装的版本一致。请先安装工具。

Agent安装
Claude Codeclaude plugin marketplace add hisea/anylut-cli
claude plugin install anylut@anylut
Codexcodex plugin marketplace add hisea/anylut-cli
codex plugin add anylut@anylut
pipi install git:github.com/hisea/anylut-cli
ompomp plugin marketplace add hisea/anylut-cli
omp plugin install anylut@anylut
opencode

复制 skill 文件夹:

git clone https://github.com/hisea/anylut-cli /tmp/anylut-cli
mkdir -p ~/.config/opencode/skills
cp -R /tmp/anylut-cli/skills/anylut ~/.config/opencode/skills/

其他能读取 SKILL.md 的 agent,可以直接使用仓库里的 skills/anylut/ 文件夹。

MCP

也可以作为 MCP 服务运行。

anylut mcp 通过 stdio 把相同的命令作为工具提供出来。预览会作为图片返回,模型可以看到每次编辑的效果。工具的文件路径必须是绝对路径。从 Dock 启动的应用看不到 shell 的 PATH,所以请使用工具的完整路径(/opt/homebrew/bin/anylut)。

客户端配置
Claude Desktop

在 claude_desktop_config.json 中加入:

{"mcpServers":{"anylut":{"command":"/opt/homebrew/bin/anylut","args":["mcp"]}}}
Claude Codeclaude mcp add anylut -- anylut mcp
Cherry Studio设置 → MCP 服务器 → 添加。类型选 STDIO,命令填 /opt/homebrew/bin/anylut,参数填 mcp。
Codex (GPT)codex mcp add anylut -- anylut mcp

ChatGPT(网页版和桌面版)只连接通过 HTTPS 提供的远程 MCP 服务,不能启动本地程序,所以 GPT 模型请使用 Codex。

快速开始

从照片到成品,六条命令。

补丁(patch)是一个小的 JSON 文件,可用 --patch-file - 从 stdin 读取。set 给出绝对值,add 是相对当前值的变化。超出范围的值会报错,工具不会截断它。

anylut capabilities --json                        # 列出所有可写参数及其范围
anylut inspect IMG.ARW --json
anylut recipe new --source IMG.ARW --output edit.anylut.json
anylut patch edit.anylut.json --patch-file adjust.json --output edit-v1.anylut.json --json
anylut render IMG.ARW --recipe edit-v1.anylut.json --preview --output preview.jpg --json
anylut render IMG.ARW --recipe edit-v1.anylut.json --full-resolution --output final.jpg --json
{ "patchVersion": 1, "operations": [
  { "op": "set", "path": "light.exposure", "value": 0.35 },
  { "op": "add", "path": "color.temperature", "value": 6 },
  { "op": "set", "path": "hsl.orange.saturation", "value": -5 } ] }
保证

为读取输出的工具而设计。

JSON 输出
使用 --json 时,每个命令只输出一行、一个 JSON 对象。出错时是一个带稳定 code 的 {"ok":false,"error":{…}} 对象。
退出码
0 成功 · 2 用法错误 · 3 不支持的文件 · 4 校验失败 · 5 解码失败 · 6 渲染失败 · 7 写入失败。
安全写入
输出文件以原子方式写入。除非传入 --overwrite,否则不会覆盖已有文件。
严格输入
未知、缺失或重复的键,以及超出范围的值,都会被拒绝,不会被自动修复。
仅在本地
渲染完全在你的 Mac 上进行,不会上传任何内容。
限制
含有裁剪、旋转、翻转或拉直的配方会被拒绝,而不是忽略这些编辑去渲染。RAW 支持取决于你的 macOS 自带的 RAW 解码器。