Command Line Interface: Difference between revisions
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..." |
m Text replacement - "Zaparoo (Software)" to "Zaparoo Core" |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
All [[ | All [[Zaparoo Core|Zaparoo 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 Zaparoo works on, and can be safely used as a scripting target. | ||
The name of the | The name of the Zaparoo core binary may differ slightly between platforms. The examples on this page will target [[MiSTer FPGA|MiSTer]] which ships with a binary named <code>tapto.sh</code>, whereas Windows ships with a binary named <code>Zaparoo.exe</code>. 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. | 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. | ||
Line 17: | Line 17: | ||
* '''Example:''' <code>./tapto.sh -version</code> | * '''Example:''' <code>./tapto.sh -version</code> | ||
Outputs this | Outputs this Zaparoo binary's build version (not the currently started API service). | ||
== API Request == | == API Request == | ||
Line 25: | Line 25: | ||
* '''Example:''' <code>./tapto.sh -api 'launch:{"text":"**launch.system:menu"}'</code> | * '''Example:''' <code>./tapto.sh -api 'launch:{"text":"**launch.system:menu"}'</code> | ||
Sends a single request to the [[API| | Sends a single request to the [[API|Zaparoo API]], waits for a response and then outputs the result body of that response. | ||
== Launch == | == Launch == |
Latest revision as of 00:10, 30 November 2024
All Zaparoo 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 Zaparoo works on, and can be safely used as a scripting target.
The name of the Zaparoo 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 Zaparoo.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 -help
The 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 Zaparoo 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 Zaparoo 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.