{"id":"spacedice9/microterminal","name":"microterminal","scope":"spacedice9","platform":"roblox","description":"Simple library enabling CLI-like plugins in Roblox","version":"1.0.4","latest":"1.0.4","versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4"],"license":"MIT","licenseRating":"safe","licenseCaveats":["License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{"stravant/goodsignal":{"version":"^0.2.1","alias":"goodsignal"}},"integrity":"14977d84055df54a078a65996b2dfb13d80e8bd08e8afbfcab587ad89a102021","likes":0,"downloads":0,"install":"forest install spacedice9/microterminal","url":"https://forest.dev/p/roblox/spacedice9/microterminal","files":"https://api.forest.dev/ai/package/roblox/spacedice9/microterminal/files","readme":"# MicroTerminal\r\nA simple library that allows for the creation of GUI-less, CLI-like plugins in Roblox. To start, simply install the library, create a plugin and write the following code.\r\n```lua\r\nlocal MicroTerminal = require(path.to.MicroTerminal)\r\n\r\nfunction command(runContext: MicroTerminal.RunContext)\r\n\tprint(\"Running command\")\r\nend\r\n\r\nMicroTerminal.RegisterCommandToRobloxOutput(\"example\", command)\r\n```\r\nIf you then type `--example` (two dashes followed by a command prefix is the start of all commands in MicroTerminal) in the Command Bar, it will print `Running command` in the output. How neat is that?\r\n\r\nMicroTerminal exposes many methods to parse commands. Take for example the command `example --mode=17 ;Players;Player1.Character;Humanoid`. To handle this, the function should use the RunContext object.\r\n\r\n> The \"`;Players;Player1.Character;Humanoid`\" is an instance path, a way of representing Instances using a string. It resembles file paths in many computers but with `;` replacing `/`. In this case, it points to Player1's Humanoid.\r\n\r\n```lua\r\nfunction command(runContext: MicroTerminal.RunContext)\r\n\t-- It is casted into a number automatically!\r\n\tlocal mode: number = runContext:ContainsFlags(1, \"--mode={number}\")\r\n\r\n\t-- The second parameter is used because the first one is just the command prefix\r\n\tlocal parent: Instance = runContext:Param(2, \"instance\")\r\n\r\n\tprint(\"Using mode \" .. mode .. \" in Instance \" .. parent.Name)\r\nend\r\n```\r\nWhen typed into the Command Bar, the command would look like this.\r\n\r\n`--example --mode=17 ;Players;Player1.Character;Humanoid`\r\n> Yes, I know the double dash used to start the command is weird here. It's just so errors aren't thrown when this is put into the command bar. A workaround I used was to have a `!` at the start of every command prefix.\r\n\r\n## Documentation\r\nDocumentation is currently being worked on and is not complete. For now, refer to [`docs.md`](./docs.md) that serves as temporary documentation. For a more practical example, read [`examples/imp.server.luau`](examples/imp.server.luau) which implements a toolbox and catalog asset importing plugin using MicroTerminal.\r\n\r\n## Using Rojo\r\nGenerated by [Rojo](https://github.com/rojo-rbx/rojo) 7.4.1.\r\n\r\n### Getting Started\r\nTo build the place from scratch, use:\r\n\r\n```bash\r\nrojo build -o \"MicroTerminal.rbxlx\"\r\n```\r\n\r\nNext, open `MicroTerminal.rbxlx` in Roblox Studio and start the Rojo server:\r\n\r\n```bash\r\nrojo serve\r\n```\r\n\r\nFor more help, check out [the Rojo documentation](https://rojo.space/docs).","readmeTruncated":false}