Game Framework
CLI Reference

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 --version

Upgrade

To upgrade to the latest version:

brew upgrade game-cli

Uninstall

To remove the CLI:

brew uninstall game-cli

Homebrew 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

PlatformFile
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 --version

Install 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 --version

You 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-cli

Install Dependencies

dart pub get

Build and Install

Use the Makefile for automated installation:

make install

This 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 ~/.bashrc

Verify Installation

game --version

Rebuilding After Changes

When developing the CLI:

make rebuild

This 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 --help

Expected output:

Game CLI v0.6.0
Command-line tool for Game Framework

Configuration

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 validate

Environment 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_1234567890abcdef

See 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 game

If 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 ~/.bashrc

Permission 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 --help

Dependencies 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 install

Homebrew 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-cli

Platform-Specific Notes

macOS

On macOS, you may see a security warning when first running the CLI. To allow it:

  1. Open System PreferencesSecurity & Privacy
  2. Click Allow for the game executable
  3. Run the command again

Or use this command:

xattr -d com.apple.quarantine /path/to/game

Windows

On Windows, you may need to:

  1. Run PowerShell as Administrator
  2. Allow script execution: Set-ExecutionPolicy RemoteSigned
  3. Add the installation directory to your PATH manually through System Properties

Linux

On Linux, ensure the binary has execute permissions:

chmod +x game

Updating

Homebrew

brew upgrade game-cli

Binary Download

Download the latest release and replace the existing binary.

From Source

cd game-cli
git pull
make rebuild

Uninstallation

Homebrew

brew uninstall game-cli
brew untap xraph/tap

Manual Installation

# Remove binary
rm /usr/local/bin/game

# Remove configuration (optional)
rm -rf ~/.game

Next Steps

Now that you have the CLI installed:

  1. View CLI Overview - Learn about CLI features
  2. Initialize a Project - Create .game.yml configuration
  3. Explore Commands - Learn available commands
  4. Follow Workflows - Common development patterns

Ready to start? Try game scaffold to create your first game package!