Getting Started
Quickstart
Run it with npx, choose your auth method, and start generating images and videos.
No API key required for the default OAuth paths.
Run it
npx ima2-gen serve Then open http://localhost:3333.
Port discovery. If
3333 is busy, ima2-gen binds the next free port
and writes the real URL to ~/.ima2/server.json. Use ima2 open or the
URL printed in the terminal instead of assuming the port.
Setup (choose auth)
Run ima2 setup to pick your authentication method:
- GPT OAuth — sign in with ChatGPT (free, images only)
- Grok OAuth — sign in with xAI/Grok (images + video)
- Both — GPT + Grok (full feature access)
- API Key — paste your OpenAI API key (paid)
Video generation requires Grok OAuth (option 2 or 3). Add it later with ima2 grok login.
Sign in with ChatGPT
If ChatGPT OAuth is not logged in yet:
npx @openai/codex login
npx ima2-gen serve Install globally
npm install -g ima2-gen
ima2 serve Windows update note. Stop any running
ima2 serve before updating a
global install. If npm reports EBUSY or resource busy or locked, close
ima2 terminals, end stale node.exe processes, and retry.
Develop from source
git clone https://github.com/lidge-jun/ima2-gen.git
cd ima2-gen
npm install
npm run dev # build the UI, run the TS server with --watch + diagnostics
npm run typecheck
npm test
npm run build npm run dev builds the UI and starts the TypeScript server entry with
--watch. Treat the .ts files as the source of truth; the paired
.js artifacts are produced by the build, never edited by hand.