npm install jspicl-cli -D
In order to generate a cartridge you need to supply at least four mandatory options:
jspicl-cli --input <entryfile.js> --output <outputFile.p8> --spritesheetImagePath <pathToSpriteSheetFile.png> --cartridgePath <pathToExistingCartridge.p8>
|input||string||Your game's entry point. This file can then import other modules.
|output||string||Where to output the PICO-8 cardridge
|spritesheetImagePath||string||Path to a spritesheet file. Only PNGs are supported.
|cartridgePath||string||Path to an existing cardridge to reuse sound, music and state flags from. Normally you would point this to the generated cartridge so that you can save the assets directly and reuse them.
|includeBanner||boolean||Include a short comment at the very top of the generated LUA code that contains info about jspicl. Does not affect token count.|
|luaOutput||string||Where to output the transpiled LUA code. For debugging purposes.|
|showStats||boolean||Display statistics about the generated cartridge. Useful for determining how much resources your game is using.|
|pipeOutputToConsole||boolean||Output all console.log to terminal that launched PICO-8. For debugging purposes.|
|reloadOnSave||boolean||Reload PICO-8 when the cartridge has been updated.|
|customPicoPath||string||Custom path to the PICO-8 executable.|
|prettify||boolean||Format the generated LUA code.|
|watch||Runs the cartridge in PICO-8 and rebuilds it when the source files change.|
The CLI will listen for changes when the
--watch option is passed.
This applies for the spritesheet aswell. Simply save your image and your changes will be reloaded in PICO-8.
NOTE: Reloading the cartridge is currently only supported on MacOS.