PocketOS

PocketOS Install

Source: PocketOS README.md (curated). Raw: /raw/pocketos/README.md.

PocketOS

A modular pocket computer OS for CC: Tweaked, styled after the pocket UI of cc-mek-scada (MIT). Targets the Ender Advanced Pocket Computer — the only peripheral you need is the ender modem.

Ships with almost nothing on purpose. The OS boots into a home grid with just Store, Guide (docs), Config and About. Bank, Chat, Shop and anything else are installed from the Store — the OS is a platform, not a bundle.

PocketOS/
├── installer.lua           <- one-shot installer (wget this)
├── install-manifest.json   <- generated by tools/make_install_manifest.py
├── startup.lua             <- OS boot entry
├── pocketos/               <- the OS (installed onto the pocket)
│   ├── config.lua          <- global + per-app config (JSON, per-app folders)
│   ├── shell.lua           <- app registry, navigation, event dispatch
│   ├── store.lua           <- app store: manifest fetch, install/update/rollback
│   ├── sdk.lua             <- what downloaded apps see
│   ├── renderer.lua        <- UI lifecycle
│   ├── util.lua / tcd.lua / psil.lua
│   ├── graphics/           <- UI framework (from cc-mek-scada, MIT)
│   ├── ui/                 <- OS shell UI (home grid, header, sidebar)
│   └── apps/               <- built-ins ONLY: store, docs, settings, about, oobe
├── store-apps/             <- the "official" store catalog (host these too!)
│   ├── manifest.json       <- store manifest (Bank/Chat/Shop/Notes)
│   ├── bank.lua            <- Numismatics banking (self-contained)
│   ├── chat.lua            <- pocket-to-pocket DMs w/ offline inbox
│   ├── shop.lua            <- demo shop: catalog + linked pay
│   ├── shop-catalog.json   <- example shop catalog
│   └── notes.lua           <- SDK example app
├── backend/
│   └── bank_backend.lua    <- runs on a NORMAL computer at the bank
├── docs/APP_DEV.md         <- how to write apps
├── tests/                  <- offline test harness (desktop Lua)
└── tools/make_install_manifest.py

Install (one wget)

Host this repo on any static file server — Cloudflare Pages is perfect (push the repo, done; every file is served at its repo-relative path).

On the pocket, edit nothing — just:

wget https://computercraft.petroid.xyz/pocketos/files/installer.lua startup
reboot
  • startup (the installer) downloads the OS file list from install-manifest.json, writes /pocketos/* + /startup.lua over itself, pre-fills the store manifest URL, and reboots into the OS.
  • Re-running it later updates the OS in place; settings and installed apps are kept.
  • No wget run needed; plain wget + reboot works everywhere.

Bank backend (separate computer at the bank, next to a PTR Utilities Card Reader + a Numismatics Bank Terminal + a modem):

wget https://computercraft.petroid.xyz/pocketos/files/backend/bank_backend.lua bank_backend.lua
bank_backend.lua

Default apps (that’s the point)

AppBuilt-inNotes
Storeyesinstalls everything below
Guideyesdocs in-OS
Configyesname, manifest URL, channels
Aboutyessystem info
Bankvia StoreNumismatics: quick pay + linked sub-account payments
Chatvia Storepocket-to-pocket DMs, offline inbox
Shopvia Storedemo “amazon”: catalog + linked pay + shopkeeper ping
Notesvia StoreSDK example

App store details

  • The manifest is a JSON file anywhere HTTP can reach — gist, your Pages domain, whatever. Configure its URL in OOBE/Config.
  • Relative URLs are supported: a manifest at https://you.store/manifest.json can list "url": "apps/bank.lua" and it resolves to https://you.store/apps/bank.lua. Moving hosts = edit one line.
  • Versions + rollback: installs write /apps/<id>/main.lua and keep the previous version at /apps/<id>/prev.lua. When a developer ships a broken 1.0.1, the Store shows a Rollback button — one tap, back to 1.0.0. Updates are never automatic; you tap Install/Update/Rollback.
  • Manifest fetches are cache-busted so gists/CDNs can’t serve stale catalogs.
  • Each app gets a private config folder at /apps/<id>/config/.

Banking & security model

Two ways to pay, neither compromises the card-session security:

  1. Quick Pay — tap any card at the bank’s Card Reader, transfer from the pocket within 60s. Session consumed on use. Physical presence = auth.
  2. Linked Pay (for shops/recurring) — in your Bank Terminal create a sub-account with a spend limit + an authorized card bound to it. Tap that authorized card at the bank’s reader once, press Enroll: the backend binds your pocket’s computer ID to that sub-account. From then on, payments go via bank.transfer(accountID, authorizationID, ...) with no expiry — and Numismatics itself enforces the spend limit. A stolen pocket can only spend up to the cap you set; unlink anytime.

The bank backend (backend/bank_backend.lua) implements both, exactly like the physical ATM flow (card sessions) plus the official sub-account automation flow from Numismatics.

Writing apps

Single Lua file, sandboxed environment, per-app config, UI elements, pocketos.set_handlers{ on_modem=..., background_modem=... } for networking. Full reference: docs/APP_DEV.md. Example: store-apps/notes.lua. The Bank/Chat/Shop apps in store-apps/ are the best real-world examples.

Tests

lua tests/harness.lua .    # desktop Lua 5.4, no CC needed

Covers module loading, every UI element, store install/update/rollback, sandboxed app execution, background chat inbox, and the full UI boot.

Credits

  • UI framework & inspiration: cc-mek-scada by MikaylaFischler (MIT License). pocketos/graphics/* and parts of util/tcd/psil are derived from that project.
  • Banking uses PTR Utilities (card reader, server monitor) + Create: Numismatics CC integration.