Date: 2026-05-11
Time: 15:23
ftl2-servercraft is a full application built on FTL2 that manages game server lifecycles (Minecraft NeoForge and Terraria) on Linode infrastructure. It demonstrates FTL2 used not as a one-off automation tool but as the infrastructure layer for a complete application with a TUI dashboard, background watchdog, backup/restore, and automatic idle teardown.
automation() context manager as its sole mechanism for remote operations — provisioning, monitoring, backup, and teardown all flow through FTL2 module calls over SSH.provision, startserver, verifyserver, restoreworld, backupworld, getplayercount, saveandstop, destroy), loaded dynamically via get_script(name).ftl.terraria.*, NeoForge uses ftl.minecraft.* — these are Ansible inventory groups, showing how FTL2 inventory groups organize multi-service automation.LINODETOKEN, SLACKTOKEN) are mapped to module parameters via secret_bindings in the automation context, demonstrating FTL2's secret management without Vault.
# FTL2 automation context — the core pattern
async with automation(...) as ftl:
# Module access via attribute chains (group.module)
ftl.minecraft.shell(cmd="...")
ftl.terraria.dnf(name="...")
# Secret bindings in automation context
async with automation(
secret_bindings={"LINODE_TOKEN": ..., "SLACK_TOKEN": ...}
) as ftl:
...
# CLI entry points
ftl2-servercraft # Run the TUI
ftl2-servercraft status # Check status without TUI
ftl2-servercraft --config my-servers.yml # Custom config
# Development install
uv pip install -e .
# servers.yml structure
# Each entry specifies: script type, config_dir, and server params
# script: <game> maps to ftl2_servercraft/scripts/<game>.py
terraria, minecraft) are used to target operations, showing real-world inventory group usage.ftl.group.module(params)) are the primary API surface for all remote operations.secret_bindings parameter of automation() as an alternative to full Vault integration for environment-variable-based secrets.automation() context manager is the entry point for all FTL2 remote operations — used with async with.ftl.<inventorygroup>.<modulename>(param=value).secret_bindings maps environment variables to module parameters without requiring Vault.