Lia CLI #
Lia CLI is a command line interface that helps you play Lia as effortlessly as possible. By running it with provided commands listed below, it can setup your bots, generate games, help you with debugging, uploads your bot to the leaderboard and more. To set it up check our Getting started guide.
To run Lia CLI, open up a Cmd.exe or PowerShell.exe on Windows or a Terminal on Linux or macOS, move to the unzipped Lia-SDK and run the commands below with the following structure:
lia.exe <command>
.\lia.exe <command>
./lia <command>
Overview of available commands:#
Name | Short description |
---|---|
help | Details on how to use the tool |
bot | Creates new bot in your favourite language |
play | Starts a game between two bots |
replay | Plays a replay |
upload | Uploads a bot to the online leaderboard |
update | Automatically updates Lia-SDK to new version |
generate | Generates a game and ignores replay |
compile | Compiles a bot |
login | Login to Lia-SDK with your Lia account |
logout | Logout from your Lia account |
account | Prints out currently logged in user |
settings | Manages usage data tracking |
Commands#
help#
Help provides help for any command in the application. Simply type lia help [path to command] for full details.
Usage:
lia help [command] [flags]
Flags:
-h, --help help for help
Examples:
lia help # General help
lia play help # Detailed help for command 'play'
bot#
Creates a new bot with the name and language of your choosing. The folder where the bot is located is created in the same folder as Lia CLI. It contains the starting code for the bot in chosen language and is ready to run (although it probably won’t win any games yet). The base of the code is located in MyBot.* file.
Usage:
lia bot <language> <name> [flags]
Flags:
-h, --help help for bot
Example:
lia bot java BestBot # Creates a java bot named BestBot
To check which languages are supported run:
lia --languages
play#
Compiles both bots and then runs the game between them. After the game completes loading, replay viewer is launched so you can watch the game.
Usage:
lia play <name1> <name2> [flags]
Flags:
-c, --config string choose custom config
-d, --debug ints specify which bots you want to run manually, Examples: -d 1,2 -- debug bot1 and bot2, -d 2 -- debug bot2)
-g, --gseed int game seed. 0 means random
-h, --help help for play
-M, --map string path to custom map settings
-m, --mseed int map seed. 0 means random
-p, --port int port on which game generator will run. Default is 8887
-r, --replay string choose custom replay name and location
-v, --viewReplay if set, the replay will not be opened in replay viewer (default true)
-w, --width string choose width of replay window, height will be calcualted automatically
Example:
lia play BestBot WorstBot -g 2 -m 3 # Plays a game between bots BestBot and WorstBot with fixed specified game and map seeds
replay#
Runs a replay viewer. If path to the replay file is set as an argument then that replay is played, else file chooser is opened.
Usage:
lia replay [pathToReplay] [flags]
Flags:
-h, --help help for replay
-w, --width string choose width of replay window, height will be calculated automatically
Examples:
lia replay replays/my_replay.lia # Plays a specified replay
lia replay # Opens up a replay file chooser
upload#
Uploads the bot to Lia leaderboard. Before uploading it compiles it and removes redundant files. After a successful upload, user’s profile page is opened in the browser.
Usage:
lia upload <botDir> [flags]
Flags:
-h, --help help for upload
Examples:
lia upload John
update#
Automatically updates Lia-SDK to a new version.
Usage:
lia update [flags]
Flags:
-h, --help help for update
Examples:
lia update
generate#
Generates a game. Used in cases when you want to run multiple games with same bots. It will not start the replay viewer when the game ends and it will also not compile or prepare your bots before every game.
Usage:
lia generate <name1> <name2> [flags]
Flags:
-c, --config string choose custom config
-d, --debug ints specify which bots you want to run manually, examples: -d 1,2 -- debug bot1 and bot2, -d 2 -- debug bot2)
-g, --gseed int game seed. 0 means random
-h, --help help for generate
-M, --map string path to custom map settings
-m, --mseed int map seed. 0 means random
-p, --port int port on which game generator will run. Default is 8887
-r, --replay string choose custom replay name and location
Example:
lia generate BestBot WorstBot # Generates a game between BestBot and WorstBot
compile#
Compiles and prepares the specified bot.
Usage:
lia compile <name> [flags]
Flags:
-h, --help help for compile
Examples:
lia compile John # Compiles a bot named John
login#
Used to login the user to Lia-SDK with Lia account.
Usage:
lia login [flags]
Flags:
-h, --help help for login
Examples:
lia login
logout#
Logs out the user from Lia-SDK.
Usage:
lia logout [flags]
Flags:
-h, --help help for logout
Examples:
lia logout
account#
Prints out the username of a user that is currently logged into Lia-SDK.
Usage:
lia account [flags]
Flags:
-h, --help help for account
Examples:
lia account
settings#
Lets you change the usage data tracking settings and tracking id settings. You can opt-in, opt-out, or reset tracking id.
Usage:
lia settings [flags]
Flags:
-i, --analytics-opt-in Opt-in for anonymous analytics usage report
-o, --analytics-opt-out Opt-out from anonymous analytics usage report
-h, --help help for settings
-t, --reset-tracking-id Reset anonymous tracking ID
Example:
lia settings # View current settings