How to Download and Install Cogment¶
Install the latest Cogment CLI¶
Installation script (compatible with linux and macOS for
To install the latest version of the Cogment CLI for virtually any Linux distribution, macOS and WSL2 on windows, run the the following command:
curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash
To install a specific version (here v1.0.0) run the following command:
curl --silent -L https://raw.githubusercontent.com/cogment/cogment-cli/main/install.sh | sudo bash -s -- --version v1.0.0
Uninstall is as simple as running:
sudo rm $(which cogment)
Manual installation (compatible with linux, macOS and windows for
For windows user (and also if you prefer to do a manual install) you can go through those instructions.
- Download the desired version from here from your platform.
- Copy it as
cogmentin a location that already belongs to your
/usr/local/bin) or that you'll add to your
PATHand make sure it is executable (e.g. using
chmod +x /usr/local/bin/cogment).
Check that Cogment CLI is accessible.¶
With a working installation you can run the following in a terminal:
$ cogment version
You can then list all the commands by typing:
$ cogment help
or for help on each individual command:
$ cogment help <command>
Test your installation¶
In order to test that your installation is fully working, run an existing Cogment app, for example one of the steps of the tutorial.
Download or clone the sources for the official Rock-Paper-Scissors (RPS) tutorial from https://github.com/cogment/cogment-tutorial-rps.
Once it is done, run the following in the directory you retrieved:
$ cd 5-human-player $ cogment run generate $ cogment run build $ cogment run start
cogment command will run the code generation phase for this project. If everything runs fine it means
cogment and Protobuf's
protoc are installed correctly.
The second will build docker images for the services of this Cogment app. If everything runs fine it means the
docker-compose installations are functional.
Finally, the third command will start the Cogment app. In another terminal you can connect to it and play a few games of RPS against a simple AI agent.
$ cogment run client
Congratulations, you have a working installation of Cogment! We recommend you head to the Cogment tutorial to learn how to implement this RPS app from scratch.