# Packages
# README
cogment-cli
Cogment is an innovative open source AI platform designed to leverage the advent of AI to benefit humankind through human-AI collaboration developed by AI Redefined. Cogment enables AI researchers and engineers to build, train and operate AI agents in simulated or real environments shared with humans. For the full user documentation visit https://docs.cogment.ai
This module, cogment CLI, is a command line tool providing a set of useful command utilities that provide the following functions:
- generate, perform the code generation phase from a project's proto files.
- init, bootstrap a new project locally.
- run, run a command from the cogment.yaml 'commands' section.
- version, print the version nummber of the Cogment CLI.
Installation
To install the latest published version run 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
For futher installation options please refer to cogment's installation guide.
Developers
Prerequisites
- Fully working go setup, as described in the official documentation.
Make
, most flavor should work fine.protoc
, the protocol buffer compiler, it should be installed as described in the official documentation.
Formatting & coding style
To check for the format of the file using gofmt, run the following:
make check-fmt
To reformat the code to fix issues, simply run the following:
make fmt
To run a coding style check using golint, run the following:
make check-codingstyle
⚠️ The full codebase does not yet conforms to the coding style, expect some errors.
Tests
Run the tests using the following:
make test
Some tests validate output against snapshots using cupaloy, you can update those snapshots using
make test-update-snapshots
Before committing updated snapshot, review their content.
Build
Build the executable for your platform to ./build/congment
using the following:
make build
Cross compile to all the supported platforms to ./build/
using the following:
make release
Usage
After running make build
you can simply put ./build/cogment
in your $PATH
and simply run the following:
cogment
Alternatively, you can run make install
, this will install the executable in $(go env GOPATH)/bin
, a directory that should already be part of your $PATH
.
In this case the binary will be named cogment-cli
and you can simply run
cogment-cli
Release process
People having maintainers rights of the repository can follow these steps to release a version MAJOR.MINOR.PATCH. The versioning scheme follows Semantic Versioning.
- Run
./scripts/create_release_branch.sh
automatically compute and update the version of the package, create the release branch and update the changelog from the commit history, - On the release branch, check and update the changelog if needed
- Update api > default_cogment.yaml
- Make sure everything's fine on CI,
- Run
./scripts/tag_release.sh MAJOR.MINOR.PATCH
to create the specific version section in the changelog, merge the release branch inmain
, create the release tag and update thedevelop
branch with those.
The rest, publishing the packages to github releases and dockerhub and updating the mirror repositories, is handled directly by the CI.