Skip to content

Commit 61c3b82

Browse files
committed
fix: rename /image to /imagegen to avoid OpenClaw command conflict
1 parent d9477bc commit 61c3b82

2 files changed

Lines changed: 26 additions & 26 deletions

File tree

RELEASE-v0.11.0.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,36 @@ Request 3: hash=abc123 → strikes: 2 → ESCALATE!
2828

2929
---
3030

31-
## Feature 2: `/image` command — generate images from chat
31+
## Feature 2: `/imagegen` command — generate images from chat
3232

33-
Users can now generate images directly from the chat interface using the `/image` command. Powered by BlockRun's image generation API with x402 micropayments.
33+
Users can now generate images directly from the chat interface using the `/imagegen` command. Powered by BlockRun's image generation API with x402 micropayments.
3434

3535
### Usage
3636

3737
```
38-
/image a cat wearing sunglasses
39-
/image --model dall-e-3 a futuristic city at sunset
40-
/image --model banana-pro --size 2048x2048 mountain landscape
38+
/imagegen a cat wearing sunglasses
39+
/imagegen --model dall-e-3 a futuristic city at sunset
40+
/imagegen --model banana-pro --size 2048x2048 mountain landscape
4141
```
4242

4343
### Available models & pricing
4444

4545
| Model | Shorthand | Price |
4646
|-------|-----------|-------|
47-
| Google Nano Banana (default) | `nano-banana`, `banana` | $0.05/image |
48-
| Google Nano Banana Pro | `banana-pro` | $0.10/image (up to 4K) |
49-
| OpenAI DALL-E 3 | `dall-e-3`, `dalle` | $0.04/image |
50-
| OpenAI GPT Image 1 | `gpt-image` | $0.02/image |
51-
| Black Forest Flux 1.1 Pro | `flux` | $0.04/image |
47+
| Google Nano Banana (default) | `nano-banana`, `banana` | $0.05/imagegen |
48+
| Google Nano Banana Pro | `banana-pro` | $0.10/imagegen (up to 4K) |
49+
| OpenAI DALL-E 3 | `dall-e-3`, `dalle` | $0.04/imagegen |
50+
| OpenAI GPT Image 1 | `gpt-image` | $0.02/imagegen |
51+
| Black Forest Flux 1.1 Pro | `flux` | $0.04/imagegen |
5252

5353
### How it works
5454

55-
1. User sends `/image <prompt>` as a chat message
55+
1. User sends `/imagegen <prompt>` as a chat message
5656
2. ClawRouter intercepts it in the proxy (same pattern as `/debug`)
57-
3. Calls `POST /v1/images/generations` upstream with x402 payment
57+
3. Calls `POST /v1/imagegens/generations` upstream with x402 payment
5858
4. Returns the image URL as a markdown image in a synthetic chat completion
5959

60-
Running `/image` with no prompt shows full usage help with all models and pricing.
60+
Running `/imagegen` with no prompt shows full usage help with all models and pricing.
6161

6262
---
6363

src/proxy.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1813,11 +1813,11 @@ async function proxyRequest(
18131813
return;
18141814
}
18151815

1816-
// --- /image command: generate an image via BlockRun image API ---
1817-
if (lastContent.startsWith("/image")) {
1818-
const imageArgs = lastContent.slice("/image".length).trim();
1816+
// --- /imagegen command: generate an image via BlockRun image API ---
1817+
if (lastContent.startsWith("/imagegen")) {
1818+
const imageArgs = lastContent.slice("/imagegen".length).trim();
18191819

1820-
// Parse optional flags: /image --model dall-e-3 --size 1792x1024 a cute cat
1820+
// Parse optional flags: /imagegen --model dall-e-3 --size 1792x1024 a cute cat
18211821
let imageModel = "google/nano-banana";
18221822
let imageSize = "1024x1024";
18231823
let imagePrompt = imageArgs;
@@ -1853,7 +1853,7 @@ async function proxyRequest(
18531853

18541854
if (!imagePrompt) {
18551855
const errorText = [
1856-
"Usage: /image <prompt>",
1856+
"Usage: /imagegen <prompt>",
18571857
"",
18581858
"Options:",
18591859
" --model <model> Model to use (default: nano-banana)",
@@ -1867,9 +1867,9 @@ async function proxyRequest(
18671867
" flux Black Forest Flux 1.1 Pro — $0.04/image",
18681868
"",
18691869
"Examples:",
1870-
" /image a cat wearing sunglasses",
1871-
" /image --model dall-e-3 a futuristic city at sunset",
1872-
" /image --model banana-pro --size 2048x2048 mountain landscape",
1870+
" /imagegen a cat wearing sunglasses",
1871+
" /imagegen --model dall-e-3 a futuristic city at sunset",
1872+
" /imagegen --model banana-pro --size 2048x2048 mountain landscape",
18731873
].join("\n");
18741874

18751875
const completionId = `chatcmpl-image-${Date.now()}`;
@@ -1892,12 +1892,12 @@ async function proxyRequest(
18921892
usage: { prompt_tokens: 0, completion_tokens: 0, total_tokens: 0 },
18931893
}));
18941894
}
1895-
console.log(`[ClawRouter] /image command → showing usage help`);
1895+
console.log(`[ClawRouter] /imagegen command → showing usage help`);
18961896
return;
18971897
}
18981898

18991899
// Call upstream image generation API
1900-
console.log(`[ClawRouter] /image command → ${imageModel} (${imageSize}): ${imagePrompt.slice(0, 80)}...`);
1900+
console.log(`[ClawRouter] /imagegen command → ${imageModel} (${imageSize}): ${imagePrompt.slice(0, 80)}...`);
19011901
try {
19021902
const imageUpstreamUrl = `${apiBase}/v1/images/generations`;
19031903
const imageBody = JSON.stringify({ model: imageModel, prompt: imagePrompt, size: imageSize, n: 1 });
@@ -1919,7 +1919,7 @@ async function proxyRequest(
19191919
? imageResult.error
19201920
: (imageResult.error as { message?: string })?.message ?? `HTTP ${imageResponse.status}`;
19211921
responseText = `Image generation failed: ${errMsg}`;
1922-
console.log(`[ClawRouter] /image error: ${errMsg}`);
1922+
console.log(`[ClawRouter] /imagegen error: ${errMsg}`);
19231923
} else {
19241924
const images = imageResult.data ?? [];
19251925
if (images.length === 0) {
@@ -1933,7 +1933,7 @@ async function proxyRequest(
19331933
lines.push("", `Model: ${imageModel} | Size: ${imageSize}`);
19341934
responseText = lines.join("\n");
19351935
}
1936-
console.log(`[ClawRouter] /image success: ${images.length} image(s) generated`);
1936+
console.log(`[ClawRouter] /imagegen success: ${images.length} image(s) generated`);
19371937
}
19381938

19391939
// Return as synthetic chat completion
@@ -1959,7 +1959,7 @@ async function proxyRequest(
19591959
}
19601960
} catch (err) {
19611961
const errMsg = err instanceof Error ? err.message : String(err);
1962-
console.error(`[ClawRouter] /image error: ${errMsg}`);
1962+
console.error(`[ClawRouter] /imagegen error: ${errMsg}`);
19631963
if (!res.headersSent) {
19641964
res.writeHead(500, { "Content-Type": "application/json" });
19651965
res.end(JSON.stringify({

0 commit comments

Comments
 (0)