text-code-edit

Edit existing React/TSX/JSX source code; supports multi-round iteration and chained editing. When --source_code_url is omitted, the most recent code_url is automatically retrieved from context.

meitu text-code-edit

Usage Examples

# Scenario 1: Basic code editing (required parameters only)
meitu text-code-edit \
  --prompt "increase the Hero title font size and add a product image placeholder on the right" \
  --source_code_url https://example.com/page.tsx \
  --json

# Scenario 2: Reference image for assisted editing
meitu text-code-edit \
  --prompt "apply the color scheme from the reference image" \
  --source_code_url https://example.com/page.tsx \
  --image_list ./design_ref.jpg \
  --json

# Scenario 3: Specify model + download results
meitu text-code-edit \
  --prompt "optimize responsive layout with mobile adaptation" \
  --source_code_url https://example.com/page.tsx \
  --model pretzel_pro \
  --prompt_name default \
  --json \
  --download-dir ./output

Parameters

ParameterRequiredDescription
--promptYesType: string; description of the desired edit
--source_code_urlYesType: string; source code URL (when omitted, the most recent code_url is automatically retrieved from context)
--image_listNoType: string[]; optional reference image(s)
--video_listNoType: string[]; optional reference video(s)
--modelNoType: string; default: pretzel_pro; options: auto / pretzel_pro / pretzel_lite
--prompt_nameNoType: string; template name
--download-dirNoType: string; download result files to the specified local directory
--outputNoType: string[]; specify output file paths, mapped in order to data.result.urls
--jsonNoOutput results in JSON format for scripting or agent parsing