This repository contains Pixlet apps in the apps/ directory.
Scaffold a new app: pixlet create apps/<appname>
pixlet lint: Checks for common issues and style problems.pixlet check: Validates correctness and best practices.pixlet format: Auto-formats code for consistency.
Run a live-reloading local server for rapid iteration: pixlet serve apps/<appname>/<app_name>.star.
Generate a preview image before publishing:
pixlet render -z 9 apps/<appname>/<app_name>.star
# For 2x support preview:
pixlet render -2 -z 9 apps/<appname>/<app_name>.starScreenshot paths will be apps/<appname>/<appname>.webp and apps/<appname>/<appname>@2x.webp.
- No
try/catch: Starlark lacks exception handling. Use conditional checks instead. - Skipping Rendering: Return an empty array (
return []) in your main function to skip rendering for the current cycle (e.g., when data is unavailable). - Loading Local Files: Load local assets directly into global variables using the
filetarget. For example, this loadsapps/<appname>/images/example.png:load("images/example.png", EXAMPLE_IMAGE = "file")
Manage complex settings with a config file/schema. Pass configuration arguments via the CLI during development:
pixlet render apps/<appname>/<app_name>.star key=value- For sensitive values like API keys or passwords, schema definitions should use
secret = True. - For boolean options (from schema.Toggle), values should be retrieved using
config.bool("key")instead ofconfig.get("key").
- 2x apps render at 128x64 instead of the standard 64x32.
- Check the
canvasmodule:canvas.size()returns(width, height);canvas.width(),canvas.height(),canvas.is2x(). - Common patterns:
WIDTH, HEIGHT = canvas.size() SCALE = 2 if canvas.is2x() else 1
- Multiply/divide sizes by
SCALE(use//or convert toint; floats are rejected). - Default 1x font is
tb-8; default 2x font isterminus-16. - Animations: If using
render.Marquee, halve the delay for 2x to maintain scroll speed. If halving the delay speeds up embeddedrender.Imageanimations, use the image'shold_framesparameter to slow it back down.
- Modules | Widgets | Animation | Schema | Filters
- Fonts: Run
pixlet community list-fontsor view the Fonts Reference. - Icons: Run
pixlet community list-icons.