GreyTILBE is a Greyscript-based Terminal Interface Library for Bash Emulation.
Crafted with modularity in mind, GreyTILBE offers a flexible and scalable solution for creating terminal interfaces that mimic and extend the functionality of Bash.
Whether you're building custom terminal applications or enhancing existing ones, GreyTILBE provides the tools to streamline development and provide a seamless user experience.
- Command History: Maintain a persistent history of executed commands for easy navigation and repetition.
- Tab Completion: Supports tab completion for commands, arguments, and parameters, enhancing usability and speed.
- Command Parsing: Robust parsing of commands, arguments, and parameters to handle complex user inputs efficiently.
- Custom Command Class: Create and manage custom commands using a flexible command class that allows integration of unique data and logic.
- Environment Variable Handling: Manage and store both permanent and temporary environment variables, with temporary variables being deleted after runtime.
- Aliases: Create, manage, and freely edit command aliases for streamlined command execution and customization.
- Modular Design: Easily extend functionality with modular components for various terminal operations.
- Error Handling: Provides efficient error handling mechanisms to handle invalid inputs or unexpected scenarios.
- Scripting Support: Compatible with Greyscript for streamlined scripting and automation in terminal-based applications.
To create a custom command object, use
Name = new commandClass
The format for custom command objects is:
Name : {
"Description": desc,
"Args": {aName:
{"Description": pDesc, "Type": string/int/float/bool,
"Default": val, "SupportsEnvVars": float}
},
"Parameters": {pName:
{"Description": aDesc, "Default": bool}
},
"Aliases": [aliases],
"ExpectedResponses": {Type: [expected responses]},
"help": function(),
"run": function(**kwargs)
}
To add a command to the list of commands, simply use:
commands[CommandName] = Name
The easiest was to implement the library is to adapt the "GreyTILBE_defaultTerminal.src" file to incorporate your own commands but you can create your own terminal loop to fully customise your own script.
The "GreyTILBE_library.src" file is the only necessary file, as the "GreyTILBE_defaultCommands.src" file is optional, and the "GreyTILBE_defaultTerminal.src" file can be replaced with your own terminal loop.
- Use the greybel build command with a terminal loop file selected to create an installer file.
- Open CodeEditor.exe in game, and build and execute the file.
- Run GreyTILBE using the name you gave the file.
- Copy & paste the contents of "GreyTILBE_library" into CodeEditor.exe, build and "allow imports".
- Optional: Copy, paste & add the line import_code(path/to/built/GreyTILBE_library) to the start of the "GreyTILBE_defaultCommands.src" file, then build and "allow imports".
- Enter your own or copy & paste the "GreyTILBE_defaultTerminal.src" file, changing the import_code functions to reflect the locations of the "GreyTILBE_library" and "GreyTILBE_defaultCommands.src" files, then build.
- Run GreyTILBE using the name you gave the file.
- Support for
&&
to link commands - Command 'modes' to allow for more specific tab completion suggestions
- File-based commands
- Other general/common/requested commands
- Other requests
For support, feel free to open an issue or reach out on the official GreyHack Discord server!