| .plans | ||
| apis | ||
| docs | ||
| packages | ||
| programs | ||
| servers | ||
| startup | ||
| tests | ||
| .env.test | ||
| .gitignore | ||
| .luacheckrc | ||
| CLAUDE.md | ||
| DEVELOPMENT.md | ||
| install.lua | ||
| Justfile | ||
| manifest.json | ||
| README.md | ||
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 theeventlooplibrary.
Servers
Servers listed in manifest.autostart are launched at boot by startup/servers.lua.
/servers/ping-server: allows a machine to respond to apingcommand.
Programs
router: routes messages. You need to set up a router to use allapis/net-based programs and libraries.ping: pings machines usingapis/net.events: emits and logs computer events.upgrade: upgrades the machine. Reads/trapos/manifest.jsonto stay on the current branch; use--betato opt in or--stableto opt out.
Development
See DEVELOPMENT.md for development setup and workflow.