This guide provides information for developers who want to contribute to the World CLI project.
- Go 1.24.0 or later
- Task - Task runner used for build, test, and lint commands
- Docker - Required for running services managed by World CLI
- Docker Compose - Required for multi-container Docker applications
- Windows Users: Windows Subsystem for Linux 2 (WSL2) is required for running World CLI on Windows
git clone https://github.com/Argus-Labs/world-cli.git
cd world-cliThe World CLI uses Task as a task runner for common development tasks. You can install Task by following the instructions at taskfile.dev.
# Install task dependencies (golangci-lint, gotestsum, goreleaser)
task lint # This will install golangci-lint if it's not already installed
task test # This will install gotestsum if it's not already installed
task build # This will install goreleaser if it's not already installed
task buf # this will install buf if it's not already installedThe World CLI is organized around several core systems:
cmd/world/- Contains the main CLI command implementationsmain.go- Entry point for the CLI applicationroot/- Root command and core commands likecreateanddoctorforge/- World Forge platform commandscardinal/- Cardinal game shard management commandsevm/- EVM-related commands
common/- Shared utility code used across the applicationconfig/- Configuration loading and managementdocker/- Docker client and service definitionsglobalconfig/- Global configuration persistencelogger/- Logging utilitiesteacmd/- Terminal UI command utilities
proto- Contain proto files for Connect RPCtea/- Terminal UI components using Bubble Tea frameworkcomponent/- Reusable UI componentsstyle/- Terminal styling utilities
telemetry/- Telemetry integration for error tracking and analyticstaskfiles/- Task definitions for building, testing, and lintingexample-world.toml- Example configuration file
World CLI use Connect RPC library for some endpoint connectrpc.com.
To generate Connect and PB files:
task bufThis will generate the files in the ./gen directory.
To build the CLI from source:
task buildThis will create the binary in the ./dist directory.
To install your local build for testing:
task installThis will install the World CLI binary in your Go bin directory (typically $GOPATH/bin or $HOME/go/bin).
The World CLI uses a TOML configuration file to manage settings for various services. An example configuration file is provided in the repository: example-world.toml.
Key sections in the configuration file include:
[cardinal]- Settings for the Cardinal game shard[evm]- Settings for the Ethereum Virtual Machine[common]- Common settings shared across components[nakama]- Settings for the Nakama game server
Create a world.toml file in your project directory based on the example:
cp example-world.toml world.tomlThen customize the settings as needed for your development environment.
To run all tests:
task testTo run tests with coverage reporting:
task test:coverageThis will generate a coverage report and output it to a file.
To run the linter:
task lintTo run the linter and automatically fix issues where possible:
task lint:fix- Create a feature branch from the
mainbranch - Make your changes
- Ensure tests pass with
task test - Ensure linting passes with
task lint - Push your changes and create a pull request
- PR titles must follow the conventional commit format
- All tests and linting checks must pass with adequate coverage
The World CLI uses the following libraries for terminal user interface development:
- bubbletea - A framework for building terminal apps
- lipgloss - Style definitions for terminal applications
The CLI manages several Docker services:
- Cardinal: Core game shard service
- Cardinal Editor: Development tool for Cardinal
- Nakama: Game server for multiplayer functionality
- NakamaDB: Database for Nakama
- Redis: In-memory data store
- EVM: Ethereum Virtual Machine chain
- Celestia DevNet: Data Availability layer for EVM
- Jaeger: Distributed tracing (optional)
- Prometheus: Metrics collection (optional)
The World CLI includes a doctor command to check your system for dependencies and configuration issues:
world doctorThis command checks for required tools and services, and provides guidance on fixing any issues found.