DocsCLI

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-cli

Or 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 duel
  • teslo free-for-all
  • teslo team-duel
  • teslo 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.json

stdin input:

echo '{"players":[{"id":"1","elo":1000},{"id":"2","elo":900}],"winner":"1"}' | teslo duel --format json

Output

Results are emitted as JSON. Errors are also emitted as JSON, which makes teslo-cli a good fit for scripts and AI agents.