@utkarshx/r36-tic80-portal-cli
v1.0.0
Published
CLI for managing TIC-80 game assets in an R2-backed worker.
Readme
R36 TIC-80 Portal CLI (Node.js)
This CLI is the PC-side tool for:
- uploading
.tic/.tic80files to the R2-backed Worker API - listing your stored builds
- cleaning stale versions from a prefix
It is designed for local use and EmuELEC packaging workflows (upload from Windows/WSL, download on-device through the port app).
Defaults
- Built-in worker endpoint:
https://r36-tic80-portal-api.arrowai.workers.dev --apiis optional and falls back to the built-in default.- Upload token can be passed via:
--tokenWORKER_UPLOAD_TOKENenv var- interactive prompt (when run in a terminal)
Setup
cd /mnt/d/videogames/r36-tic80-portal/tools/portal-cli
npm installAuthentication behavior
For upload and clean, token is required.
- If
--tokenis omitted, CLI checksWORKER_UPLOAD_TOKEN. - If neither exists, it prompts:
Upload token:--token always takes precedence over env and prompt.
Commands
1) List
List all supported game files in a prefix (default: games):
node cli.js list --path games --exts tic,tic80Optional:
--api <url>override default worker URL--cursor <next-cursor>for pagination--limit <n>max items per page
You can also pass --prefix instead of --path for list.
2) Upload one file
node cli.js upload --file ./mygame.tic --token 123456Optional key override:
node cli.js upload --file ./mygame.tic --key games/mygame.tic80--api is optional in all upload cases.
3) Upload folder
node cli.js upload \
--dir ./rom-folder \
--path games \
--exts "tic,tic80,zip" \
--token 1234564) Sync mode (directory upload behavior)
--sync-mode controls how local paths map into object keys:
preserve(default): keep local folderszone/game.tic->games/zone/game.tic
flat: only upload by filenamezone/game.tic->games/game.tic
per-folder: keep only first folder under upload root in key structuregames/zone/game.tic->games/zone/game.ticgame.tic->games/misc/game.tic
node cli.js upload --dir ./rom-folder --sync-mode per-folder --path games --token 1234565) Clean old versions
List matching keys for deletion (dry-run by default):
node cli.js clean --prefix games --older-than-days 30 --keep-latest 5 --exts tic,tic80Perform deletion:
node cli.js clean --prefix games --older-than-days 30 --keep-latest 5 --exts tic,tic80 --executeForce dry-run explicitly:
node cli.js clean --prefix games --dry-runPackage scripts
npm run listnpm run uploadnpm run cleannode cli.js ...for all custom usage.
Notes
listdoes not require a token.uploadandcleanrequire token input or token-like auth.- Use
--apionly when you want to point to another worker.
