imgx-cli 0.5.2 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1 (2026-02-27)
4
+
5
+ ### Fixed
6
+
7
+ - Default output directory changed from process cwd to `~/Pictures/imgx` — fixes images being saved to AppData when used via MCP (Claude Desktop, etc.)
8
+
9
+ ## 0.6.0 (2026-02-27)
10
+
11
+ ### Added
12
+
13
+ - **OpenAI provider** — `gpt-image-1` model with generate and edit support
14
+ - Native `fetch` implementation (no `openai` npm dependency)
15
+ - Aspect ratio mapping to OpenAI size strings, resolution mapping to quality parameter
16
+ - Manual multipart/form-data construction for Node 18 compatibility
17
+ - `OPENAI_API_KEY` environment variable support
18
+ - `--provider` flag for `imgx config set api-key` — manage API keys per provider
19
+ - `imgx config set api-key <key> --provider openai`
20
+ - `imgx config list` now shows all configured provider keys
21
+
22
+ ### Changed
23
+
24
+ - CLI and MCP server now initialize both Gemini and OpenAI providers at startup
25
+ - `imgx providers` and error messages updated for multi-provider context
26
+ - Help text updated with OpenAI provider info and env var
27
+
3
28
  ## 0.5.2 (2026-02-26)
4
29
 
5
30
  ### Fixed
@@ -10,6 +35,7 @@
10
35
 
11
36
  - README: add Claude Desktop MCP configuration (Windows `cmd /c` + macOS/Linux)
12
37
  - README: switch all MCP config examples from local `node` path to `npx`
38
+ - README: replace "Version updates" with full release checklist (version bump → build → publish → verify)
13
39
 
14
40
  ## 0.5.1 (2026-02-26)
15
41
 
package/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  AI image generation and editing from the terminal. Provider-agnostic design with capability-based abstraction.
4
4
 
5
- <!-- TODO: Add demo GIF showing generate → edit → edit --last workflow -->
6
-
7
5
  ## Install
8
6
 
9
7
  ### As a Claude Code plugin
@@ -50,16 +48,25 @@ Requires Node.js 18+.
50
48
 
51
49
  ## Setup
52
50
 
53
- Get a Gemini API key from [Google AI Studio](https://aistudio.google.com/apikey) (free tier available), then save it:
51
+ Set up at least one provider:
52
+
53
+ **Gemini** — get a key from [Google AI Studio](https://aistudio.google.com/apikey) (free tier available):
54
54
 
55
55
  ```bash
56
- imgx config set api-key YOUR_GEMINI_API_KEY
56
+ imgx config set api-key YOUR_GEMINI_API_KEY --provider gemini
57
57
  ```
58
58
 
59
- This stores the key in `~/.config/imgx/config.json` (Linux/macOS) or `%APPDATA%\imgx\config.json` (Windows). Alternatively, set an environment variable:
59
+ **OpenAI** get a key from [OpenAI Platform](https://platform.openai.com/api-keys):
60
+
61
+ ```bash
62
+ imgx config set api-key YOUR_OPENAI_API_KEY --provider openai
63
+ ```
64
+
65
+ Keys are stored in `~/.config/imgx/config.json` (Linux/macOS) or `%APPDATA%\imgx\config.json` (Windows). Alternatively, set environment variables:
60
66
 
61
67
  ```bash
62
68
  export GEMINI_API_KEY="your-api-key"
69
+ export OPENAI_API_KEY="your-api-key"
63
70
  ```
64
71
 
65
72
  Environment variables take precedence over the config file.
@@ -108,7 +115,8 @@ imgx edit --last -p "Crop to 16:9" -o final.png
108
115
  ### Configuration
109
116
 
110
117
  ```bash
111
- imgx config set api-key <key> # Save Gemini API key
118
+ imgx config set api-key <key> --provider gemini # Save Gemini API key
119
+ imgx config set api-key <key> --provider openai # Save OpenAI API key
112
120
  imgx config set model <name> # Set default model
113
121
  imgx config set output-dir <dir> # Set default output directory
114
122
  imgx config set aspect-ratio 16:9 # Set default aspect ratio
@@ -164,7 +172,8 @@ Environment variables override config file settings.
164
172
 
165
173
  | Variable | Description |
166
174
  |----------|-------------|
167
- | `GEMINI_API_KEY` | Gemini API key (overrides `imgx config set api-key`) |
175
+ | `GEMINI_API_KEY` | Gemini API key |
176
+ | `OPENAI_API_KEY` | OpenAI API key |
168
177
  | `IMGX_PROVIDER` | Default provider |
169
178
  | `IMGX_MODEL` | Default model |
170
179
  | `IMGX_OUTPUT_DIR` | Default output directory |
@@ -208,7 +217,7 @@ Add to your tool's MCP config. The `env` section is optional if you have already
208
217
  "imgx": {
209
218
  "command": "npx",
210
219
  "args": ["--package=imgx-cli", "-y", "imgx-mcp"],
211
- "env": { "GEMINI_API_KEY": "your-api-key" }
220
+ "env": { "GEMINI_API_KEY": "your-key", "OPENAI_API_KEY": "your-key" }
212
221
  }
213
222
  }
214
223
  }
@@ -226,7 +235,7 @@ Or install as a [Claude Code plugin](#install) for automatic MCP registration.
226
235
  "imgx": {
227
236
  "command": "npx",
228
237
  "args": ["--package=imgx-cli", "-y", "imgx-mcp"],
229
- "env": { "GEMINI_API_KEY": "your-api-key" }
238
+ "env": { "GEMINI_API_KEY": "your-key", "OPENAI_API_KEY": "your-key" }
230
239
  }
231
240
  }
232
241
  }
@@ -242,7 +251,7 @@ macOS / Linux:
242
251
  "imgx": {
243
252
  "command": "npx",
244
253
  "args": ["--package=imgx-cli", "-y", "imgx-mcp"],
245
- "env": { "GEMINI_API_KEY": "your-api-key" }
254
+ "env": { "GEMINI_API_KEY": "your-key", "OPENAI_API_KEY": "your-key" }
246
255
  }
247
256
  }
248
257
  }
@@ -256,7 +265,7 @@ Windows:
256
265
  "imgx": {
257
266
  "command": "cmd",
258
267
  "args": ["/c", "npx", "--package=imgx-cli", "-y", "imgx-mcp"],
259
- "env": { "GEMINI_API_KEY": "your-api-key" }
268
+ "env": { "GEMINI_API_KEY": "your-key", "OPENAI_API_KEY": "your-key" }
260
269
  }
261
270
  }
262
271
  }
@@ -272,11 +281,13 @@ Config file location: `%APPDATA%\Claude\claude_desktop_config.json` (Windows) or
272
281
  [mcp_servers.imgx]
273
282
  command = "npx"
274
283
  args = ["--package=imgx-cli", "-y", "imgx-mcp"]
275
- env = { GEMINI_API_KEY = "your-api-key" }
284
+ env = { GEMINI_API_KEY = "your-key", OPENAI_API_KEY = "your-key" }
276
285
  ```
277
286
 
278
287
  The same `npx` pattern works with Cursor, Windsurf, Continue.dev, Cline, Zed, and other MCP-compatible tools. On Windows, use `cmd /c npx` instead of `npx` directly.
279
288
 
289
+ Only include the API keys for providers you want to use. At least one is required.
290
+
280
291
  ## Architecture
281
292
 
282
293
  imgx separates **model-independent** and **model-dependent** concerns:
@@ -310,56 +321,7 @@ Each provider declares its supported capabilities. The CLI dynamically enables o
310
321
  | Provider | Models | Capabilities |
311
322
  |----------|--------|-------------|
312
323
  | Gemini | `gemini-3-pro-image-preview`, `gemini-2.5-flash-image` | All 7 capabilities |
313
-
314
- ## Plugin structure
315
-
316
- imgx-cli doubles as an AI coding tool plugin. The repository contains:
317
-
318
- ```
319
- .claude-plugin/
320
- ├── plugin.json # Claude Code plugin manifest
321
- └── marketplace.json # Marketplace definition for plugin discovery
322
- .cursor-plugin/
323
- └── plugin.json # Cursor plugin manifest
324
- .mcp.json # MCP server config (auto-registered on plugin install)
325
- skills/
326
- └── image-generation/
327
- ├── SKILL.md # Skill instructions
328
- └── references/
329
- └── providers.md # Provider and model reference
330
- dist/
331
- ├── cli.bundle.js # Bundled CLI (tracked in git for plugin distribution)
332
- └── mcp.bundle.js # Bundled MCP server
333
- ```
334
-
335
- When installed as a plugin, the tool clones this repository and registers the skill. The skill instructs the AI to execute `dist/cli.bundle.js` via bash when image generation or editing is requested.
336
-
337
- ### Plugin configuration files
338
-
339
- **`.claude-plugin/plugin.json`** — Plugin identity. Fields: `name`, `description`, `version`, `author`. No `category` field (that belongs in `marketplace.json` only).
340
-
341
- **`.claude-plugin/marketplace.json`** — Marketplace wrapper. The `source` field must use URL format for self-referencing repositories:
342
-
343
- ```json
344
- "source": {
345
- "source": "url",
346
- "url": "https://github.com/somacoffeekyoto/imgx-cli.git"
347
- }
348
- ```
349
-
350
- **`skills/image-generation/SKILL.md`** — Uses `${CLAUDE_PLUGIN_ROOT}` variable for portable CLI paths. Frontmatter (`name`, `description`) is required for skill registration.
351
-
352
- ### Version updates
353
-
354
- When releasing a new version, update the version string in all locations:
355
-
356
- 1. `package.json` — npm package version
357
- 2. `src/cli/index.ts` — CLI `--version` output
358
- 3. `.claude-plugin/plugin.json` — Claude Code plugin manifest version
359
- 4. `.claude-plugin/marketplace.json` — Marketplace plugin entry version
360
- 5. `.cursor-plugin/plugin.json` — Cursor plugin manifest version
361
-
362
- Then rebuild (`npm run bundle`) and commit `dist/cli.bundle.js` since plugin distribution relies on the git repository.
324
+ | OpenAI | `gpt-image-1` | Generate, edit, aspect ratio, multi-output |
363
325
 
364
326
  ## Development
365
327