Skip to main content

Ghost Build Tool - build and package GhostESP native SD apps

Project description

gbt — Ghost Build Tool

Build and package GhostESP native SD apps from the command line.

Install

pip install ghostbt

Requires Python 3.8+ and ESP-IDF (install via gbt setup).

Quick Start

# Set up ESP-IDF (one-time)
gbt setup

# Create a new app
gbt create my_app --name "My App"

# Build and package
gbt dist ./my_app --gapp

# Flash firmware to device
gbt firmware cardputer
gbt flash firmware --board cardputer --monitor

Commands

Command Description
gbt create <id> Scaffold a new native SD app
gbt build [dir] Build app with ESP-IDF
gbt package [dir] --gapp Package as folder or .gapp archive
gbt dist [dir] --gapp Build + package in one step
gbt setup Install/configure ESP-IDF toolchain
gbt boards List available firmware board configs
gbt firmware <board> Build GhostESP firmware
gbt flash firmware Flash firmware to device
gbt flash app Instructions for loading app via SD card
gbt asset image Convert a PNG into a GhostESP .gimg asset image
gbt asset pack Build an SD-ready asset pack folder or .gtheme bundle
gbt monitor Serial monitor
gbt ports List serial ports

Asset Packs

Create a source folder with a manifest.json and PNG artwork. gbt asset pack converts source images into compact .gimg files and writes a runtime manifest for /mnt/ghostesp/themes/<pack id>/.

{
  "id": "cyberpack",
  "name": "Cyber Pack",
  "version": 1,
  "colors": {
    "accent": "0xFF00FF",
    "background": "0x0A0A0A",
    "surface": "0x1A0A1A",
    "surface_alt": "0x2A1A2A",
    "text": "0xFFFFFF",
    "text_muted": "0xAA88CC"
  },
  "icon_variants": [32, 64],
  "icon_sources": {
    "wifi": "art/icons/wifi.png",
    "bluetooth": "art/icons/bluetooth.png",
    "settings_icon": "art/icons/settings.png"
  },
  "background_sources": {
    "bg_tile": {
      "source": "art/bg_tile.png",
      "width": 64,
      "height": 64,
      "format": "rgb565"
    }
  }
}

Build it:

gbt asset pack ./cyberpack --out ./dist
gbt asset pack ./cyberpack --out ./dist --archive

Install a generated pack folder by copying it to SD as:

/mnt/ghostesp/themes/cyberpack/manifest.json
/mnt/ghostesp/themes/cyberpack/icons/...

Or install an archive by copying the .gtheme to SD as:

/mnt/ghostesp/themes/cyberpack.gtheme

Then use Settings > Appearance > Asset Pack and press left/right to cycle installed packs. Firmware scans /mnt/ghostesp/themes/ for pack folders with manifest.json and for .gtheme archives. The selected pack is saved in NVS.

When loading a .gtheme, firmware streams entries into /mnt/ghostesp/themes/active/ before loading. New .gtheme archives store raw .gimg payloads without deflate compression for safe runtime decoding. Theme SD access uses the same short mount/unmount flow as other SD operations; decoded icons and background tiles stay cached in RAM/PSRAM after each read.

PSRAM vs internal RAM

PSRAM devices: Up to 32 icons cached in PSRAM, tiled or scaled backgrounds supported. Background images smaller than the screen tile automatically; larger images scale to fill using LVGL zoom. A 128x128 background will scale up to fill any screen. Background images are always loaded into PSRAM.

Internal-only devices: 2 icons cached in internal RAM, no background images. Icons fall back to compiled-in artwork when cache is full. The pack still loads colors and icon mappings; only the image cache is limited.

Convert one image directly:

gbt asset image ./wifi.png --out ./wifi_l.gimg --width 64 --height 64 --format rgb565a8

The generated pack folder contains manifest.json, checksums.json, and generated .gimg files. Asset packs store raw .gimg payloads by default so firmware does not run deflate decompression from small UI task stacks. Missing icons are fine; firmware falls back to built-in artwork for any icon not present in the selected pack. Background tiles are loaded from PSRAM only.

Requirements

  • Python 3.8 or later
  • ESP-IDF (auto-installed by gbt setup if missing)
  • Git (for gbt setup)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghostbt-0.2.0.tar.gz (39.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ghostbt-0.2.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file ghostbt-0.2.0.tar.gz.

File metadata

  • Download URL: ghostbt-0.2.0.tar.gz
  • Upload date:
  • Size: 39.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ghostbt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3f03535c034d98a6f8b3a9957ddb84bd7dc5e78b8139cd00e1fc49761a3acefe
MD5 e270ad967fecb92da47ce0288c2b0e5f
BLAKE2b-256 6ee1012d1fcc2fdd05a0640af752314ce587e74b294ed0c77fc31bf8382cd236

See more details on using hashes here.

File details

Details for the file ghostbt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ghostbt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ghostbt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 507e79e6f3633b3e33466050ee5271da1bc8a8c5b4175931c48a6ab7a8b08dec
MD5 8066bf6de211e695af93ec850aa33951
BLAKE2b-256 165316880c14a4a6c582f3b1b4b607120851dde63181b2f25bab73d0b6e0b0bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page