CLI
teslo-cli is a JSON-first CLI wrapper for teslo. It is designed for terminal usage, scripts, and automation with JSON input, JSON output, and machine-readable errors.
Installation
Install teslo-cli globally:
npm install -g teslo-cliOr run it without a global install:
npx teslo-cli duel --input '{"players":[{"id":"1","elo":1000},{"id":"2","elo":900}],"winner":"1"}'Quickstart
Run a duel from the command line:
teslo duel --input '{"players":[{"id":"1","elo":1000},{"id":"2","elo":900}],"winner":"1"}'Output:
[
{
"id": "1",
"elo": 1012
},
{
"id": "2",
"elo": 888
}
]Commands
teslo-cli supports the same match types as the library:
teslo duelteslo free-for-allteslo team-duelteslo team-free-for-all
Input Modes
Provide input in exactly one of these ways:
--input <json>--file <path>stdin
File input:
teslo duel --file ./match.jsonstdin input:
echo '{"players":[{"id":"1","elo":1000},{"id":"2","elo":900}],"winner":"1"}' | teslo duel --format jsonOutput
Results are emitted as JSON. Errors are also emitted as JSON, which makes teslo-cli a good fit for scripts and AI agents.