Game Framework
CLI Reference

CLI Overview

The game-cli is a powerful command-line tool that automates Unity and Unreal Engine game exports, file synchronization, builds, and publishing workflows for Game Framework projects.

The CLI streamlines your development workflow by automating repetitive tasks and providing cloud publishing capabilities.

Key Features

Local Development

  • Automated Exports - Export Unity/Unreal games for all platforms with a single command
  • Smart Sync - Automatically copy exported files to your Flutter project
  • Configuration Management - Simple .game.yml configuration file
  • Multi-Platform - Support for Android, iOS, macOS, Windows, Linux
  • Build Integration - Trigger exports during Flutter builds
  • Validation - Check configurations and paths before building

Cloud Publishing

  • Package Publishing - Publish Flutter packages to Game Framework Cloud
  • Artifact Management - Upload game artifacts (Unity/Unreal builds) with packages
  • Workspace Management - Organize packages by workspaces
  • Authentication - Secure API key and Bearer token (OIDC) support
  • Version Control - Automatic version management and validation

Modern Interactive UI

The CLI features a polished, professional interface:

  • Arrow key navigation for selecting options
  • Hidden credential input for security
  • Real-time progress indicators
  • Visual feedback with clear success/error indicators
  • Professional UX matching modern CLIs like npm and gh
# Interactive commands
game login              # Interactive auth with arrow keys
game workspace list     # Beautiful workspace display
game workspace select   # Arrow-key workspace selection

Common Commands

Quick Command Reference

Package Creation

# Create a new game package interactively
game scaffold

# Create Unity game package
game scaffold --name my_game --engine unity

# Add engine to existing project
game add engine unity

Development Workflow

# Export Unity for Android
game export unity --platform android

# Sync files to Flutter
game sync unity --platform android

# All-in-one: export + sync + build
game build android --engine unity

Cloud Operations

# Login to Game Framework Cloud
game login

# Select workspace
game workspace select

# Publish package
game publish

Configuration

# Initialize configuration
game init

# View configuration
game config show

# Validate configuration
game config validate

Installation

The CLI can be installed via Homebrew, binary download, or built from source.

See the Installation Guide for detailed installation instructions.

Configuration Files

Project Configuration (.game.yml)

The .game.yml file defines your project's engine configurations, export settings, and platform targets:

name: MyGame
version: 1.0.0

engines:
  unity:
    project_path: ../MyUnityProject
    export_path: ../MyUnityProject/Exports
    
    platforms:
      android:
        enabled: true
        target_path: android/unityLibrary
      
      ios:
        enabled: true
        target_path: ios/UnityFramework.framework

CLI Configuration (~/.game/config.yml)

User-level configuration stored in your home directory:

auth:
  token: "jwt_token_here"
  api_key: "api_key_here"

defaults:
  workspace_id: "ws-abc123"
  api_url: "http://localhost:4000"

Never commit your CLI configuration file! It contains sensitive authentication credentials.

Workflow Examples

Daily Development

# Make changes in Unity/Unreal
# ...

# Export and sync
game export unity --platform android
game sync unity --platform android

# Or use build command (does everything)
game build android --engine unity

Publishing

# One-time setup
game login
game workspace select

# Publish package with artifacts
game publish

Multi-Platform Release

# Export all platforms
game export unity --all

# Sync all platforms
game sync unity --all

# Build Flutter apps
flutter build apk
flutter build ios
flutter build macos

Getting Help

Command Help

Get help for any command:

# General help
game --help

# Command-specific help
game export --help
game scaffold --help

Resources

Next Steps

Ready to start using the CLI?

  1. Install the CLI
  2. Initialize a project with game init
  3. Add an engine with game add engine unity
  4. Export your game with game export unity
  5. Sync to Flutter with game sync unity

New to Game Framework? Start with the Quick Start Guide for a complete tutorial.