by liyingsong99
A file-based Unity automation bridge for AI coding assistants, enabling logs, compilation, asset/prefab operations, scene editing, and screenshots without MCP.
# Add to your Claude Code skills
git clone https://github.com/liyingsong99/AIBridgeGuides for using ai agents skills like AIBridge.
English | 中文
AIBridge is a Unity package that gives AI coding assistants a stable command bridge into Unity Editor. It helps agents locate assets, inspect scenes and prefabs, edit Unity objects, run compile/build checks, read console logs, and capture screenshots or GIFs for visual verification.
It is built for teams that want AI to do real Unity work, not only generate text or code suggestions.
Many Unity AI integrations depend on a live socket or MCP session. AIBridge uses durable command files and persisted results, so work can continue across the moments Unity is most likely to interrupt tools: recompiles, reloads, editor focus changes, and restarts.
| Dimension | AIBridge | Persistent MCP-style bridge | |---|---|---| | Connection stability | File-based requests and results | Depends on a live connection | | Compile-cycle resilience | Keeps polling and resumes after reloads | Session may drop during compilation | | Setup cost | Works through bundled CLI commands | Requires server/client configuration | | AI integration | CLI commands plus JSON output | Requires protocol-specific tool wiring | | Traceability | Command files, result files, screenshots, logs | Often tied to current session state | | Extensibility | Unity command handlers plus CLI builders | Usually tool-server based |
batch and multi.Install AIBridge with Unity Package Manager using this Git URL:
https://github.com/liyingsong99/AIBridge.git
You can also clone or download this repository and place it under your Unity project's Packages folder.
AIBridge includes a ready-to-use AGENTS.md workflow template for AI collaboration:
Tools > AIBridge Settings in Unity Editor.Skills Installation tab.Install AGENTS.md.The installed rules include requirement confirmation, implementation flow, Unity compile checks, console diagnostics, C# compatibility rules, and quality checklists.
Run commands from the Unity project root after AIBridge has installed its CLI cache:
$CLI = "./AIBridgeCache/CLI/AIBridgeCLI.exe"
On macOS/Linux, use the bundled platform CLI or run the DLL with dotnet according to your project setup.
./AIBridgeCache/CLI/AIBridgeCLI.exe asset search --mode script --keyword "Player" --format paths
./AIBridgeCache/CLI/AIBridgeCLI.exe asset find --filter "t:Prefab" --format paths
./AIBridgeCache/CLI/AIBridgeCLI.exe asset get_path --guid "abc123..."
./AIBridgeCache/CLI/AIBridgeCLI.exe scene get_hierarchy --depth 3 --includeInactive false
./AIBridgeCache/CLI/AIBridgeCLI.exe selection get --includeComponents true
./AIBridgeCache/CLI/AIBridgeCLI.exe prefab get_info --prefabPath "Assets/Prefabs/Player.prefab"
./AIBridgeCache/CLI/AIBridgeCLI.exe prefab get_hierarchy --prefabPath "Assets/Prefabs/Player.prefab"
./AIBridgeCache/CLI/AIBridgeCLI.exe inspector get_components --path "Player"
./AIBridgeCache/CLI/AIBridgeCLI.exe inspector get_properties --path "Player" --componentName "Transform"
PowerShell tip for complex JSON values:
$values = (@{ 'm_LocalPosition.x' = 0; 'm_LocalPosition.y' = 1 } | ConvertTo-Json -Compress) -replace '"', '\"'
& "./AIBridgeCache/CLI/AIBridgeCLI.exe" inspector set_properties --assetPath 'Assets/Prefabs/Player.prefab' --componentName Transform --values $values
./AIBridgeCache/CLI/AIBridgeCLI.exe gameobject create --name "MyCube" --primitiveType Cube
./AIBridgeCache/CLI/AIBridgeCLI.exe transform set_position --path "Player" --x 0 --y 1 --z 0
./AIBridgeCache/CLI/AIBridgeCLI.exe compile unity
./AIBridgeCache/CLI/AIBridgeCLI.exe get_logs --logType Error
./AIBridgeCache/CLI/AIBridgeCLI.exe batch from_text --text "call editor log 'Hello'\ndelay 1000"
./AIBridgeCache/CLI/AIBridgeCLI.exe multi --cmd "editor log --message Step1&get_logs --logType Error --count 1"
multi --cmd writes plain CLI lines as Batch call lines. Use multi --stdin for longer scripts or commands with complex JSON.
./AIBridgeCache/CLI/AIBridgeCLI.exe screenshot game
./AIBridgeCache/CLI/AIBridgeCLI.exe screenshot gif --frameCount 50
./AIBridgeCache/CLI/AIBridgeCLI.exe gameview set_resolution --width 1920 --height 1080
./AIBridgeCache/CLI/AIBridgeCLI.exe gameview get_resolution
compile unity.get_logs --logType Error.Editor/ Unity Editor commands, tools, settings window, and integrations
Runtime/ Runtime bridge contracts and lightweight runtime data
Tools~/ AIBridgeCLI source and bundled platform binaries
Templates~/ AI workflow rule templates
Skill~/ AIBridge skill definition for AI assistants
Images/ README and promotional images
MIT License. See LICENSE.
Issues and pull requests are welcome. When changing Unity-facing behavior, include the relevant CLI command examples and validation notes in the documentation.
No comments yet. Be the first to share your thoughts!