Aseprite-style pixel art studio: the AI draws sprites stroke by stroke with selections, layers, animation frames, gradients, symmetry and reference layers, each step rendered live as ANSI terminal frames.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:KongChengZhi/dsh-pixel-studio#path:/dsh-cli-anything-aseprite
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
dsh-cli-anything-aseprite
Aseprite pixel-art studio for DeepSeek Harness (DSH).
An agent-usable CLI harness for the Aseprite pixel-art editor, built with the CLI-Anything methodology, plus a DSH plugin that turns it into 19 model tools. The AI draws pixel art like a human — one deliberate stroke at a time — and every stroke is rendered live as an ANSI terminal frame, so humans can watch the AI work in real time.
DSH 像素画工作室:AI 像人类一样分步绘制像素画(打形→底色→阴影→高光),
每一步操作实时渲染到终端,人类全程可见。
✨ Features
- Human drawing vocabulary: pixel / line (Bresenham) / rect / ellipse / flood fill / eraser — plus symmetry (h/v/both), tiled mode (seamless textures), gradient (rgb16 interpolation).
- Selection (Aseprite semantics): fill / stroke / clear / copy (persistent clipboard) / paste / move / get.
- Layers: add / remove / duplicate / merge / opacity / visibility / reference layers (rotoscoping, excluded from render).
- Animation: frames, durations, frame tags, onion-skin ghost rendering in the terminal.
- Canvas: free size 1..1024², presets (icon…max), resize with 9-grid anchor, nearest-neighbor rescale.
- Colors: classic palettes (pico8/db16/sweetie16/na16) + rgb16:r,g,b 4096-color mode (16×16×16 indexed RGB).
- Export: PNG (nearest upscale) / animated GIF / sprite sheet PNG+JSON / PNG sequence / native .aseprite binary (hand-written ASE writer, opens in the real Aseprite).
- Undo/redo across CLI processes (sidecar persistence), crash-safe concurrent saves.
- 75/75 tests (unit + E2E, including byte-level .aseprite format checks).
- Live monitor UI (optional): a draggable overlay with the ANSI canvas, preview zoom, layer opacity sliders and export buttons.
- DSH 0.1.x and 0.2.x: the plugin detects whether the host's shell
executor exposes
run()(0.1) orexecute()(0.2) and adapts; commands are built forbash -con POSIX andpwsh -Commandon Windows.
📦 Install
1. Install the Python harness
pip install -e ./python # provides the `cli-anything-aseprite` CLI
Requires Python ≥ 3.10, click, Pillow. No Aseprite binary needed — the
harness implements the document model, drawing primitives, and the native
.aseprite file format itself. If a real aseprite binary exists, set
ASEPRITE_BIN to enable advanced batch conversion.
2. Install the DSH plugin
From a checkout:
dsh plugin add ./dsh-cli-anything-aseprite
From npm (once published):
dsh plugin add dsh-cli-anything-aseprite
From GitHub:
dsh plugin add github:YOUR_USER/dsh-cli-anything-aseprite
Then verify the layer applied:
dsh --dump-config | grep cli-anything-aseprite
The plugin registers 19 pixelart_* tools in every session of that profile.
Workdir defaults to ~/.dsh/aseprite-work — expanded to the real home directory
on every platform, and created on first use — and can be overridden with the
plugin config: workdir: row or the ASEPRITE_WORKDIR env var. Set
ASEPRITE_CLI (or config: cli:) when the harness executable is not on PATH.
🚀 Quick start (AI draws a sprite)
- Open a DSH session (profile with this bundle installed).
- Ask: "画一个 32×32 的像素勇者,pico8 调色板" — or drive the tools manually:
pixelart_new {name: "hero", preset: "sprite", palette: "pico8"} pixelart_draw {op: "line", x: 9, y: 7, x1: 9, y1: 13, color: "#1d2b53"} pixelart_draw {op: "rect", x: 10, y: 7, w: 12, h: 7, color: "#1d2b53"} pixelart_draw {op: "rect", x: 10, y: 7, w: 12, h: 4, color: "#ff004d", fill: true} pixelart_terminal {} # → live ANSI frame (human-watchable) pixelart_export {format: "png", scale: 8} pixelart_export {format: "aseprite"} # → hero.aseprite, opens in Aseprite - Watch the terminal frame after every stroke — the AI's canvas is always visible.
🗂️ Project layout
dsh-cli-anything-aseprite/
├── src/index.js # DSH Host plugin: 19 pixelart_* tools (defineTool)
├── cordis.patch.yml # DSH bundle patch layer
├── package.json # dsh.bundle manifest
├── python/ # cli-anything-aseprite Python harness
│ └── cli_anything/aseprite/
│ ├── core/ # model, canvas (drawing+symmetry+tiled+gradient),
│ │ # palette, layers, animation, export (.aseprite
│ │ # binary writer), session (undo)
│ ├── utils/ # terminal (ANSI frames + onion skin), io, backend
│ ├── tests/ # TEST.md plan + 75 tests
│ └── skills/SKILL.md # AI pixel-art methodology (human drawing passes)
└── cordis.patch.yml # DSH bundle patch layer
🧪 Test
python3 -m pytest python/cli_anything/aseprite/tests/ -q # 75 passing
🏗️ How it works (architecture)
model tools (pixelart_*) DSH Host plugin (src/index.js)
│ JSON args
▼
cli-anything-aseprite --file X.pxa --json <cmd> Python harness (python/)
│
├── core/canvas.py drawing primitives → sparse cel model
├── core/export.py PNG/GIF/sheet/PNG-seq + .aseprite binary writer
└── utils/terminal.py ANSI truecolor half-block frames (human view)
State persists per project as <name>.pxa (JSON document) + sidecars
(.history.json undo stack, .clipboard.json selection clipboard,
.modes.json symmetry/tiled) — so undo, clipboard and modes survive separate
CLI processes, exactly like a real editor session.
Every mutating tool refreshes the in-memory state and returns version, which
drives the live monitor UI (polling pix-state).
📚 References
- Aseprite CLI docs · New Sprite dialog
- CLI-Anything (HKUDS)
- DSH plugin packaging:
docs/user/develop/basic/publish.zh.md(bundle manifests,dsh plugin add, npm/git install)
License
MIT — see LICENSE.
Links
More in this category
PC2005-cloud/dsh-pet#dsh-pet★ 6184
Desktop pet for the DSH Web UI on Windows, macOS and Linux: 106 transparent animations in the browser overlay or a transparent always-on-top desktop window, throw-and-bounce drag physics with squash and particle scoring, a work-status bubble driven by live session events, self-talk and chat with persistent memory, balance display, meme-image bubbles, multiple pets on screen, and drop-in custom animations and pet packs.
flizzywine/dsh-tavern#dsh-tavern★ 1589
An agent-powered tavern for DeepSeek Harness with SillyTavern compatibility, character card imports, support for multiple models, and mobile play. Install the tavern from Settings → Tavern Launcher on desktop. A launcher derived from 2NF/dsh-profile-bridge (MIT): it downloads the tavern into a separate DSH profile and switches profiles on restart. Install this launcher or the upstream plugin, not both — they claim the same /profile-bridge channel.
Alterssss/dsh-bili-whale★ 1036
A Bilibili companion that keeps its own schedule. A 60-second tick in the plugin host wakes a dedicated agent session at a random moment inside the configured time windows (opting out of a day is a configurable chance), then hands it a bundled CLI of 38 subcommands — feed, subtitles, danmaku, comments, ffmpeg frame grabs, and two diaries. Shares at most N items a day by commenting on them and @-mentioning the owner (default 3, enforced from a written quota log, and it stops on rate-limit or captcha signals). Also polls comment replies, direct messages and live-room danmaku; replies to anyone but the owner are queued for approval in Settings. Settings → 养鱼 writes ~/.dsh/bili-whale.config.json; cookies live separately in ~/.bili-ai/credentials.json and are never echoed back. The HTTP routes are loopback-only behind DSH's trust fence. Needs Node 18+ and ffmpeg on PATH for frame extraction.
Nagi-ovo/dsh-ads★ 719
Parody ads in 2005-Chinese-web style: sidebar banners, in-chat feeds, corner popups, and a close button whose hit area is smaller than it looks. All fictional.
yyh-001/dsh-meme★ 565
Chat meme stickers: text-only send, mood auto-send, QQ/WeChat-style picker, auto-learn, custom packs.
vlln/whale-girl★ 407
Desktop pet (QQ-pet style): floats in the corner, draggable, feedable, playable.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.