User Studio CLI Flags

As a Roblox developer, it is currently too hard to pass startup information from external tools like Rojo to Studio which hinders the efficiency of mine and others development processes.

I am working on implementing a specific Rojo feature called rojo open. This command will build a place file, open it in Studio, start serving a Rojo server, and automatically connect to the server from the Rojo plugin in Studio. For this to work, the plugin must be informed of which server it should connect to. There are potential approaches, but they have drawbacks:

  • Injecting an Instance into the place file with server connection info: This method modifies the place file, potentially introducing unwanted changes for the user (especially if they add places files to version control). It may be possible to use this approach for cloud places using the Open Cloud API but this would add to loading times and require an API key. There is also risk of the Instance being saved to the place, causing Rojo to connect the next time the Rojo plugin starts.
  • Adding a local plugin to connect to the server through Rojo’s headless API: This strategy can lead to unintended connections if another place file is already open or if the plugin fails to be deleted.

To address these challenges, I suggest implementing CLI flags for Studio that can be read by plugins, such as:
RobloxStudioBeta.exe --user ROJO_OPEN_IP=localhost --user ROJO_OPEN_PORT=34872

```lua
local flags = plugin:GetUserFlags()
print(flags)
-- {
--     ROJO_OPEN_IP = "localhost",
--     ROJO_OPEN_PORT = "34872",
-- }

If Roblox is able to address this issue, it would enhance the development experience for myself and many others who rely on such tools. This feature could streamline workflows significantly. Consider the current multi-step process:

  1. rojo build -o place.rbxl
  2. start place.rbxl
  3. rojo serve
  4. Open Rojo plugin in Studio.
  5. Click Connect button.

This could be simplified to a single command:

  1. rojo open -o place.rbxl
16 Likes

An immediate concern of mine would be having this as a potential attack vector since it could provide a new way for people to be tricked into giving API tokens or cookies to people. However, I think the risk is relatively minimal because if someone is able to talk a user into copy and pasting a token into something, they’ve already basically won.

This is an unusually solution-driven feature requests but Rojo’s problems are unusual. I would welcome other methods for passing arbitrary strings to Studio at startup if they were made available though. CLI arguments are just easiest.

2 Likes