Skip to content

How to Download and Install Cogment

Pre-Requisites

Please install:

  1. Docker and docker-compose
  2. protoc

Install the latest Cogment CLI

Installation script (compatible with linux and macOS for x86_64 architectures)

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 x86_64 architectures)

For windows user (and also if you prefer to do a manual install) you can go through those instructions.

  1. Download the desired version from here from your platform.
  2. Copy it as cogment in a location that already belongs to your PATH (e.g. /usr/local/bin) or that you'll add to your PATH and make sure it is executable (e.g. using chmod +x /usr/local/bin/cogment).

Unsupported platform

If your platform is not supported, especially if you are using an arm64 architecture, add an issue listing your platform details and do not hesitate to contact us.

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

The first 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 and 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.