代码编辑

对已有 React/TSX/JSX 源码进行编辑修改,支持多轮迭代和串联编辑。缺少 --source_code_url 时自动从上下文获取最近的 code_url。

meitu text-code-edit

使用示例

# 场景一:基础代码编辑(仅必填参数)
meitu text-code-edit \
  --prompt "把 Hero 标题字号加大,并在右侧增加一张产品图占位" \
  --source_code_url https://example.com/page.tsx \
  --json

# 场景二:附参考图辅助编辑
meitu text-code-edit \
  --prompt "调整为参考图中的配色方案" \
  --source_code_url https://example.com/page.tsx \
  --image_list ./design_ref.jpg \
  --json

# 场景三:指定模型 + 下载结果
meitu text-code-edit \
  --prompt "优化响应式布局,增加移动端适配" \
  --source_code_url https://example.com/page.tsx \
  --model pretzel_pro \
  --prompt_name default \
  --json \
  --download-dir ./output

参数说明

参数必需说明
--prompt类型:string;修改内容描述
--source_code_url类型:string;源码 URL(缺失时自动从上下文获取最近的 code_url)
--image_list类型:string[];可选参考图片
--video_list类型:string[];可选参考视频
--model类型:string;默认:pretzel_pro;可选:auto / pretzel_pro / pretzel_lite
--prompt_name类型:string;模板名称
--download-dir类型:string;将结果文件下载到指定本地目录
--output类型:string[];指定输出文件路径,按 data.result.urls 顺序映射
--json以 JSON 格式输出结果,便于脚本或 Agent 解析