/codex-image

Tạo ảnh bằng Codex CLI theo prompt mô tả

Arg: <mô tả ảnh cần tạo> Tools: Bash

Cài command này

Chạy trong terminal, sau đó restart Claude Code.

curl -fsSL https://raw.githubusercontent.com/kaiitc/helloai-kit/main/install.sh | bash -s -- command codex-image

Paste prompt dưới vào Claude Code / Codex CLI chat, AI sẽ chạy cài giúp.

Cài giúp mình command "codex-image" từ HelloAI Kit nhé. Chạy trong terminal:

curl -fsSL https://raw.githubusercontent.com/kaiitc/helloai-kit/main/install.sh | bash -s -- command codex-image

Xong check file ~/.claude/commands/codex-image.md có chưa rồi báo lại.

View source on GitHub →

Nhiệm vụ

Người dùng muốn tạo ảnh bằng Codex CLI với prompt sau:

$ARGUMENTS

Cách chạy

  1. Nếu $ARGUMENTS trống, hỏi user prompt ảnh trước, sau đó tiếp tục.
  2. Gọi Codex CLI để sinh ảnh:
codex exec "Generate an image based on this description and save to the current working directory with a descriptive kebab-case filename: $ARGUMENTS"
  1. Sau khi codex chạy xong, kiểm tra file ảnh mới sinh trong working directory (ls -lt *.png *.jpg *.jpeg *.webp 2>/dev/null | head -5).
  2. Nếu có ảnh: dùng SendUserFile gửi ảnh cho user với caption ngắn về prompt.
  3. Nếu codex không có khả năng sinh ảnh (không có tool image gen được config), báo user rõ và gợi ý cấu hình MCP image tool trong ~/.codex/config.toml.

Ghi chú

Codex CLI mặc định không có image gen. Cần config MCP tool (vd: OpenAI image API) trong Codex config trước khi command này chạy được.