About
I’ll get right to the point. StudioCLI is a terminal and package manager combined in one. It features many popular Bash commands altered to fit Roblox and has its own package manager, similar to npm
(NodeJS).
Picture
Commands
Here’s the fun part - StudioCLI features over 45 commands upon installation. Their documentation is divided into sections below.
Bash & Added
(Also accessible from running help
in the Terminal)
Expand
cd
- Change the current directory
echo
- Print some output
edit
- Edit the script (current directory)
exit
- Kill the terminal
head
- Read the first 10 lines of the specified file
less
- View the specified file
ls
- View the children of the current directory
mkdir
- Make a new directory in the current one
pwd
- Output the current directory
rm
- Destroy the current path
rmdir
- Destroy the current directory
tail
- Read the last 10 lines of the specified file
touch
- Create a new file in the current directory
git (Version Control)
Summary
git add {fileName: string}
Add a file to the staged file list
git branch [name]
Include name
to add a new remote + local branch, don’t include name
to list local branches.
git checkout {name}
Change current branch to name
git clone username/repo_name
Clone a git repository - it even support Rojo projects!
git commit [-m "message_here"]
Commit staged files to the local .git
folder
git config {displayname|token} [new value] [-g] [--print]
Include a new value to overwrite the current one, and add the g
flag to make it global (mainly for tokens), but don’t include a new value to list the current one. Add the print
argument to print it to the Output tab rather than the Terminal window.
git init [name] [--remote] [--both]
Initialize the git repository. Use --remote
to only initialize a remote repo, --both
for both local and remote, or neither for only local.
git push [branch]
Pushes the current local branch’s latest commit to the specified branch in the remote repository.
git reset [file] [-f]
Remove a staged file from the staged list or only use the f
flag to clear the staged list entirely.
git staged
View the staged files
git version
Print the current version of git
rbx (Package Manager)
Expand
rbx cloud
Registers you with the rbx package cloud server
rbx ls [-g]
List the current installed packages in the current directory (if the g
flag is set, list the global packages)
rbx import [-g]
Prompts you to import a .lua file as a script (.rbxmx format coming soon!)
rbx init [-f]
Create a new PackageFile (similar to package.json
in Node projects) in ReplicatedStorage. If the f
flag is set, overwrite the current PackageFile.
rbx install {packageName: string|rbxassetid: number} [--global] [-g]
Probably the most important feature - installing! You can install a “package”, or module (although this uses game:GetObjects()
under the hood), by providing it’s registry name (see below) or Roblox AssetId. If the global
argument or g
flag is provided, the package will be installed in a folder under ReplicatedStorage called “rbx_modules”. Otherwise, it will install in the current directory.
What is a “registry name”, you may ask?
A registry name is essentially a string to represent a module’s ID. For example, @AstrealDev’s MathEvaluator, which has the ID of 7323648466
, is represented by the registry name “MATHEVALUATOR” (case-insensitive). If I wanted to install MathEvaluator, I could simply type rbx install MathEvaluator
for it to work.
rbx key {key: string}
Sets the rbx cloud auth key - you shouldn’t use this unless there’s a problem with authentication
rbx publish {name: string} {assetid: string}
Publish a Roblox AssetId to the Cloud Registry with a specific name - works just like the normal registry but this one’s in the cloud and you can publish
Example: rbx publish test3 2949893496
rbx run {scriptName: string}
This is the equivalent of npm run <scriptName>
, but you cannot run Lua files. For those who are not familiar with npm run
, this command runs a “script”, aka function, defined in the PackageFile.
Detailed Explanation
If my PackageFIle were the following…
return {
['name'] = 'my-roblox-game',
['version'] = '0.0.1',
['description'] = 'my roblox game',
['scripts'] = {
['build'] = function()
print("Building project!")
end,
}
}
…and I ran rbx run build
in the Terminal, it would run the build
function and print Building project!
.
rbx star {packageName: string|rbxassetid: number}
Star your favorite packages and view them with rbx stars
.
rbx stars
List your starred packages.
rbx whoami
Output your Username & UserId into the terminal.
rbx uninstall {packageName: string|rbxassetid: number} [--global] [-g]
Uninstall an installed package. If the global
argument or g
flag is provided, it will uninstall the package from the rbx_modules
folder.
rbx unstar {packageName: string|rbxassetid: number}
Unstar a no-longer-favorite package.
rbx update {packageName: string|rbxassetid: number} [--global] [-g] [--all] [-a]
Update a package to the latest version. If the global
argument or g
flag is provided, update it globally. If the all
argument or a
flag is provided, update all packages in that directory. Remember, when updating all packages, the packages will install with their default name and not take into consideration if you renamed them after initial installation!
rbx version
Outputs the installed version of rbx
HTTP
The Terminal also comes with two built-in HTTP commands. Why? Since I felt it may be useful in certain scenarios.
Expand
http get {url: string}
GET a URL, there’s not much to it but that.
http post {url: string} {data: JSON string} [--contentType: string = applicationJson] [--compress: boolean = false]
POST to a URL with some data (cannot include spaces or it’ll break)
Audio
Yes, this also comes with a built-in audio player! (however, you may prefer Studio Radio)
Expand
audio play {audioId: number} [--looped] [-l] [--volume]
Play the specified audioId. The looped
argument and l
flag indicated the song’s Looped value and the volume
argument lets you alter the volume.
audio pause
Pause the audio.
audio resume
Resume the audio.
audio stop
Stop the audio.
audio reset
Reset the audio.
Misc
Expand
code {directory: string}
Open a VSCode-style side widget that has the specified directory open
toggle {setting: string}
You can choose the setting from the list here:
colors -- Syntax highlighting toggle
lua {code: string}
Execute a lua string
Installation
You can install the plugin here.
Contributing
You can make a Pull Request to the repository with your changes to the Commands file.
StudioCLI API
When creating a new function, you have three options: making a regular function, making a table-function, or making a library.
Function
['test'] = function(self, regular, args, flags)
print(regular)
print(args)
print(flags)
end,
Table-Function
['test2'] = {
"Hello testing!",
function(self, regular, args, flags)
print(regular)
print(args)
print(flags)
end
},
Library
['test3'] = {
['test3-1'] = function(self, regular, args, flags)
print(regular)
print(args)
print(flags)
end,
['test3-2'] = {
"Hello testing!",
function(self, regular, args, flags)
print(regular)
print(args)
print(flags)
end
}
}
You are given four parameters: self
, regular
, args
, and flags
.
Regular (indexed table) consists of regular text provided, such as the “world” in hello world --hi bye --g
.
The args is a dictionary consisting of the double-hyphen arguments provided, such as the “–hi bye”. You would retrieve the “hi” argument by doing args['hi']
/
The flags (indexed table) consist of the single-hyphen arguments provided, such as the “-g”. You would check for flags with table.find(flags, "<letter here>")
.
self
, on the other hand, refers to the actual TerminalHandler class. Therefore, you are able to call methods such as :NewLine
for a blank line, :NewMsg
to output a new message, and :__evaluate
to basically loadstring
a Terminal command.
That’s it for the API. Thanks for taking the time to create more functions for StudioCLI and contributing to its growth!
Thanks for reading, and as always, happy coding!