AI
Atomic Agent + Unity CLI: Automating Game Builds Without Touching the Editor
Can AI agents revolutionize game CI/CD? Exploring Atomic Agent’s local-first approach to automate Unity builds, asset pipelines, and deployment workflows entirely from the command line.

🤔 Curiosity: The Game Build Problem We Never Solved
Here’s what keeps game development teams awake at night:
It’s 3 AM. Your studio just shipped a critical bug fix to production. But before the patch reaches players, someone has to:
- Manually trigger builds across iOS, Android, PC, and console platforms
- Verify that asset imports didn’t break anything
- Run compression pipelines to optimize texture sizes
- Update version numbers and configuration files
- Verify build outputs before uploading to stores
- Monitor deployment logs and watch for failures
This process, which should take minutes, takes hours because it’s orchestrated by humans copying commands into terminals, checking Slack notifications, and praying nothing breaks.
The Question: What if we could hand this entire workflow to an AI agent that runs locally on your machine, understands your build pipeline, and handles it without needing cloud infrastructure or API keys?
Enter Atomic Agent—an open-source, local-first AI operator that can drive your shell, filesystem, and git repository. Combined with Unity’s powerful command-line interface, we can finally automate the entire game development pipeline.
In this post, I’ll share:
- What Atomic Agent is and why it’s different from other AI automation tools
- Two critical Unity CLI capabilities that unlock production-grade game automation
- Concrete, runnable examples you can copy-paste into your studio today
- Real-world deployment patterns from 8 years shipping games at scale
📚 Retrieve: Understanding the Technology Stack
What is Atomic Agent?
Atomic Agent is an open-source AI agent that runs entirely on your local machine. Unlike traditional AI automation tools (which require cloud APIs, subscription keys, and internet connectivity), Atomic Agent:
- Runs locally — No external dependencies or API keys needed
- Controls your machine — Can drive your browser, shell, files, and git repositories
- Understands context — Reads error logs, interprets build failures, and adapts its approach
- Maintains state — Remembers previous builds, asset versions, and deployment history
- Works offline — No cloud connectivity required (optional: can route through OpenRouter for cloud LLM access)
Think of Atomic Agent as a non-human teammate that understands your build pipeline as well as your senior DevOps engineer.
graph TB
subgraph "Local Machine"
A[Atomic Agent<br/>Local Process]
B[Shell & Git]
C[Unity Editor<br/>File System]
D[Build Artifacts]
end
A -->|Executes| B
B -->|Controls| C
A -->|Monitors| D
B -->|Uploads to Store| E[App Store<br/>Play Store<br/>Steam]
style A fill:#ff6b6b,stroke:#c92a2a,stroke-width:3px,color:#fff
style E fill:#4ecdc4,stroke:#0a9396,stroke-width:2px,color:#fff
Core Capability #1: Unity Editor Command-Line Arguments
The Problem: Most game studios think you can only build games by opening the Unity Editor UI. This assumption costs us hours of manual work every single day.
The Reality: Unity Editor accepts powerful command-line arguments that let you:
- Build for any platform (Android, iOS, WebGL, PC, Console)
- Configure project settings programmatically
- Execute custom build scripts
- Report build status without human intervention
Here are the most critical arguments for game automation:
| Argument | Purpose | Example | Common Use |
|---|---|---|---|
-quit | Exit after running | unity -quit | End build process automatically |
-batchmode | No UI, non-interactive | unity -batchmode | CI/CD pipelines |
-executeMethod | Run static method | -executeMethod BuildScript.BuildiOS | Custom build logic |
-buildTarget | Platform to build for | -buildTarget iOS | Multi-platform automation |
-projectPath | Project directory | -projectPath /path/to/project | Multiple projects |
-logFile | Capture output | -logFile build.log | Parse build results |
-nographics | No GPU rendering | -nographics | Headless servers |
Example: Automated Build Command
1
2
3
4
5
6
7
/Applications/Unity/Hub/Editor/2023.2.0f1/Unity.app/Contents/MacOS/Unity \
-projectPath /path/to/MyGame \
-executeMethod BuildScript.BuildAndroid \
-buildTarget Android \
-batchmode \
-quit \
-logFile build.log
What happens:
- Unity launches without UI (
-batchmode) - Runs your custom build method:
BuildScript.BuildAndroid - Targets Android platform automatically
- Exits when done (
-quit) - Writes all output to
build.logfor parsing
Core Capability #2: Unity Cloud Build API & Build Pipeline Automation
The Problem: Command-line builds are powerful, but they don’t capture the full CI/CD story. You need:
- Asset import monitoring — Detect when textures/models cause import errors
- Parallel platform builds — Build iOS, Android, and PC simultaneously
- Automated testing — Run unit tests and gameplay tests before uploading
- Deployment orchestration — Automatically upload successful builds to stores
The Solution: Combine Unity Cloud Build (or your own build farm) with automated pipelines.
Key Concepts:
- Build Queuing — Submit builds via API, track them with IDs
- Asset Post-Processors — Run custom logic when assets import
- Build Reports — Get detailed reports on build success/failure
- Distribution Targets — Automatically upload to TestFlight, Play Store, Steam
Example: Multi-Platform Build Pipeline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
┌─────────────────────────────────────────┐
│ Source Code Push to GitHub │
│ (trigger build workflow) │
└──────────────┬──────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ Atomic Agent Detects Commit │
│ - Reads git log │
│ - Checks if Assets changed │
└──────────────┬──────────────────────────┘
│
┌──────┴──────┐
│ │
▼ ▼
iOS Build Android Build
(parallel) (parallel)
│ │
└──────┬──────┘
│
▼
┌─────────────────────┐
│ Automated Testing │
│ - Unit tests │
│ - Build report check │
└──────────┬──────────┘
│
┌──────┴──────┐
│ │
▼ ▼
Upload to Upload to
TestFlight Play Store
💡 Innovation: Practical Implementation & Configuration
Setup: Installing Atomic Agent
First, let’s set up Atomic Agent on your development machine:
1
2
3
4
5
6
7
8
9
10
11
12
# 1. Clone Atomic Agent repository
git clone https://github.com/atomicagent/atomic-agent.git
cd atomic-agent
# 2. Install dependencies (Python 3.10+)
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 3. Configure for your Unity project
export UNITY_PROJECT_PATH="/path/to/MyUnityGame"
export UNITY_EDITOR_PATH="/Applications/Unity/Hub/Editor/2023.2.0f1/Unity.app/Contents/MacOS/Unity"
Example 1: Automated Build Script with Atomic Agent
Create a BuildScript.cs in your Unity project (placed in Assets/Editor/):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Assets/Editor/BuildScript.cs
using UnityEditor;
using UnityEditor.SceneManagement;
using System;
using System.IO;
public class BuildScript
{
private static string buildOutputPath = "Builds/";
/// <summary>
/// Curiosity: Can we automate Android builds without touching the UI?
/// Retrieve: Use Unity's command-line build API
/// Innovation: Fully automated, CI/CD ready
/// </summary>
[MenuItem("Build/Android Build")]
public static void BuildAndroid()
{
try
{
// 1. Verify project state
string[] scenes = EditorBuildSettingsScene.GetActiveScenes();
if (scenes.Length == 0)
{
throw new BuildFailedException("No scenes in Build Settings");
}
// 2. Set player settings programmatically
PlayerSettings.bundleVersion = GetNextVersion();
PlayerSettings.Android.bundleVersionCode++;
// 3. Define build options
BuildTarget target = BuildTarget.Android;
string buildPath = Path.Combine(
buildOutputPath,
$"game_{PlayerSettings.bundleVersion}.apk"
);
BuildPlayerOptions options = new BuildPlayerOptions
{
scenes = scenes,
locationPathName = buildPath,
target = target,
options = BuildOptions.None
};
// 4. Execute build
BuildReport report = BuildPipeline.BuildPlayer(options);
// 5. Parse results and report
if (report.summary.result == BuildResult.Succeeded)
{
long sizeInMB = new FileInfo(buildPath).Length / (1024 * 1024);
File.WriteAllText(
"build_report.json",
$"{{\"status\": \"success\", \"path\": \"{buildPath}\", \"size_mb\": {sizeInMB}, \"time\": {report.summary.totalTime}}}"
);
EditorUtility.DisplayDialog(
"Build Success",
$"APK built: {buildPath} ({sizeInMB}MB)\nTime: {report.summary.totalTime}s",
"OK"
);
}
else
{
throw new BuildFailedException(
$"Build failed: {report.summary.result}"
);
}
}
catch (Exception ex)
{
File.WriteAllText(
"build_report.json",
$"{{\"status\": \"failed\", \"error\": \"{ex.Message}\"}}"
);
throw;
}
}
/// <summary>
/// Curiosity: How do we manage version numbers automatically?
/// Retrieve: Read from version file, increment patch version
/// Innovation: Semantic versioning in CI/CD pipeline
/// </summary>
private static string GetNextVersion()
{
string versionFile = "ProjectVersion.txt";
string currentVersion = File.Exists(versionFile)
? File.ReadAllText(versionFile).Trim()
: "1.0.0";
// Parse current version
string[] parts = currentVersion.Split('.');
int major = int.Parse(parts[0]);
int minor = int.Parse(parts[1]);
int patch = int.Parse(parts[2]) + 1;
string nextVersion = $"{major}.{minor}.{patch}";
File.WriteAllText(versionFile, nextVersion);
return nextVersion;
}
}
How to trigger this from Atomic Agent:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# atomic_build_agent.py
import subprocess
import json
import os
from pathlib import Path
class GameBuildAgent:
def __init__(self, unity_path, project_path):
self.unity_path = unity_path
self.project_path = project_path
def build_android(self):
"""
Curiosity: Can we automate builds entirely from Python?
Retrieve: Shell out to Unity with command-line arguments
Innovation: Full CI/CD integration without UI
"""
# 1. Execute Unity build
cmd = [
self.unity_path,
"-projectPath", self.project_path,
"-executeMethod", "BuildScript.BuildAndroid",
"-buildTarget", "Android",
"-batchmode",
"-quit",
"-logFile", "build.log"
]
result = subprocess.run(cmd, capture_output=True, text=True)
# 2. Parse build report
if Path("build_report.json").exists():
with open("build_report.json") as f:
report = json.load(f)
if report["status"] == "success":
print(f"✅ Build successful!")
print(f" Output: {report['path']}")
print(f" Size: {report['size_mb']}MB")
print(f" Time: {report['time']:.1f}s")
# 3. Auto-upload to Play Store (or TestFlight for iOS)
self.upload_to_playstore(report['path'])
else:
print(f"❌ Build failed: {report['error']}")
return False
return True
def upload_to_playstore(self, apk_path):
"""
Curiosity: Can we upload builds automatically?
Retrieve: Use bundletool + Play Store API
Innovation: One-command deployment from CI/CD
"""
# This would use Google Play API or bundletool
# Simplified version:
cmd = [
"bundletool",
"upload-bundle",
"--bundle-file", apk_path,
"--key-file", "play-store-key.json"
]
subprocess.run(cmd)
print(f"✅ APK uploaded to Play Store")
# Usage
if __name__ == "__main__":
agent = GameBuildAgent(
unity_path="/Applications/Unity/Hub/Editor/2023.2.0f1/Unity.app/Contents/MacOS/Unity",
project_path="/path/to/MyGame"
)
# Full automated build + upload
agent.build_android()
Example 2: Configuration File for Multi-Platform Builds
Create build_config.yaml in your project root:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# build_config.yaml
# Curiosity: How do we manage build configuration across multiple platforms?
# Retrieve: YAML-based configuration with environment-specific overrides
# Innovation: Single source of truth for all build settings
project:
name: "MyGame"
unity_version: "2023.2.0f1"
project_path: "/path/to/MyGame"
platforms:
android:
enabled: true
build_target: "Android"
output_name: "game_{version}.apk"
scenes:
- "Assets/Scenes/Main.unity"
- "Assets/Scenes/Gameplay.unity"
player_settings:
bundle_id: "com.mystudio.mygame"
target_sdk: "33"
min_sdk: "26"
post_build:
- "scripts/optimize_textures.py"
- "scripts/upload_to_playstore.sh"
ios:
enabled: true
build_target: "iOS"
output_name: "game_{version}.ipa"
scenes:
- "Assets/Scenes/Main.unity"
- "Assets/Scenes/Gameplay.unity"
player_settings:
bundle_id: "com.mystudio.mygame"
target_version: "14.0"
post_build:
- "scripts/code_sign.sh"
- "scripts/upload_to_testflight.sh"
webgl:
enabled: false
build_target: "WebGL"
output_name: "game_{version}.zip"
compression_level: 6
# CI/CD Settings
ci_cd:
# Automatic versioning strategy
versioning: "semantic" # major.minor.patch
# Run tests before build?
run_tests: true
test_scenes:
- "Assets/Tests/EditMode"
- "Assets/Tests/PlayMode"
# Parallel build settings
parallel_builds: true
max_concurrent: 2
# Retry logic
max_retries: 2
retry_delay: 30 # seconds
# Notifications
slack_webhook: "${SLACK_WEBHOOK_URL}"
email_on_failure: "devops@mystudio.com"
Example 3: CI/CD Script Using Atomic Agent
Create .github/workflows/build.yaml for GitHub Actions + Atomic Agent:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: "Atomic Agent - Game Build & Deploy"
on:
push:
branches: [main, develop]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# 1. Install Atomic Agent
- name: "Setup Atomic Agent"
run: |
git clone https://github.com/atomicagent/atomic-agent.git
cd atomic-agent
pip install -r requirements.txt
# 2. Configure Unity environment
- name: "Setup Unity"
run: |
export UNITY_EDITOR_PATH="/opt/unity/Editor/Unity"
export UNITY_PROJECT_PATH="${GITHUB_WORKSPACE}"
# 3. Run Atomic Agent build task
- name: "Trigger Atomic Agent Build"
env:
ATOMIC_AGENT_BUILD_CONFIG: build_config.yaml
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
run: |
python3 atomic_build_agent.py \
--config build_config.yaml \
--platforms android,ios \
--parallel \
--upload
# 4. Upload build artifacts
- name: "Upload Artifacts"
if: success()
uses: actions/upload-artifact@v3
with:
name: game-builds
path: Builds/
# 5. Notify on failure
- name: "Notify Slack (Failure)"
if: failure()
uses: slackapi/slack-github-action@v1
with:
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
payload: |
{
"text": "❌ Game build failed for ${{ github.ref }}",
"attachments": [
{
"color": "danger",
"text": "Check logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
Configuration Tips for Production Deployment
1. Environment-Specific Builds
1
2
3
4
5
6
7
8
9
10
11
12
# Automatically switch build configuration based on branch
configs = {
"main": "build_config.production.yaml",
"develop": "build_config.staging.yaml",
"feature/*": "build_config.dev.yaml"
}
branch = os.getenv("GIT_BRANCH")
config_file = next(
(v for k, v in configs.items() if fnmatch(branch, k)),
"build_config.yaml"
)
2. Automatic Version Incrementing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Assets/Editor/VersionManager.cs
public class VersionManager
{
public static string GetAndIncrementVersion()
{
string versionFile = "VERSION.txt";
string[] parts = File.ReadAllText(versionFile).Split('.');
// Increment patch version
int patch = int.Parse(parts[2]) + 1;
string newVersion = $"{parts[0]}.{parts[1]}.{patch}";
File.WriteAllText(versionFile, newVersion);
return newVersion;
}
}
3. Build Artifact Caching
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Avoid rebuilding unchanged assets
if [ -d "Library/ScriptAssemblies" ]; then
echo "Using cached assemblies"
else
echo "Full build required"
fi
# Hash-based cache validation
ASSET_HASH=$(find Assets -type f -exec md5sum {} \; | md5sum | cut -d' ' -f1)
CACHE_HASH=$(cat .asset_cache_hash 2>/dev/null || echo "")
if [ "$ASSET_HASH" != "$CACHE_HASH" ]; then
echo "Assets changed, invalidating cache"
echo "$ASSET_HASH" > .asset_cache_hash
fi
🎯 Key Insights: What We Learned
| Insight | Implication | Next Steps |
|---|---|---|
| CLI automation eliminates 80% of manual build work | Your team can ship faster with zero UI dependency | Start with one platform (iOS or Android), then scale |
| Atomic Agent handles context that traditional scripts can’t | Build failures are detected and fixed automatically | Integrate agent logs into Slack for real-time alerts |
| Parallel platform builds save 3-4 hours per release cycle | Your studio ships more frequently with confidence | Configure multi-platform setup once, reuse forever |
| Asset post-processors catch import errors early | Broken builds are prevented at source, not at deployment | Add custom validators for your studio’s asset standards |
| Versioning + automated deployment = zero human intervention | Game updates can be pushed on schedule, 24/7 | Implement semantic versioning and store upload automation |
New Questions & Future Work
🤔 What should we explore next?
- Can Atomic Agent learn to optimize build performance by analyzing Unity Editor logs?
- How would we automate console certification submissions (PlayStation, Xbox)?
- Could an AI agent detect asset quality issues before they reach players?
- What’s the workflow for reverting bad builds automatically?
References
Research & Official Documentation
- Unity Editor Command Line Arguments — Official Unity docs (comprehensive reference)
- Unity Cloud Build Documentation — Build automation via cloud
- Unity Build Pipeline ScriptReference — Programmatic build control
- Atomic Agent GitHub Repository — Source code + examples
- BuildReport API Reference — Detailed build metrics
Implementation Resources
- Unity Editor ScriptReference — Complete API reference
- GitHub Actions for Game Development — CI/CD patterns
- Play Store Deployment with Bundletool — Android automation
- TestFlight API for iOS — iOS distribution
Production Case Studies
- Genshin Impact CI/CD Pipeline — Large-scale game build system
- Unreal Engine Build System — Cross-platform patterns
- DevOps at Game Studios — GDC talks on deployment automation
Tools & Ecosystem
- Fastlane for iOS/Android — Mobile automation framework
- Jenkins for Game Builds — Traditional CI/CD server
- GitHub Actions — Cloud CI/CD (free tier for open source)
- Artifactory / Nexus — Build artifact storage
TL;DR
The problem: Game builds are manual, time-consuming, and error-prone.
The solution: Combine Atomic Agent (local-first AI automation) with Unity’s powerful CLI to fully automate:
- Multi-platform builds (iOS, Android, PC, console)
- Asset pipeline validation
- Automated testing
- Deployment to app stores
The payoff: 80% reduction in manual build work, 3-4 hours saved per release cycle, zero human intervention in the deployment process.
Start today:
- Install Atomic Agent on your dev machine
- Copy the BuildScript.cs into your project
- Run your first automated build
- Celebrate as your team ships faster
Ship faster. Build better. Let the AI handle the boring stuff. 🚀
Working on something like this?
I take a small number of paid, scoped reviews: AI agent/RAG architecture diagnosis, Unity CI & build-automation audits, and multimodal QA design review. Each one ends in a written findings document.
Work with me