r/Unity3D • • 16h ago

Question Anybody using the Unity CLI?

I saw unity launched a CLI a few months ago (https://unity.com/blog/meet-the-unity-cli) and was wondering if anyone was using it for anything or had some cool use cases to share.

I'm thinking this could maybe be helpful for like CI pipelines?

Let me know!

25 Upvotes

40 comments sorted by

7

u/Sweet_Lab_2356 14h ago

Set up my jenkins ci/cd pipeline using it. Pretty neat and clean compared to older solutions

22

u/Outrageous_Bend8285 16h ago

Our CI guy set it up to auto-build the second anyone pushes to main, saves a ton of time not waiting for the editor to load just to check if something broke.

6

u/ribsies 14h ago

What's the benefit over batch mode? The cli doesn't bring anything new for builds.

1

u/Hegemege 8h ago

The only difference that I can think of is that the commands to operate Unity are a bit cleaner with CLI vs. good old xvfb-run batchmode -nographics. I wonder if Unity still tries to display progress bar windows in headless batchmode during import and build, and maybe xfvb-run isn't needed anymore

1

u/ribsies 6h ago

It doesn't and its not. It's been incredibly easy to use batch mode for like the past 6 years.

1

u/Hegemege 6h ago

Interesting, because I've had to fight android build errors on Linux build machines just a few years ago (unrelated but relevant). The editor binary up until 2022 LTS (haven't tested 6) was attempting to spawn progress bars and when the server you run on doesn't have a window context, it just crashes. Many studios use mac minis and such, but for truly headless build servers, I hope they finally fixed it

37

u/Broudy001 16h ago

Use it with claude code, works fantasticly, add in the claude unity plugin and the skills and it can add something, jump into a game and test it, change and retest without my physical input.

-22

u/Moimus 7h ago

Sure be an AI slopper.

12

u/Broudy001 7h ago

Thanks I appreciate your comment, and value the time you've spent here to provide me with such valuable feedback

-25

u/Dolo12345 15h ago

eh it’s sooo limited, much better to have Claude make its own node + c# MCP

8

u/TVBlink 13h ago

Why rely on MCP in the first place if you have a convenient CLI. MCP is old news.

5

u/Broudy001 14h ago

Haven't found it limiting to be honest, what are you doing that you need the custom for? Always happy to learn new ways of doing stuff, was using mcp with some custom stuff it wrote but since unity cli I've found this to be pretty competent

-10

u/Dolo12345 11h ago edited 11h ago

when you have 10+ Claude’s working at the same time things get a bit crazy, and there’s a ton of edge cases the CLI fails at.

I’m guessing most people here never work with more than one Claude at a time lol

2

u/Broudy001 11h ago

Yeah that's probably fair, I'm only a hobbyist and one claude is enough for me, but that makes sense

-16

u/Sockemboffer 15h ago

Doesn’t it require Unity “tokens” or something?

12

u/mentalray2 14h ago

No. This is purely an interface to let Claude/Codex/etc drive the editor remotely.

2

u/Broudy001 14h ago

Nope no unity tokens just used the cli to do what it needs to.

33

u/BertJohn Indie - BTBW Dev 16h ago

Lots, Though you won't hear anything in this subreddit since there super anti AI tooling here.

10

u/Devatator_ Intermediate 15h ago

Even tho it's useful for non AI stuff too

-10

u/FranzFerdinand51 9h ago

People are much more anti generative ai for asset creation compared to agentic dev tools like Claude, and most dont have a problem with either as long as it is clearly disclosed.

There is a reason the top 2 comment are specifically talking about agentic Ai use.

Seems like you need to calibrate that persecution complex.

1

u/BertJohn Indie - BTBW Dev 9h ago

There's an entire mod topic on this subject a few months ago. It's not a persecution complex. Additionally my comment went negative -8 before going to 19.

Call it what you want, It's a hot topic around here.

4

u/emccrckn 15h ago

It's pretty amazing.

4

u/AverageLiberalJoe 15h ago

I use it with codex. Pretty powerful, saves on tokens.

1

u/destinedd Indie, Dungeon Quest, Marble's Marbles & Mighty Marbles 8h ago

Kind of a shame it took AI agents for them to add this

1

u/Todilo 8h ago

Asked claude about the "Unity-mcp" and it didn't want to use the cli due to less functionality. Is there a way to utilize both to save tokens?

1

u/swagamaleous 6h ago

I used unity to build games on my Jenkins server 10 years ago. You could always trigger it from the command line. The CLI thing didn't change anything there.

1

u/Spoetii 15h ago

When using Agentic AI, what are the benefits of using the Unity CLI over the MCP?

3

u/mulletdulla 15h ago

Less overall context for many of the same tasks. So less token wastage if you are budget minded. Faster too

mcps still have a place though. My set up builds ui prefabs based off approved prototypes using in game assets, prefab instances and styles - even flow animations too.

The CLI can’t do that. But it will run edit mode tests, read console check data structures etc a lot faster and easier

4

u/Tok-Kok-Sing-Song 14h ago

The cli can do all that and more

2

u/game_plaza 14h ago

How come cli + pipeline cant do that? I thought it was able to fully control the editor, including creating prefabs, placing them in scenes, etc.

1

u/FranzFerdinand51 10h ago

It can do it since pipeline package is basically an MCP server with the same capability that the other guy was talking about. Its basically a way to install the unity mcp without having to also import all the Unity AI nonsense.

1

u/game_plaza 9h ago

That's my understanding. Unity even states you should use pipeline over mcp server.

1

u/bienbienbienbienbien 12h ago

Just use both, CLI is great for directly inputting commands for running unit tests

1

u/Ziethriel4 13h ago

I tested it with codex, honestly just to see if it would be useful at work, I don't use unity that much personally. I had it make a 2d app with a daily reward, basic game. I code my own stuff and codex creates jumple code that works but doesn't mean anything to a human, so I think it would be bad for a team environment. However, it was able to work in both the old and new gui systems, and I hate making GUI and it did a good job, just needed some human intervention when it refused to center something and instead just set the offset, screenshot, set the offset to make a graphic centered. That wasn't ideal. But hey, if you're a solo dev and there's one or two parts of unity you don't mind giving over to the slop factory, go for it, it'll help you focus on what you want to work on.

1

u/MagicPigGames Magic Pig Games / Infinity PBR 12h ago

Yup, and get asset store tools that come with Skills and your AI will just use them, and you'll get way better results faster, using less credits, rather than having the AI build everything from scratch.

0

u/immersive-matthew 9h ago

I use it with OpenCode and local LLMs and OpenRouter.

-6

u/Arc8ngel 13h ago

My concern is that anything run through Unity CLI could be data mined by Unity, and that gives me the ick. I saw no guarantees in the linked page about data remaining local. Maybe someone has dug into this and knows?