Bash.tv → GitHub → itch.io

Package any Bash game for itch.io as an HTML5 ZIP that plays in the browser, and hand it to the user. Picks the right format automatically. A standalone ZIP of the game's own files for self-contained games, or a live wrapper that embeds the Bash game in an iframe for games that need Bash's server (multiplayer, shared saves, accounts, API routes). Works out the embed size, places the Made on Bas...

Download skill (.zip) Files on GitHub

Export a Bash game to itch.io

Result: one ZIP that itch.io plays in the browser, plus a .itch-settings.txt with the exact numbers to enter on itch.io. Don’t send the user a questionnaire. Work out the format, size and badge from the game, then tell them what you picked.

B=<skill>/scripts/build_itch_zip.py
python3 $B detect <project-folder>       # → mode, game folder, build command, size hint (JSON)

1. Pick the format

detect says Use Why
standalone (no server, rooms, accounts or /api calls) Standalone: the game’s own files Loads fast, works if Bash is down, no Bash page around it
wrapper (server folder, /api/…, WebSocket, useBash(), shared values or rooms) Live wrapper: an iframe of the Bash game Those features only exist on Bash. A copy of the files would load but not work

The user’s words override it: “offline”, “self-contained”, or “without Bash” → standalone (strip or replace server features first, and say what stops working). “Live”, “always up to date”, or “same as on Bash” → wrapper. Mention the choice in one line, for example “It’s a single-player game, so I packaged the game files themselves. It doesn’t need Bash to run.”

2a. Standalone

  1. Build if detect reports a build_command (for example npm run build), then package its output folder (dist/).
  2. Check the game folder. If the bash-web-game-checkup skill is installed, run it with --platform itch and fix errors first. The builder itself blocks absolute paths (/game.js), names that differ only by capital letters, more than 1,000 files and over 500 MB. It skips junk (.git, node_modules, .map, .env*, .DS_Store).
  3. Size: the game’s own play area. Use size_hint when it matches what you see. Otherwise look at the game. Responsive games: 960×540 (16:9) or the shape that suits them (for example 540×960 portrait). Fixed canvas: its native size.
  4. Build:
    python3 $B standalone dist --output /tmp/itch/my-game-itchio.zip --width 960 --height 540 --title "My Game"
    

    Use the printed path. It gets an _WxH suffix when the size isn’t 960×540.

  5. Bash.js in the game is harmless on itch.io (it simply finds no Bash). Remove it only if the user asks.

2b. Live wrapper

Get a link that works signed out. Try these in order:

  1. A share link the user gave in this conversation, or one saved for this space (~/.bash-private/share-links/<space-id>.json, outside any repo).
  2. The app’s public Bash page: window.bash.space.publicUrl (for example https://bash.tv/name/game), read in the preview.
  3. The raw preview URL from open_preview. Only if it loads the game signed out (not “This preview isn’t available”). Then pass the Bash page as --space-url for the badge.

Open the candidate signed out (sandbox browser, or check_gpu_render for WebGL) and make sure the game loads, not an access page. A 200 response alone doesn’t prove it. If nothing works, ask once: “Please paste this game’s link from Bash’s Share button. I’ll remember it for this space.” Save it to the per-space file. Keep links exactly as given, including ?sc=… and #…. Never use a /chat/… URL as the game, and never copy a __bash_token (it expires). Share codes can grant access, so don’t publish a private game’s link without a yes.

Size and fit. --width/--height is the game area. The default badge bar adds 64 px outside it, so a 960×540 game needs a 960×604 itch embed. The builder works that out. Don’t add the 64 yourself.

Badge. Six positions: top|bottom × left|middle|right (--badge-position, plus --mobile-badge-position for ≤480 px). The default --badge-layout bar keeps it off the game. Use overlay only if that corner is empty on the title screen, during play, on the pause and results screens, and on phone sizes. If no corner stays empty, keep the bar.

python3 $B wrapper 'https://bash.tv/name/game?sc=CODE#FRAG' --output /tmp/itch/my-game-itchio.zip \
  --width 960 --height 540 --fit responsive --badge-position bottom-right --title "My Game"

The ZIP holds index.html and two badge SVGs. It needs internet and the Bash game to be reachable, so say so.

3. Test before handing it over

  1. Unzip into a temp folder, serve it (python3 -m http.server), and load it inside an iframe at the embed size, like itch.io does. Also try 640×360, a phone in portrait (390×844), and resizing.
    • 2D / DOM games: sandbox Playwright. WebGL / 3D: check_gpu_render (never load WebGL in the sandbox browser).
  2. Check that the title or start flow works, controls respond (mouse, touch and keys after a click), nothing is clipped, the badge doesn’t cover anything, and there are no console 404s.
  3. Run the unit tests after changing the builder: python3 -m unittest discover -s <skill>/scripts -p 'test_*.py'.

Say plainly what wasn’t tested, for example “not tried on itch.io itself yet”.

4. Deliver

5. What the user does on itch.io (the API can’t)

From .itch-settings.txt, once per game: Edit game → Kind of project: HTML → upload the ZIP → tick This file will be played in the browser → Embed options: Embed in page, the Embed width/height from the settings file (not the game area when there’s a badge bar), ✅ fullscreen button → Mobile friendly only after a phone test → Save → View page and play. Later uploads with the same channel keep these settings.

Checklist