1
0
Fork
You've already forked infr
0
twcli again, igs/run sucks dont use it
  • Python 57.2%
  • HTML 42.8%
2026年04月18日 11:34:20 +01:00
src/infr feat: auto input 2026年04月17日 19:35:22 +01:00
.gitattributes chore: add project to git 2026年04月17日 17:50:41 +01:00
.gitignore feat: debain based dockerfile 2026年04月18日 09:11:32 +01:00
.python-version chore: init 2026年04月16日 20:35:52 +01:00
dockerfile docs: how to demo dockerfile 2026年04月18日 09:16:32 +01:00
Project.sb3 chore: add project to git 2026年04月17日 17:50:41 +01:00
pyproject.toml feat: basic implementation 2026年04月16日 22:51:48 +01:00
README.md docs: installation 2026年04月18日 11:34:20 +01:00
uv.lock feat: basic implementation 2026年04月16日 22:51:48 +01:00

infr

this is a python script that uses a headless browser and turbowarp scaffolding to run scratch projects.

It then redirects output from the scratch projects back to stdout. If a breakpoint is raised, the exit code 1 is given. Otherwise the exit code 0 is given.

infr tries to be minimal and avoids doing anything other than just running an sb3 file.

installation

Ensure you have git and uv installed. then proceed. (note that these instructions have not been tested). I can guarantee that this does not work on all systems. Like for archlinux, you will need to install dependencies for playwright manually. An example of how to run infr in docker is provided as the dockerfile. These compatability issues may be improved with the use of selenium or puppeteer over playwright, and maybe even sticking to a pure JS stack. But for now, we are using python+playwright because it works on the systems I need.

  1. git clone codeberg.org/igs/infr --depth=1
  2. cd infr
  3. uv run playwright install --with-deps chromium
  4. uv tool install .

usage

infr is so minimal that it literally just takes in arguments from sys.argv in a pretty stupid way the program will litearlly not work unless you use this syntax:

infr [.sb3 file] [opts] where .sb3 file is a path to an sb3 file, and opts is a JSON object:

All fields are optional:

{
 "headless": true,
 "username": "player",
 "cloudHost": "wss://clouddata.turbowarp.org",
 "projectId": "int or str; default is sha256 hash of the project",
 "timeout": 1000,
 "inputTimeBuffer": 0.1,
 "prompt": "> ",
 "inputs": [], // list of strings to autocomplete inputs, e.g. ["rtk", "yes", "no"]
 "requireAutoInp": false // require all inputs to be from the inputs list; otherwise raise an error
}

I'm not really sure if i should use playwright or selenium. i've used both for projects like this. i'm actually going to use playwright because it appears to be easier to use on windows since i dont actually have chrome installed and i already know how to get it running on gh actions