POLYTONE — the AI-native programming language

Guide

Command-line tools

Since Sprint 23, programs read their arguments and environment — render pipelines become real CLI tools.

tool.pt
fn main() -> Void:
    let a = args()
    if a.len() != 2:
        print("usage: ptc run tool.pt <input> <output>")
        return
    let mode = env("TOOL_MODE")
    print("rendering {a[0]} to {a[1]} (mode: {mode})")

args() -> List[Text] holds everything after the file on the ptc run command line — no argv[0] to skip, no separate count, and main keeps its single canonical shape. env(name) -> Option[Text] reads an environment variable; unset is None, never an error. Both names are reserved builtins like print.