logoalt Hacker News

The Unity CLI: manage Unity from your terminal

78 pointsby nateb2022last Tuesday at 5:51 PM25 commentsview on HN

Comments

thurntoday at 12:45 PM

What I really want is the ability to do more operations which are decoupled from the editor. Even just being able to reliably type check Unity C# code without a running editor would be great, or running unit tests. Would really improve things like CI as well as the ability to run parallel development sessions.

show 3 replies
zulbantoday at 1:17 PM

Great. For my game [1] I have long had the capacity to compile a separate commandline application using unity code [2]. This lets me do benchmarks and unit tests on the core chess AI code without the editor. However I've had to maintain a separate second unit test suite that I can only run in the editor manually if any unity specific code is involved. Naturally, it's run far less often.

This new unity cli doesn't replace that design, since it's important to me that my core chess variant AI code remains a project on its own, totally independent of unity. But it does mean lots of my utilities like my second unity test, which normally require clicking a button in the editor, can now be run without the editor. Excellent!

Making a 2d chess variant game means almost all unity editor features just get in my way.

[1] https://www.chesscraft.ca

[2] https://youtu.be/U4xBLTpZ9Xo?si=Gd2aAWKvLqBVBU66

jayd16today at 3:29 PM

Honestly one of the major upsides of all the AI hype is the FOMO overtook the desire to wall your garden and all these APIs are opening up.

I had to struggle for years managing Unity editor installs by hand and then through the headless mode in Hub.

It would be nice if they finally released docker images of the editor so you could more easily spin up build machines too. Oh uh, the AI needs it... yeah. Its for AI.

KHRZtoday at 5:23 PM

I already am managing Unity from my terminal, using Codex. Although one issue is that PowerShell + C# reflection gets flagged as malware by Windows Defender.

xandriustoday at 12:01 PM

Will be exploring this but so far using a Unity MCP has proven mostly enough to do pretty much anything from outside.

I guess the build pipeline part is nice as we can finally have a fully automated build process from build to distribution without finnicky build/postbuild scripts/profiles.

show 1 reply
aranwtoday at 4:35 PM

Is this closed-source? I was unable to find a link to the source code for it?

0xnyntoday at 11:54 AM

seems like agent-native CLIs are going to become a thing, where machine-readable, token-efficient output and discoverability matter just as much as human ergonomics

bob1029today at 12:35 PM

> unity command eval runs C# code live inside a running Editor or Player and returns the result, with no project-level recompile or domain reload required.

I played around with automating Unity with LLMs for a while. The ability to do this would have been very compelling to me at the beginning.

At this point, I think the more productive way for frontier models to interact with a unity project is to directly manipulate the raw scene files. They are not binary. These files are effectively YAML documents that you can parse, grep and patch just like any other text/code document. The key is to build the tools around these in the same way you would build tools around an agent that can read and manipulate multi-megabyte json documents. It's the same pattern.

Working with a unity project from the filesystem is so much simpler than working with one through all the APIs/CLIs/etc. The files in the unity project path represent 100% of the required information, so the editor feature surface is not relevant unless you are explicitly trying to build editor tooling.

I spent a solid month fighting the domain reload dragon only to realize it didn't fucking matter. I can just wait for the domain reload. As long as the work iteration step size is meaningful, this is not a huge deal.

show 1 reply
jonathanhefnertoday at 2:03 PM

Is there an accompanying Agent Skill?

Woshiwujatoday at 11:45 AM

[dead]

rnewmetoday at 11:34 AM

So it begins.

show 1 reply
mdtroopertoday at 3:06 PM

Well, Godot has the cli from 2016 : https://github.com/godotengine/godot-docs/commits/982ffb6b08...

Here's the tutorial

https://docs.godotengine.org/en/4.4/tutorials/editor/command...

History is cyclical. Because I remember same situations m$ windows released features years after the same feature in GNU/Linux, or Iphon€ vs android.

show 1 reply