rexleimo/harness-cli/rexai-image-generation
Claude Code and agent skill by rexleimo/harness-cli
- community
Checking that the SKILL.md file is still in the repository.
Use when the user wants to generate an image, edit an image, create visual artwork, produce text-to-image output, transform an existing image with image-to-image, or asks for 生图, 生成图片, 文生图, 图生图, text-to-image, image-to-image, AI image, picture generation, image result, image edit, or visual generation.
Install
npx vskill@latest install rexleimo/harness-cli/rexai-image-generationSKILL.md
RexAI Image Generation
Use RexAI's async image API to create images and return usable local files.
Quick Workflow
- Use
REXAI_API_KEYfor authentication. If it is missing, teach the user how to configure it for their platform before running the job. Read it live from the OS on Windows (powershell [Environment]::GetEnvironmentVariable('REXAI_API_KEY','Machine')) — a bash/PowerShell session started before the key was set holds a stale snapshot. - Choose the product ID (verify against the current instance's product list with one probe; these IDs have drifted before):
- Text-to-image:
gpt-image-2. - Image-to-image: the same `gpt-image-2` product with the `-Image` parameter — the relay selects the image-to-image route when the body carries
images.gpt-image-2-i2idoes NOT exist (404 image_product_not_found); do not use it.
- Pick the executor — prefer Python on every platform (the shell script's silent poll loop reads as a hang):
- Any platform with python3 (default choice): use
scripts/impl/rexai-image.py; stdlib only. It prints live poll progress every poll (agents can watch it run), reports the job id on submit/timeout, auto-resubmits on relay circuit-breaker/429 failures (bounded to 3 attempts), tolerates transient 5xx/network errors during polling, and always exits within the per-job `--timeout` (default 600s) — it cannot hang. If the agent's shell tool has its own timeout, pass a matching--timeoutso the script self-reports the job id instead of being killed mid-poll. - Windows without Python: use
scripts/impl/rexai-image.ps1; it only needs built-in PowerShell/.NET. - macOS/Linux without Python: use
scripts/impl/rexai-image-macos.sh; it uses common system tools (bash,curl,perl,base64). Pass--timeout-ms 600000for large sizes.
- Use
scripts/impl/rexai-image.mjsonly when Node is already available. - Report the local file path, job id, source URL if present, and expiry time if present.
Read references/api.md when you need endpoint details, supported sizes, error codes, or examples.
API Key Setup
First check whether the key is already available. Do not print the key value:
If it is missing, tell the user to choose one setup path:
Windows PowerShell, current session only:
Windows PowerShell, persistent for new terminals:
macOS/Linux, current shell only:
macOS zsh, persistent for new terminals:
Linux bash persistent setup for new terminals:
Security rules: never commit .env files or API keys, never echo the real key back to the user, and only save persistent configuration when the user explicitly chooses that option.
Text-To-Image
Python (preferred, all platforms):
Windows/Codex:
macOS/Linux:
Image-To-Image
Pass at least one reference image as a local file path, image URL, or data:image/... URL. Local files are converted to data URLs by the script. Use the same `-Model gpt-image-2` as text-to-image; the presence of -Image makes the relay take the image-to-image route. Do NOT use gpt-image-2-i2i — that product does not exist.
Windows/Codex:
macOS/Linux:
The script converts local files to data:image/...;base64,... before submitting. If you pass a public HTTP URL instead, the relay server downloads it itself — image hosts with hotlink protection (Wikimedia, Taobao, Xiaohongshu CDNs) reject server-side downloads with 403, so prefer local files or verified-downloadable URLs.
Optional Node Fallback
If Node is already installed, this equivalent script is available:
Operational Rules
- The API key is read only from the `REXAI_API_KEY` environment variable. The scripts expose no
-ApiKey/--api-keyoption — never pass the key as a CLI argument, and never put it in shell history or command lines. On Windows, read it live from the OS if a session started before the key was set (powershell -NoProfile -Command "[Environment]::GetEnvironmentVariable('REXAI_API_KEY','Machine')"); bash/PowerShell sessions snapshot env at startup and hold stale values. - If
REXAI_API_KEYis missing, show the relevant setup commands from "API Key Setup" and ask the user to configure the key before retrying. - Do not install Node just for this skill; use PowerShell on Windows and the shell script on macOS/Linux.
- Use an output directory inside the current workspace unless the user requests another path.
- For image-to-image, do not invent a source image; ask for an image path/URL when none is available.
- If a job times out, report the job id and last known status so the user can retry polling.
- If RexAI returns
model_not_found,invalid_model, orinvalid_parameter, refreshhttps://tool.rexai.top/api/api-docsand update the product ID or parameter names.
Error Triage (validated 2026-09-05)
A failed job's error in the DB is often just upstream_failed + Request failed with status code NNN (the relay's adapter discards the upstream body on non-2xx). Distinguish by status and by what was sent:
| Symptom | Meaning | Fix | |
|---|---|---|---|
404 image_product_not_found | Product ID does not exist (e.g. gpt-image-2-i2i) | Use the real ID (i2i = gpt-image-2 + images) | |
Job fails 403, log shows Image edit source image resolve failed / inputKind: http_url | The relay server could not download your http URL reference (hotlink protection) | Convert the image to base64 data URI locally first | |
403 with body error code: 1010 | Local Clash proxy mangling the request | Unset HTTPS_PROXY/HTTP_PROXY and retry direct | |
401 Invalid token | Upstream credential on that channel is stale | Rotate the channel credential (operator side) | |
402 insufficient_direct_balance | Direct-pay balance / wrong credential | Check balance, or use the env key |
403 upstream_failed does NOT mean the product is delisted (a prior session misdiagnosed gpt-image-2 this way). Always convert references to base64 data URIs, probe with a one-image proof, and read the status against this table before blaming the product.
Verification (no-hang guarantees)
The Python executor's hang-safety is covered by scripts/impl/rexai-image.py.test.py (stdlib only, run with python3): transient 5xx absorption, hard --timeout exit bound, bounded resubmission (≤3 submits), and immediate 4xx death. Other executors: node rexai-image.test.mjs && node rexai-image.skill.test.mjs, bash rexai-image-macos.test.sh, powershell -File rexai-image.ps1.test.ps1.
Script Output
The scripts print JSON:
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskill-sources/rexai-image-generation/SKILL.md
Popularity
- Repository stars
- 49
- Repository forks
- 6
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rexleimo/harness-cli/rexai-image-generation)