CLI Installation
The game-cli tool can be installed via Homebrew, binary download, or built from source. Choose the method that works best for your platform and workflow.
Prerequisites
Before installing the CLI, ensure you have:
- Dart SDK: 3.0.0 or higher (only if building from source)
- Git: For cloning the repository (if building from source)
Installation Methods
Homebrew Installation (macOS/Linux)
The easiest way to install game-cli on macOS or Linux:
# Add the tap
brew tap xraph/tap
# Install game-cli
brew install game-cli
# Verify installation
game --versionUpgrade
To upgrade to the latest version:
brew upgrade game-cliUninstall
To remove the CLI:
brew uninstall game-cliHomebrew is the recommended installation method for macOS and Linux users!
Download Pre-Built Binary
Download the latest release for your platform from GitHub Releases.
Available Platforms
| Platform | File |
|---|---|
| macOS (Apple Silicon) | game-cli-vX.Y.Z-macos-aarch64.tar.gz |
| macOS (Intel) | game-cli-vX.Y.Z-macos-x86_64.tar.gz |
| Linux (x64) | game-cli-vX.Y.Z-linux-x64.tar.gz |
| Windows (x64) | game-cli-vX.Y.Z-windows-x64.zip |
Install on macOS/Linux
# Extract the archive
tar -xzf game-cli-*.tar.gz
# Move to your PATH
sudo mv game /usr/local/bin/
# Verify installation
game --versionInstall on Windows
# Extract the zip file
Expand-Archive game-cli-*.zip
# Move to system directory
Move-Item game-cli-*\game.exe C:\Windows\System32\
# Verify installation
game --versionYou may need administrator/sudo privileges to move the binary to a system directory.
Build from Source
For development or if you need the latest unreleased changes:
Clone Repository
git clone https://github.com/xraph/game-cli.git
cd game-cliInstall Dependencies
dart pub getBuild and Install
Use the Makefile for automated installation:
make installThis compiles the CLI to a native executable at ~/.local/bin/game.
Add to PATH
Add the installation directory to your PATH (first-time setup):
# For zsh (macOS default)
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# For bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcVerify Installation
game --versionRebuilding After Changes
When developing the CLI:
make rebuildThis quickly recompiles and updates the installed executable.
Building from source requires the Dart SDK and is primarily for development purposes.
Verify Installation
After installation, verify the CLI is working:
# Check version
game --version
# View available commands
game --help
# View command-specific help
game scaffold --helpExpected output:
Game CLI v0.6.0
Command-line tool for Game FrameworkConfiguration
After installation, you may want to configure the CLI:
# Initialize a new project
game init
# View current configuration
game config show
# Validate configuration
game config validateEnvironment Variables
The CLI respects several environment variables for configuration:
# OIDC Provider Configuration
export GAME_OIDC_URL=http://localhost:4000
export GAME_CLIENT_ID=game-cli
export GAME_CLIENT_SECRET=secret_abc123
export GAME_SCOPES="openid profile email"
# Backend API Configuration
export GAME_API_URL=http://localhost:4000
# Legacy Authentication
export GAME_API_KEY=gf_1234567890abcdefSee the Authentication Guide for details on configuring OIDC and API keys.
Troubleshooting
Command Not Found
If you get "command not found" after installation:
Check if game is in your PATH:
which gameIf not found, add to PATH:
# For Homebrew installation
brew --prefix game-cli
# For manual installation
export PATH="$HOME/.local/bin:$PATH"Reload your shell:
source ~/.zshrc # or source ~/.bashrcPermission Denied
If you get "permission denied" when running the CLI:
# Make executable
chmod +x /path/to/game
# Or run with sudo (if installed system-wide)
sudo game --helpDependencies Missing
If building from source fails:
# Ensure Dart SDK is installed
dart --version
# Install dependencies
cd game-cli
dart pub get
# Try rebuilding
make clean
make installHomebrew Installation Fails
If Homebrew installation fails:
# Update Homebrew
brew update
# Remove and reinstall tap
brew untap xraph/tap
brew tap xraph/tap
brew install game-cliPlatform-Specific Notes
macOS
On macOS, you may see a security warning when first running the CLI. To allow it:
- Open System Preferences → Security & Privacy
- Click Allow for the game executable
- Run the command again
Or use this command:
xattr -d com.apple.quarantine /path/to/gameWindows
On Windows, you may need to:
- Run PowerShell as Administrator
- Allow script execution:
Set-ExecutionPolicy RemoteSigned - Add the installation directory to your PATH manually through System Properties
Linux
On Linux, ensure the binary has execute permissions:
chmod +x gameUpdating
Homebrew
brew upgrade game-cliBinary Download
Download the latest release and replace the existing binary.
From Source
cd game-cli
git pull
make rebuildUninstallation
Homebrew
brew uninstall game-cli
brew untap xraph/tapManual Installation
# Remove binary
rm /usr/local/bin/game
# Remove configuration (optional)
rm -rf ~/.gameNext Steps
Now that you have the CLI installed:
- View CLI Overview - Learn about CLI features
- Initialize a Project - Create
.game.ymlconfiguration - Explore Commands - Learn available commands
- Follow Workflows - Common development patterns
Ready to start? Try game scaffold to create your first game package!