RoTerminal - A CLI For Roblox Studio

What is RoTerminal?


RoTerminal is plugin that behaves similarly to the Windows Command Prompt or any other Terminal in general. It is capable of executing commands to do tasks.
Almost every developer has the Explorer, Properties and Command Bar open at all times. But using RoTerminal, you are able to do almost all the stuff they let you do, all in a single place. Using commands.


If you have a Linux based operating system, you are already familiar with CLIs.

Overview

Commands
  1. cd
    This command stands for Change Directory.
    You are able to navigate between directories as Instances.
    The default directory which you start with is game/Workspace
    The name of the Instance should be entered as the argument if its a child of the instance as current directory. If you want to navigate to the parent directory of the current directory, you would be passing ... In a different case, when you want to navigate to a completely different directory, you are able to write the entire path.
    Example:

  2. open
    This command lets you open script editor directly through the terminal.
    Lets take the following as a scenario.
    image
    To open the script editor for that script, you would execute:
    image
    As you might have already realized, the argument passed to open is the name of the script. The script needs to be a child of the current directory.

  3. tree
    Sometimes you want to know that which instances the directory actually contains. The tree command when executed. Will print all the descendants as a tree.
    image
    It doesnt require any arguments.

  4. lua
    Coming back to the use cases, RoTerminal lets you execute lua code directly.
    When the lua command is executed, it opens a sub terminal which lets you enter lua code.
    image
    As stated, you can exit the lua terminal by writing exit
    image

  5. gen
    This command lets you generate instances, they are automatically parented to the current directory.
    image
    The first argument is expected to be the ClassName of the Instance. The second argument can be left out and is optional, but it renames the instance to it after it creates it.

  6. del
    Now that you can create instances, you might want to be able to delete them too.
    You can do that with the del command.
    image
    The instance needs to be a child of the current directory.
    The first argument is the name of the Instance to be deleted. But in case you have many more instances with the same name and you want all of them deleted. You can pass the second argument as true. The second argument is optional and you need not pass it when not required. Deleting an instance will also delete all of its descendants.

  7. prop
    This command lets you execute property operations such as getting and setting
    The first argument must be a specifier (either -get or -set) which specifies whether to get or set.
    Setting Properties


    When setting properties, the second argument must be the name of the Instance and it should be located in the current directory. The third argument would be the name of the property name and the the fourth would be the value. Some datatypes need a specific format in order to be interpreted. This has been discussed in the Special Formats section.
    Getting Properties
    image
    You can retrieve properties when passing the -get specifier. The second argument is the name of the Instance while the third one is the Property Name.

  8. alias
    If you prefer a different name for a command, you are able to use this command to give it an alias.

Things to keep in mind:

  • An alias name cannot start with an integer.
  • An alias name cannot have a name which belongs to a command.
  • A single command can have any number of aliases

You are also able to have aliases that save, so that you can use them without having to add them each session. You can also have temporary aliases which do not save after closing studio.
Setting aliases
If you want to set aliases which save, you can use the -set specifier.
The second argument should be the name of the alias, while the third one should be the name of the command which the alias is being set for.

When trying to make a temporary alias, you would do the same thing as above, but using the -tempset specifier.

Removing Aliases
The process of removing temporary and saved aliases is the same. It uses the -rem specifier. Second argument being the name of the alias.

  1. config
    This command does not function yet. The purpose of this command is to be able to change how the terminal looks as well as the default values. Such as the path, text color, warning color, background color, ect.

  2. cmds
    This command prints all the commands, and how to use them

If you execute commands which require arguments, without any argument. It will display helpful information. So keep this small trick in mind.

Special Formats

Some datatypes need a strict format in order to be recognized and translated by the terminal. Currently the only supported ones are Numbers, Strings, Booleans, Enums, Color3, Vector3, Vector2, UDim2, nil. Ill be adding support for more later on.

Numbers, Strings, Booleans, nil
These types dont need a special format and are recognized straight away.

Color3, Vector3
When you want to use such datatypes, this is how they should be formatted.
{value1,value2,value3}
Use case:
setprop Baseplate Color {255,255,255}
setprop Baseplate Position {100,100,100}
Spaces are not accepted between the values in this format.


Vector2
This format is similar to that of the above
{0.5,0.5}
Use case:
setprop Frame AnchorPoint {0.5,0.5}


UDim2
This format is similar to the above aswell
{1,0,1,50}
Use case:
setprop TextLabel Size {1,0,1,0}


Enum
This format is similar to that of the path.
Enum/Material/Sand
Use case:
setprop Baseplate Material Enum/Material/Sand

Limitations

This plugin is in early stage of development. Although there are a few things which are not possible to do using this.

  • You are not able to make Package operations, publish / Create plugins and a few other things which are only possible using the explorer when you right click. This is a limitation that roblox has with plugins, so this cannot be implemented unless they add it.
  • The terminal is disabled during playtesting as of today. This is because it isnt stable during playtesting due to some reasons. This is expected to be fixed soon.
Planning to add
  1. Config command, what this command is capable of has already been stated
  2. Direct execution of lua code if passed as a parameter to lua command.
  3. Command line options such as -editor for lua command, which opens a temporary script, lets you edit it and listens for an execution command. It then executes the code and deletes the script after. This lets you write command line lua code in the script editor with all the tools it provides!
  4. Custom commands
  5. Being able to execute multiple commands using & (executes all given sets of commands in order regardless of any of them erroring) aswell as && (which stops executing commands further if one of them errors)
    Example: cd game/ServerScriptService && gen Script MyScript && open MyScript
  6. Being able to save the place directly through the terminal using the save command, as well as a confirmation entry (Y/N) to avoid mistakes.
  7. A better lua terminal, which can have pre-defined variables set through the terminal
Known Unfixed Issues
Update Log

Update 1.1

  • Merged setprop and getprop to a single command prop , which uses specifiers to do actions.
  • Added aliases
  • Fixed a bug regarding retrieving EnumItem type values from properties.

(Check the commands section for a guide)


Current Version : 1.1

I made this plugin mainly to test how far I could go. I also wanted to contribute to our community. The plugin is now open source and the github link can be found here

Any feedback, command requests, bug reports are appreciated.
This plugin is not my primary focus but I’ll be maintaining it and adding more features every once in a while.

Have a great day!

37 Likes

A CLI inside Roblox, amazing! Are you planning to support own modules (own commands) so I can make game-specific commands for the terminal? It would be great if there’s something like a “RoTerminalModules” in the game, so collaborators can use the commands too!

4 Likes

Seems a great idea. Thank you for the suggestion. Will probably implement this soon.

3 Likes

this is cool
suggestions:

  • alias command
  • more file commands (cat, cp, mv, mk/rmdir, etc.)
  • named arguments (so i could create a custom command like create className="Part" name="Block"
  • ability to add custom commands through modules, preferably in ServerStorage
  • instead of get/setprop, something that would be better in my opinion would be a unified prop command which returns the existing value if no new value is provided, otherwise sets the property to the provided value
3 Likes

Finally, a command prompt, that looks like the command prompt, in Roblox

1 Like

Great idea! I most definitely plan on using this.

1 Like

This is crazy, I was literally in the process of creating a CLI for studio a few days ago and here you are beating me to it.

Great contribution!

2 Likes

It would be really nice if the lua terminal acted on the context of where you are in the tree currently, so you could write lua for the current instance rather than just global stuff like print.

2 Likes

Wow! This is amazing! One thing that I would recommend is aliases, just like in bash (alias rm="del"). What would also be really cool is a command that directly executes scripts.

2 Likes

Never used a terminal before, but the sheer ingenuity of this makes me want to learn. Amazing work.

1 Like

This looks really cool. Any chance pipes and redirects are on your todo? For example if in the future you implemented a grep type command then one could run tree on a large directory and pipe it into grep to search for certain patterns, which is certainly useful if someone is used to using shells a lot. Anyway, very cool, great job.

2 Likes

Will definitely look forward to adding this. It seems a very useful thing indeed.

2 Likes

Update 1.1

  • Merged setprop and getprop to a single command prop, which uses specifiers to do actions.
  • Added aliases
  • Fixed a bug regarding retrieving EnumItem type values from properties.

(Check the commands section for a guide)

3 Likes

I have a few suggestions for this plugin

Make an exit command that just closes the CLI
Make it not full screen and that we can move the window
Allow us to do something like open game.ServerScriptService.Loader

I had been quite busy for the past month, so I was unable to work on the CLI. However, I am now able to work more on the CLI. Planning on adding tons of new commands, and support for pre-written scripts which are capable of running commands whenever invoked and much more!

The terminal has been made open source and I believe this will greatly accelerate the development of this plugin. The github link can be found here. The tasks can be found in the issues tab.

Great work and amazing idea! Could have never thought about something like this myself, looking forward to test the plugin myself. :wink:

Idea: add the ability to customize the colour theme of the terminal.

nice but you should also make option to choose between windows or unix as some ppl are more familiar with bash

fr ex rm -rf directory
ls
andmore