same-api-dev-and-production

Status: IN

FTL2 uses the same `automation()` context manager, module addressing, and error handling API for both development scripts and production deployments — there is no separate deployment-specific interface.

Source: repo:ftl2-servercraft/ftl2_servercraft/__init__.py

Example

# Dev script and production watchdog use identical API:
# dev script:
async with automation(check_mode=True) as ftl:
    await ftl.file(path="/tmp/test", state="touch")

# production watchdog (same API, different parameters):
async with automation(
    state_file=str(config.state_path),
    fail_fast=True, quiet=True, auto_install_deps=True,
) as ftl:
    while active:
        count = await script.get_player_count(ftl, config)
        await asyncio.sleep(poll_interval)

JSON