Command Line Interface

From TapTo Wiki

Revision as of 10:32, 4 October 2024 by Wizzo (talk | contribs) (Created page with "All TapTo core distributions ship with a common command line interface (CLI) that can be used to interact with the API. This interface is the same on every platform that TapTo works on, and can be safely used as a scripting target. The name of the TapTo core binary may differ slightly between platforms. The examples on this page will target MiSTer which ships with a binary named <code>tapto.sh</code>, whereas Windows ships with a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

All TapTo core distributions ship with a common command line interface (CLI) that can be used to interact with the API. This interface is the same on every platform that TapTo works on, and can be safely used as a scripting target.

The name of the TapTo core binary may differ slightly between platforms. The examples on this page will target MiSTer which ships with a binary named tapto.sh, whereas Windows ships with a binary named TapTo.exe. Functionally they're the same, just replace the filename in the examples.

If a platform's binary displays a GUI when run without arguments, the GUI will not be display when at least one of these flags are enabled.

Help

  • Flag: -help
  • Argument: none (boolean switch)
  • Example: ./tapto.sh -helpThe most important one. This will output a list of all available command line flags along with a brief summary of each.

Version

  • Flag: -version
  • Argument: none (boolean switch)
  • Example: ./tapto.sh -version

Outputs this TapTo binary's build version (not the currently started API service).

API Request

  • Flag: -api
  • Argument: string
  • Example: ./tapto.sh -api 'launch:{"text":"**launch.system:menu"}'

Sends a single request to the TapTo API, waits for a response and then outputs the result body of that response.

Launch

  • Flag: -launch
  • Argument: string
  • Example: ./tapto.sh -launch "**launch.random:arcade"

Sends the string argument to the API as a launch command, as if a token with that text on it was scanned.

Write

  • Flag: -write
  • Argument: string
  • Example: ./tapto.sh -write "SNES/MyGame.sfc"

If a reader is physically connected to the device and has the capability to write to a token, try to write the given string to that token. Reports an error if the token couldn't be written and times out after 30 seconds.