Auto Tournament

Build from source

Build csm yourself, run the tests, and contribute.

Most people use the release binary. Build from source if you want to change csm.

What you need

  • Go 1.21 or newer.
  • Git.

Build and run

Clone the repository

git clone https://github.com/Auto-Tournament/cs2-server-manager.git
cd cs2-server-manager

Build

go build -o csm ./src/cmd/cs2-tui

Run

sudo ./csm

When you run csm from a folder that has an overrides/ folder next to the binary, csm uses that folder as its root instead of /opt/cs2-server-manager. Set CSM_ROOT to choose the root yourself.

To build the release binaries for both CPU types:

GOOS=linux GOARCH=amd64 go build -o csm-linux-amd64 ./src/cmd/cs2-tui
GOOS=linux GOARCH=arm64 go build -o csm-linux-arm64 ./src/cmd/cs2-tui

Run the tests

go test ./...

Code layout

  • src/cmd/cs2-tui/: the csm command. It reads the command line and starts the menu when no command is given.
  • src/internal/csm/: the work itself: install, updates, tmux, plugins, doctor, maps.
  • src/internal/tui/: the terminal menu, built with Bubble Tea.

Contribute

  • Open an issue first for larger changes.
  • In a bug report, give your Linux version and CPU type (uname -m), what you expected and what happened, and the logs: sudo csm logs <server> 200 and /opt/cs2-server-manager/logs/csm.log.
  • Keep pull requests small, and say how you tested the change.

Releases are made from the GitHub Release workflow with scripts/release.sh. It uploads csm-linux-amd64 and csm-linux-arm64.

On this page