How to run a .tscn file outside godot?

Basically title. I want to run a .tscn file (for example main, which has the game) using CLI. Something like how would you do it with cmake. From what I’ve understand godot -e foo.tscn should work, but I don’t have the godot command, I only have the godot-engine.

godot scene.tscn

Or if you have cd’d to nested scene, not at the root of the project.

project_root/path/to/$ godot --upwards nested_scene.tscn

Or you are at root of project
project_root/$ godot path/to/nested_scene.tscn

The engine and cli are one and the same.

well yeah I’ve seen that on docs, the problem is I don’t have godot in my terminal ( I am using Linux ). I only have the .x86 file. If I try to run that with the main.tscn for example, it only opens the engine.

You can still use the CLI you just need to do something like

~/game_project/$ home/user/my/path/to/godot_x86 scene.tscn

To make your life easier, you just need to make an alias for Godot binary path and put it in your bash profile so you don’t have to type this alias each time you open a new terminal.

$ alias godot=home/user/my/path/to/godot_x86

Then the command should work as intended

I typically make a symlink to the latest Godot version, and made an alias to the the symlink and that symlink I point at whichever version I want to use. Which usually happens every 3 to 6 months when new versions of Godot engine release.

Another option is to cp the Godot engine binary to /use/bin renaming it to godot. Then the default PATH environment will automatically pick it up.

cp home/user/my/path/to/godot_x86 /use/bin/godot

I also setup an application profile for Godot on that same symlink so I can just search for the app in the finder command. I will share that later.

1 Like