@platanai/cli
v0.7.0
Published
Local-first CLI for agent-driven pixel art generation with platan.ai.
Downloads
883
Readme
@platanai/cli
The CLI for platan.ai — a local-first, agent-driven pixel art generator. Chat with an agent to generate, edit, and transform pixel art ("a rusty sword" → "flip it" → "tint it blue"); images live on your machine.
Install
No install needed — run via npx:
npx @platanai/cli devThis opens the editor at http://localhost:3333. The first time you visit, the web UI walks you through setup — it detects what's missing (API keys, sharp, Node version) and shows the exact file edits to make, pointing at your current directory.
Commands
platanai dev
Starts the interactive web editor. Agent chat + gallery of past runs.
npx @platanai/cli dev [--port 3333] [--host 127.0.0.1] [--no-open]platanai generate
Batch mode — produces four pixel art variations of an asset in one shot. Useful for scripted pipelines:
npx @platanai/cli generate -t items \
-p "a rusty iron sword" \
-p "a worn iron sword" \
-p "a battered short sword" \
-p "an old iron sword" \
-o "items/sword.png"Options: -t <type> · -p <prompt> (repeatable) · -o <output> (repeatable) · -r <ref> (reference image) · -m <model> · -y (auto-accept) · -i <input> (process a local grid, no API call).
Configuration
The CLI looks for platanai.config.{ts,mjs,js} in the current directory (walking up to the repo root) to pick your provider (Gemini or OpenAI) and model. Without a config file, it uses Gemini defaults.
API keys are read from env vars. The CLI auto-loads .env.local from cwd at boot — no export or source needed.
// platanai.config.ts
import { defineConfig } from "@platanai/core";
export default defineConfig({
providers: {
image: {
provider: "gemini",
model: "gemini-2.5-flash-image",
apiKey: process.env.PLATANAI_GEMINI_API_KEY!,
},
intentRouter: {
provider: "gemini",
model: "gemini-flash-latest",
apiKey: process.env.PLATANAI_GEMINI_API_KEY!,
},
},
});# .env.local
PLATANAI_GEMINI_API_KEY=your-key-hereSee the main README for full docs.
Links
License
Apache-2.0.
