fork of guillaumearm/cc-libs github repo
Go to file
2026-06-08 21:05:31 +02:00
.plans chore: updated grilled plan 2026-06-08 20:53:35 +02:00
apis feat(ai): add hello world proxy client 2026-06-08 21:05:31 +02:00
docs test(harness): use test env for timeouts 2026-06-08 19:22:32 +02:00
packages feat(ccpm): add package manager 2026-06-08 13:52:45 +02:00
programs feat(ai): add hello world proxy client 2026-06-08 21:05:31 +02:00
servers chore: remove cube and goo programs 2026-06-07 19:45:00 +02:00
startup fix(startup): avoid reboot after shell exit 2026-06-08 20:20:46 +02:00
tests feat(ai): add hello world proxy client 2026-06-08 21:05:31 +02:00
.env.test test(harness): use test env for timeouts 2026-06-08 19:22:32 +02:00
.gitignore test(craftos): add eventloop harness coverage 2026-06-08 04:13:22 +02:00
.luacheckrc feat: add goo v1 2026-05-31 01:37:19 +02:00
CLAUDE.md docs: document git hook verification split 2026-06-08 16:36:07 +02:00
DEVELOPMENT.md test(harness): use test env for timeouts 2026-06-08 19:22:32 +02:00
install.lua feat(ccpm): add package manager 2026-06-08 13:52:45 +02:00
Justfile test: forward runtest arguments 2026-06-08 20:21:39 +02:00
manifest.json feat(ccpm): add package manager 2026-06-08 13:52:45 +02:00
README.md feat(ccpm): add package manager 2026-06-08 13:52:45 +02:00

TrapOS

A small in-game operating system for ComputerCraft / CC:Tweaked, built around a single-threaded event loop and a routed networking layer.

Installation

Full install (all packages):

wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua

Minimal install (only tos-core, i.e. just the package manager) so you can cherry-pick the rest yourself:

wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua --core
> ccpm install tos-net
> ccpm install tos-ui

Install the beta branch (one-time opt-in, asks for confirmation):

wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/next/install.lua --beta

Once a machine is on beta, upgrade keeps it on beta — --beta is not needed again. Use upgrade --stable to go back to the stable branch.

After install, every boot shows a colored MOTD with the installed version and branch (lime for stable, orange + [BETA] for beta).

Packages

TrapOS is split into packages, each described by a packages/<name>/ccpm.json:

  • tos-core: the package manager (ccpm), event loop, upgrade, events.
  • tos-test: the test framework (libtest) and suite runner (runtest).
  • tos-boot: the startup MOTD and autostart server launcher.
  • tos-net: routed modem networking (net, router, ping, ping-server).
  • tos-ui: the terminal UI toolkit (libtui, tuidemo).

manifest.json at the repo root lists which packages a full install ships. The bootstrap resolves their descriptors, downloads the files, and writes the aggregated /trapos/manifest.json (version, branch, files, autostart) that drives upgrade, startup/motd.lua, and startup/servers.lua.

ccpm

ccpm is the TrapOS package manager (shipped in tos-core). It is configured at install with a default registry (guillaumearm/cc-libs).

ccpm install <package>     ccpm reinstall <package>   ccpm uninstall <package>
ccpm ls                    ccpm search [term]         ccpm info <package>
ccpm registry ls           ccpm registry add <name> [--branch <b>] [--type github|http]
ccpm registry rm <name>

Registries default to GitHub (owner/repo); http/https base URLs are also supported. State lives in /trapos/ccpm.json (registries) and /trapos/ccpm.lock.json (installed packages). See ADR-0010.

APIs

  • /apis/eventloop: a simple event loop API.
  • /apis/net: an API to simplify sending and receiving routed messages, based on the eventloop library.

Servers

Servers listed in manifest.autostart are launched at boot by startup/servers.lua.

  • /servers/ping-server: allows a machine to respond to a ping command.

Programs

  • router: routes messages. You need to set up a router to use all apis/net-based programs and libraries.
  • ping: pings machines using apis/net.
  • events: emits and logs computer events.
  • upgrade: upgrades the machine. Reads /trapos/manifest.json to stay on the current branch; use --beta to opt in or --stable to opt out.

Development

See DEVELOPMENT.md for development setup and workflow.