{"_id":"@bytetrue/pi-image-gen","_rev":"7-568aa7b0d5fa020796e98d2d81823d23","name":"@bytetrue/pi-image-gen","dist-tags":{"latest":"0.6.0"},"versions":{"0.1.0":{"name":"@bytetrue/pi-image-gen","version":"0.1.0","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.1.0","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"b4bd0a0dc3020a07b8c028a51fb131439554dfe9","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.1.0.tgz","fileCount":46,"integrity":"sha512-mgzWn5PaALivdFnBq3Ax89a1miyYC/vnSYrR2RV8U9SbJBY8y9kjhl3X21tGU2kbSW+sfL6SLHwWZngUSF+F6Q==","signatures":[{"sig":"MEQCIDepMK7/U53c1NAtlLY9sMLpjK39qE+WnvZypS2iq+gyAiANXJNCf25giWN4MYLK3tTCgaY66a8wYibes0FIXQdXTg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":100410},"type":"module","gitHead":"a3329c167c4dc445227af30b043412f7f0f02188","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"bytetrue","email":"bytetrue@outlook.com"},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.0.1","description":"Pi extension for image generation via OpenAI, Gemini, Qwen-Image, OpenRouter, and custom providers.","directories":{},"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"@amaster.ai/pi-shared":"^0.1.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"typebox":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.1.0_1784474650829_0.4705493703638681","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bytetrue/pi-image-gen","version":"0.2.0","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.2.0","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"dist":{"shasum":"5b074bde8ccbab666073dc3be78e9fa199099673","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.2.0.tgz","fileCount":63,"integrity":"sha512-QBg+T//6mnZQzJNMEBh1l/llSxLNw34hdDFisIkM3PU3VldEKLkxQqLdtb2Vocdujafd6eRcYqY0k7UzB8wJBg==","signatures":[{"sig":"MEUCIQDWWJrh2n2sUCu4Bo1BygImL9c9R7tJZ17+zAVQ1YW0/QIgUi6nnMUQJZ9OS9jsifGYSYIObacrWwjBuY6x52exyS0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":120842},"type":"module","gitHead":"7e4be44a207a726b4a53d77bb2984d8b4e83b8c3","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6f51762a-0c64-4a82-bba1-6140e45cd334"}},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.0.2","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.2.0_1786079887275_0.43205377957465396","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@bytetrue/pi-image-gen","version":"0.2.1","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.2.1","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"dist":{"shasum":"d4b8ffb26a69d03c5b86d294fb1479fd7d3508f2","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.2.1.tgz","fileCount":63,"integrity":"sha512-8ag1LrKp+b8pefcw7dPpOuqAGMtQBtAXmN2rEemtladGVrQFP0069gYjyY/EPgiMBU4n1Dd/BOcqeCqmnU82bQ==","signatures":[{"sig":"MEQCIQCq4vK1u/d60MhguYLt8cFi9Mh/xzzRYXu8cBPIYQW+/AIfL86+FgTyUorL/U+EUYyoBD/skR5aheA7DoDeSYJyKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":118969},"type":"module","gitHead":"2e8d31687f2efddde450cb473f44a95d97db86bc","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6f51762a-0c64-4a82-bba1-6140e45cd334"}},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.0.2","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.2.1_1786461857144_0.997704796459526","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@bytetrue/pi-image-gen","version":"0.3.0","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.3.0","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"dist":{"shasum":"491f8500591ff2312c0c96f59aec7ed260b72dd2","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.3.0.tgz","fileCount":64,"integrity":"sha512-lsM/ELfM0a8FEoZtZORfQQsqIlKg+Whgm/HMbshASFnHod0jauDwyODXpR1+McZe3my5nUELYsPF/wkPugh4Iw==","signatures":[{"sig":"MEUCIQDAGszBURf38gixULZyenQtG1ZFrOmJH+DCiFZbmL2WWgIgMIG6nfI6crHvO1lkZe8rgGTKgZGvJLq22Z0wzzxcw04=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":185376},"type":"module","gitHead":"a1ad3c603e61ce2c5cf9a30a633c7056ba252601","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6f51762a-0c64-4a82-bba1-6140e45cd334"}},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.0.2","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.3.0_1787933588366_0.9381478614531065","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bytetrue/pi-image-gen","version":"0.4.0","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.4.0","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"dist":{"shasum":"3a4c0163ad260255027d64e0a47bc52e0fa88573","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.4.0.tgz","fileCount":67,"integrity":"sha512-G3KpXFD/g+ZyUNnCy7ydSBXIxdZ6sOw04jNXifahktUjXJZa11C9w1EnEqeHDYiI4pxk8jMLvfujCU2EOntzlQ==","signatures":[{"sig":"MEUCID1qO3b/asXMOMi7WuDxMnwpCYavhBWiWNSO7An85qE+AiEA3VxVkgpZw0B7Nz0pmX1FlNFilolGaOGEC+9AoNpIv8g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":189932},"type":"module","gitHead":"c5d703f3f1b829db1f7f568ff053a8cd2ef59654","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6f51762a-0c64-4a82-bba1-6140e45cd334"}},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.0.2","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.4.0_1788672678457_0.9752858427033964","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@bytetrue/pi-image-gen","version":"0.5.0","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"license":"Apache-2.0","_id":"@bytetrue/pi-image-gen@0.5.0","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"dist":{"shasum":"ce3528dffc1455a32549ca3240a127210067a70d","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.5.0.tgz","fileCount":70,"integrity":"sha512-JjWdX7wJN6gXPN+gJihOQrLzOCYR2tLsBYujqHsoirsRfuPuXPG4JLCQJroAWG9IflKY0s1T7LIzcoBDVyMZQA==","signatures":[{"sig":"MEYCIQCCtrX719dXKQ1g36TX7wQbgB/kzxSsGWWcbZ4lyYFvwQIhAOSymYwzsU8y6Ds23mJd5cnCPOTCH46u23rxsC+2HmbK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDnMN2lvaaBf2i7pZ93bOduE6qfElSsgg/LMdUqn00FRAIgBqY59n/q4xflwBHZzGrhzNZXJqGxKAZfhFqZ9jrVr9s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":209169},"type":"module","gitHead":"61b65b496e905ab3127dd882a63cc1d8a32816bc","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:6f51762a-0c64-4a82-bba1-6140e45cd334"}},"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.1.0","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.11","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"tmp":"tmp/pi-image-gen_0.5.0_1790522109130_0.9906163174501303","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"pi":{"skills":["./skills"],"extensions":["./dist/index.js"]},"_id":"@bytetrue/pi-image-gen@0.6.0","bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"dist":{"shasum":"703ea24092622cea120f35e37eed314dcb70adb9","tarball":"https://registry.npmjs.org/@bytetrue/pi-image-gen/-/pi-image-gen-0.6.0.tgz","fileCount":70,"integrity":"sha512-g9OxprDxaD5J72gr32DvRTPQhCbd81+O+QKmpUXi+WP6lB0/BgDub+FlrbVjlZDDOs541Y8bNbZH+1hmKwHkkg==","signatures":[{"sig":"MEUCIByFVnIYMKBEM/dAFE5R9FuLR/hp9IuN/QD1ZDysFrHHAiEAmbqTVpVaZHIDFuQg3ITMScYRLc0mDVzk+vYbZ9mCXNM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDbHW0Her1Z/LLmDcgng6my45B9zzbzYBeWEFAprgfkKgIhAOZbZY83WNdWTykw82wsdPgq88UXn59F90qHM+/8JZJT"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bytetrue%2fpi-image-gen@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":213236},"name":"@bytetrue/pi-image-gen","type":"module","gitHead":"4dbaba7033a0850b338b62156f5b2bfcf3e270c6","license":"Apache-2.0","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.build.json --noEmit"},"version":"0.6.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"6f51762a-0c64-4a82-bba1-6140e45cd334"}},"homepage":"https://github.com/ByteTrue/pi-package-mono#readme","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"_npmVersion":"12.1.0","description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","directories":{},"maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.11","typescript":"^5.0.0","@types/node":"^22.0.0"},"peerDependencies":{"@earendil-works/pi-tui":"*","@earendil-works/pi-coding-agent":">=0.79.10"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-image-gen_0.6.0_1790756798642_0.2307206144103775"}}},"time":{"created":"2026-07-19T15:24:10.703Z","modified":"2026-09-30T08:26:39.315Z","0.1.0":"2026-07-19T15:24:10.971Z","0.2.0":"2026-08-07T05:18:07.441Z","0.2.1":"2026-08-11T15:24:17.291Z","0.3.0":"2026-08-28T16:13:08.516Z","0.4.0":"2026-09-06T05:31:18.653Z","0.5.0":"2026-09-27T15:15:09.230Z","0.6.0":"2026-09-30T08:26:38.769Z"},"bugs":{"url":"https://github.com/ByteTrue/pi-package-mono/issues"},"license":"Apache-2.0","homepage":"https://github.com/ByteTrue/pi-package-mono#readme","keywords":["pi-package","pi-extension","image-generation","gpt-image","nano-banana","qwen-image","openrouter"],"repository":{"url":"git+https://github.com/ByteTrue/pi-package-mono.git","type":"git","directory":"packages/pi-image-gen"},"description":"Pi TUI configuration and an on-demand Skill/CLI for image generation.","maintainers":[{"name":"bytetrue","email":"bytetrue@outlook.com"}],"readme":"<p align=\"center\">\n  <img src=\"./docs/banner.webp\" alt=\"A precise aperture transforming a prompt stream into an image plane\" width=\"100%\">\n</p>\n\n<h1 align=\"center\">@bytetrue/pi-image-gen</h1>\n\n<p align=\"center\">Generate and edit images from Pi without carrying a permanent Agent tool.</p>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@bytetrue/pi-image-gen\"><img src=\"https://img.shields.io/npm/v/@bytetrue/pi-image-gen?style=flat-square\" alt=\"npm version\"></a>\n</p>\n\n> Forked from [`@amaster.ai/pi-image-gen`](https://github.com/TGYD-helige/pi/tree/master/packages/pi-image-gen). Redistribution details are preserved in [NOTICE](NOTICE).\n\nThe package deliberately has two surfaces:\n\n- `/image-gen` gives people a complete TUI setup flow.\n- The `pi-image-gen` Skill and bundled CLI load only when the Agent needs to create or edit an image.\n\nNo permanent `image_generate` tool schema is added to every request.\n\n## Install\n\n```bash\npi install npm:@bytetrue/pi-image-gen\n```\n\nRestart Pi and run:\n\n```text\n/image-gen\n```\n\n`/image-gen` opens three actions: **Manage providers**, **Set output directory**, and **Show effective configuration**. Normal setup never requires editing JSON by hand.\n\n**Manage providers** lists everything reachable — a row you configured, or a built-in that its standard environment variable already enables — and marks the one behind the current default. **Add provider…** runs the full wizard: protocol, endpoint, credential, headers, model, output directory. An existing provider opens a page where you can:\n\n- **Change default model…** — probes the endpoint, falls back to the known and declared lists, and writes only the default route. This is the path for swapping in a newly released model id without retyping a URL or key.\n- **Edit endpoint, credential, headers…** — each prompt keeps the stored value unless you type over it.\n- **Manage model list…** — add models, set or clear an alias, or remove entries.\n- **Delete provider** — removes the settings row. If it held the default route, that route is cleared too.\n\n## Generate from Pi\n\nAsk normally:\n\n> Generate a cinematic 16:9 image of a lunar research station.\n\nFor an edit or a consistent character/style, attach a local reference image or mention a previously generated path. The Skill invokes the bundled CLI and returns generated files as inline Markdown.\n\nThe configured default route is always used; the CLI does not accept a model override.\n\n## Providers\n\n| Protocol | Built-in routing | Standard environment variable |\n| --- | --- | --- |\n| OpenAI | `gpt-image-2` | `OPENAI_API_KEY` |\n| Google Gemini | Gemini image models and Nano Banana aliases | `GEMINI_API_KEY` |\n| Alibaba DashScope | Qwen Image models | `DASHSCOPE_API_KEY` |\n| Volcengine Ark | Seedream models and aliases | `ARK_API_KEY` |\n| OpenRouter | `openrouter/<vendor>/<model>` | `OPENROUTER_API_KEY` |\n\nCustom providers select one of these wire protocols and supply their own endpoint and model id.\n\n## Configuration\n\n`/image-gen` writes a dedicated package config file — `<pkg-config root>/pi-image-gen/settings.json`, where the root is `$PI_PKG_CFG_DIR` or `<agent dir>/pi-pkg-cfg` and `<agent dir>` is `$PI_CODING_AGENT_DIR` (`~/.pi/agent` by default). It never touches Pi's `settings.json`.\n\nUpgrading from 0.5.x: the older `<agent dir>/pi-image-gen/settings.json` is copied into the new root the first time the package reads it, and the original stays in place so downgrading still works. `PI_AGENT_HOME` now only locates that older file.\n\nCredential choices include:\n\n- the provider's standard environment variable;\n- another `$ENV_VAR` reference;\n- a literal key entered in a masked field; or\n- no key for a local or keyless endpoint.\n\nWrites use an atomic `0600` path and refuse to overwrite malformed settings. Selecting **No API key** writes `apiKey: \"\"`, blocking lower-layer and standard-environment credentials. Selecting **No extra headers** writes `headers: {}`, blocking inherited headers.\n\nA file written in the v1 layout is migrated once, on the next read. The original is kept as `settings.json.v1.bak` beside the new file before the rewrite, and the rewrite never blocks generation — if it cannot be persisted, settings still load for that run. Two cases are deliberately not guessed: a custom provider named exactly like a built-in one leaves the file untouched until you rename it, and a default model that the old resolver could not route is dropped, so pick it again with `/image-gen`.\n\nRelative output directories resolve from the Pi session working directory. The default is `.pi/images`.\n\n<details>\n<summary>Optional settings shape</summary>\n\n```json\n{\n  \"version\": 2,\n  \"default\": { \"provider\": \"my-sd\", \"model\": \"sd-3-large\" },\n  \"outputDir\": \".pi/images\",\n  \"providers\": {\n    \"openai\": {\n      \"baseUrl\": \"https://proxy.example.com/v1\",\n      \"apiKey\": \"$OPENAI_API_KEY\"\n    },\n    \"my-sd\": {\n      \"api\": \"openai\",\n      \"baseUrl\": \"https://api.example.com/v1\",\n      \"apiKey\": \"$SD_KEY\",\n      \"models\": [{ \"id\": \"sd-3-large\", \"alias\": \"sd3\" }]\n    }\n  }\n}\n```\n\n`version` is written for you. Built-in rows may omit `api` because the protocol comes from the built-in template; a custom row must declare it. `models` lists known ids and optional local aliases for the pickers — it does not gate which ids a provider accepts.\n\n`apiKey`, `baseUrl`, and header values support `$VAR`, `${VAR}`, and `${VAR:-fallback}` interpolation.\n\n</details>\n\n## Skill CLI\n\nThe bundled Skill sends one JSON object to `skills/pi-image-gen/scripts/image-gen.mjs`:\n\n```json\n{\n  \"prompt\": \"A watercolor lighthouse in a winter storm\",\n  \"image\": [\"/optional/reference.png\"],\n  \"n\": 1,\n  \"size\": \"1024x1024\",\n  \"filename\": \"winter-lighthouse\"\n}\n```\n\n`prompt` is required. `image`, `n` (1–8), `size`, `filename`, and `outputDir` are optional. Image inputs may be local paths or HTTP(S) URLs. The CLI never prints configured credentials.\n\n> [!NOTE]\n> The CLI resolves `PI_PKG_CFG_DIR` / `PI_CODING_AGENT_DIR` the same way the extension does, so a redirected Pi config dir carries the image-gen config with it.\n\n## Development\n\nThis package builds `dist` because the extension and Skill CLI share one production core:\n\n```bash\nnpm --workspace @bytetrue/pi-image-gen test\nnpm --workspace @bytetrue/pi-image-gen run typecheck\nnode packages/pi-image-gen/scripts/pack-smoke.mjs\n```\n","readmeFilename":"README.md"}