Skip to content
Projects

About

Cooperative sprite making with AI

AI & Machine Learning

How these counts are measured

Measured star growth

in 24h
+10
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

cosprite

Cooperative sprite making with AI. Claude Code (or Codex, or Gemini CLI) designs, draws and animates your game art in your project folder; cosprite is where you see it, organise it, review it and make the small, precise changes. Everything the agent writes appears live in the editor and stays undoable with ⌘Z.

cosprite with the Neon Rooftop sample: the rooftop duel scene and the assets panel

  • Native agents. It runs the CLIs you already use, signed in with your own account. Models, thinking effort, skills, connectors (MCP) and chat history come straight from the CLI.
  • Projects with game-engine layouts. Godot, Unity, Unreal (Paper2D), GameMaker, Phaser or none: assets are filed the way your engine expects, and the agent is told where everything goes.
  • A real editor. Layers, frames, tags, onion skin, timeline with live thumbnails, scene composer, palettes, export to PNG, sprite sheets and GIF.
  • Every game asset, previewed properly. Sprites, Aseprite files, images, SVG, sounds, tracker music, video, palettes, fonts (including bitmap fonts), Tiled and LDtk maps, sprite-sheet data, 3D and voxel models, docs, data and engine files.

Install

Requirements

Node.js 20 or newer Check with node -v. Get it from nodejs.org or a version manager (nvm install 20, fnm, volta). npm comes with it.
git To clone the repo.
macOS, Linux or Windows macOS and Linux work out of the box. On Windows use PowerShell or Windows Terminal; WSL also works (open the printed URL in your Windows browser).
An agent CLI (optional) Needed only for the AI features; the editor works without one. Install at least one and sign in once in a terminal:
  • Claude Code: npm install -g @anthropic-ai/claude-code, then run claude once and sign in (Claude subscription or Anthropic Console account). Docs
  • Codex CLI: npm install -g @openai/codex, then run codex once and sign in. Repo
  • Gemini CLI: npm install -g @google/gemini-cli, then run gemini once and sign in. Repo

cosprite runs these CLIs with your own sign-in; it never asks for or stores API keys.

Get it running

git clone https://github.com/gracelungu/cosprite && cd cosprite && npm install && npm start

npm start builds the app and starts the server, which opens http://127.0.0.1:4777 in your browser. Leave the terminal open while you work; press Ctrl+C to stop. Next time, npm start again (or npm run serve to skip the rebuild).

First launch

cosprite opens the Neon Rooftop sample project on its ninja sprite, ready to draw on. In the bottom-right corner a small player holds the 16:9 pixel-art clip the sample was cut from: a purple ninja and a demon knight dueling on a rainy neon rooftop. Press play to watch it, or dismiss it (it stays dismissed). A short tour runs too (replay it from the project menu → Take the tour), and after that cosprite reopens wherever you left off.

Everything in the sample is split into what a game needs: two characters with every move as an animation tag, 11 hit effects, rain and lightning, 7 parallax background layers, the duel scene, move and effect galleries, music and sound effects with a cue sheet, a pixel font, palettes and fighter data. Open scenes/01-rooftop-duel from Assets and press play to watch the duel move. The sample lives in samples/neon-rooftop/ and has its own README.

Options

Flag Environment variable Default What
--port <n> COSPRITE_PORT 4777 Port for the app and API
--host <addr> COSPRITE_HOST 127.0.0.1 Interface to listen on. Keep it local: the server can run agents and shells
--workspace <folder> COSPRITE_WORKSPACE last project, else the sample Open this folder as the project
--no-open Don't open a browser tab
COSPRITE_HOME ~/.cosprite Where the list of your projects is kept
CLAUDE_BIN, CODEX_BIN, GEMINI_BIN found on PATH Full path to an agent CLI

Pass flags after -- with npm, or run the server directly:

npm start -- --port 4800 --workspace ~/games/my-godot-game
node server/index.mjs --port 4800 --no-open   # after npm run build

Development mode

npm run dev          # API server + Vite with hot reload on http://localhost:5173
npm run check        # typecheck + all tests
npm test             # tests only (Vitest); npm run test:watch to keep them running
npm run build        # production build into dist/

Troubleshooting

  • node-pty failed to build during npm install. It is optional and only used by Terminal mode; chat mode and the editor work without it. To get it: macOS xcode-select --install, Debian/Ubuntu sudo apt install build-essential python3, Windows the "Desktop development with C++" workload of Visual Studio Build Tools. Then npm install again.
  • Port already in use (EADDRINUSE). Another cosprite (or app) is on 4777. Stop it, or pick another port: npm start -- --port 4800 (or COSPRITE_PORT=4800 npm start).
  • "Claude Code CLI was not found on your PATH". Check claude --version works in a terminal. If it is installed somewhere npm's global bin isn't on PATH (common with nvm or a GUI-launched shell), point to it: CLAUDE_BIN="$(which claude)" npm start. Same for CODEX_BIN / GEMINI_BIN.
  • The agent says you're not signed in. Run the CLI once in a terminal (claude, codex or gemini) and complete its sign-in, then send the message again.
  • Blank page or old UI after pulling changes. Run npm install && npm start so dist/ is rebuilt.
  • npm install complains about the Node version. Upgrade to Node 20+ (node -v).

Using it

Ask Claude. Open the chat (⌘J, or Ask Claude). Describe what you want: "a 32×32 knight idle animation, 4 frames". Then:

  • Reference assets: click an asset to point Claude at it (⇧/⌘-click adds more). The open sprite or selected scene object is offered automatically, and sprites are rendered to PNG so Claude can see them.
  • Attach images: paste, drop or pick reference images; Claude looks at them.
  • Skills: type / or use Skills. cosprite ships four: pixel-sprite, animation-cycle, tileset, sprite-from-reference. They live in your project's .claude/skills/ so you can edit them.
  • Model, thinking effort, permission mode: pickers under the message box, listed live from the CLI.
  • History: every Claude Code session for the project folder, including ones from your terminal. Open one to continue it.
  • Skills & connectors (plug icon): browse skills, see which MCP connectors Claude Code has (for example ElevenLabs for sound), fix failing ones, or ask Claude to install new ones.
  • When a request finishes, the chat shows what was made: playable, clickable cards for every new or changed asset. A new sprite opens in the editor.
  • Terminal mode runs the real interactive CLI (needs node-pty, installed automatically where possible).

Projects. The project menu (top left) creates a project in a folder you pick, opens an existing folder (for example your Godot or Unity project), switches between projects, and sets the game engine. Your project's own CLAUDE.md / AGENTS.md are never overwritten; cosprite adds a link to its guide in .studio/agent-guide.md.

Editor. A floating tool bar on the canvas, a zoom control on the right, Layers & Properties on the right (⌘2), and one bottom panel with Timeline and Assets tabs (⌘B, ⌘1). Assets has a folder list, filters by type, a full-page view and a preview window for every type.

Shortcuts

B/E/G pencil/eraser/fill · L/U/O line/rect/ellipse · I picker · M select · V move · H hand · Space pan · ⌘-scroll zoom · 0 fit · [ ] brush size · X swap colours · , . frames · Enter play · N new frame · ⌘Z / ⇧⌘Z undo/redo · ⌘J chat · ⌘K ask · ⌘B timeline · ⌘1 assets · ⌘2 layers · ? all shortcuts.

File formats

  • *.sprite.json: cosprite/sprite@1. Size, palette, layers, frames (with durations), tags, pivot, and one row string per pixel row: easy to diff and easy for agents to write.
  • *.scene.json: cosprite/scene@1. Viewport, background, grid and placed sprites.
  • The full spec plus the helper CLI (node bin/sprite.mjs info|render|from-png|new) are written to each project's .studio/agent-guide.md, which the agents read.

Project layout

src/            React app (editor, agent panel, previews, tour)
server/         Express + WebSocket server: files, projects, agents, skills, connectors, history, security
shared/         The sprite format, used by both
bin/sprite.mjs  Small CLI for agents and humans (render, info, convert)
tests/          Vitest: parsers, server API, security guards

How the agents are driven: chat mode runs claude -p --output-format stream-json (or codex exec --json) per message and resumes the same session; terminal mode runs the interactive CLI in a pseudo-terminal. Model lists come from Claude Code's initialize handshake; connectors from claude mcp list.

Security

The server can start AI agents and shells, so it only listens on 127.0.0.1 and only answers the cosprite page itself (host and origin checks, sandboxed file serving, path checks). Details and how to report a vulnerability: SECURITY.md.

Roadmap & contributing

See ROADMAP.md for what's next (sound on the timeline, palette lock, light pass, and more) and CONTRIBUTING.md to get started.

License

MIT. Third-party components and their licenses are listed in THIRD_PARTY_NOTICES.md.

Explore related projects

Loading…