Clide Config/Command Reference
Welcome to the clide reference docs. This page contains information about the various fields that can be utilized for configuration of a clide demo. If you are instead looking for documentation pertaining to the Go package "clide" used in making this project take a look at the project's godoc page to get more information.
Example JSON
Global Configuration
clearBeforeAll
JSON{}
"clearBeforeAll": falseGo
cfg.ClearBeforeAll = falseA global setting to clear the terminal window before every command. Setting this to true is identical to setting 'clearBeforeRun' for each command in the demo.
colorScheme
JSON{}
"colorScheme": {"R":255,"G":255,"B":255,"A",255}Go
cfg.ColorScheme = clide.Colors{}The color scheme used for all windows. Customizable fields include user text, directory text, primary text, and window background.
commands
JSON{}
"commands": [ { } ]Go
cfg.Commands = [ ]clide.Command{ }Holds the array of command objects to run during the demo. A commands field is required for Clide to run a demo. See the next section of for more information regarding fields used for commands.
directory
JSON{}
"directory": "/"Go
cfg.Directory = "/"The directory that appears in the clide terminal window
fontPath
JSON{}
"fontPath": "assets/UbuntuMono-B.ttf"Go
cfg.FontPath = "assets/UbuntuMono-B.ttf"The file path for the font file you want clide to use when drawing text to all windows.
fontSize
JSON{}
"fontSize": 18Go
cfg.FontSize = 18The size of the font written to all clide windows.
hideWarnings
JSON{}
"hideWarnings": falseGo
cfg.HideWarnings = falseSets whether warnings for uninstalled commands will be shown. If set, a warning will be printed before running the demo showing the uninstalled commands. Another warning will also appear during runtime showing that the uninstalled command has been skipped.
hideWindows
JSON{}
"hideWindows": falseGo
cfg.HideWindows = falseIf set to true, windows will not be shown until a command is set to write to the window. Enable this setting to hide windows that will be used after the start of the demo. When changing window layouts with resizeWindows, windows will once again be hidden until a command is set to write to the window.
humanize
JSON{}
"humanize": 0.5Go
cfg.Humanize = 0.5The ratio used in randomizing the delay for each character printed into the terminal. This value is expected to be between 0.0 and 1.0. A value of 0.5 would randomize the key delay between +50% and -50%.
keyTriggerAll
JSON{}
"keyTriggerAll": falseGo
cfg.KeyTriggerAll = falseA global setting to ignore timings and wait for a key press to execute the command print and execute. The key used to trigger the timings must be present in the triggerKeys array for clide to recognize the event. Setting this to true is identical to setting 'waitForKey' for each command in the demo.
triggerKeys
JSON{}
"triggerKeys": ["space", "right", "a"]Go
cfg.TriggerKeys = [ ]string{"space", "right", "a"}The list of keyboard keys that can be used to trigger the execution or typing/printing of a command. Clide uses go-sdl2 for keyboard event handling. The list of recognized strings representations for keys can be found in the keycodes.go file in the go-sdl2 github repository.
typespeed
JSON{}
"typespeed": 100Go
cfg.TypeSpeed = 100The delay before each character is printed to the terminal in milliseconds. When humanize is set, the delay will be randomized based on the humaize ratio for each character. Typespeed is actually a measurement of a timed delay, so a higher typespeed will mean slower typing.
user
JSON{}
"user": "demo@clide"Go
cfg.User = "demo@clide"The username that appears in the clide terminal window
windows
JSON{}
"windows": {"name":"clide","x":0,"y":0,"h":600,"w":800}Go
cfg.Windows = [ ]clide.Window{ }The collection of data representing the size and position of the clide terminal window. Multiple can be specified and each can be targeted using the window's unique name.
Command Configuration
async
JSON{}
"async": falseGo
cmd.Async = falseRuns the command and continues on to the next command without waiting for execution to finish. If async commands are running alongside other commands, each command must be in its own window for the output to display correctly.
clearBeforeRun
JSON{}
"clearBeforeRun": falseGo
cmd.ClearBeforeRun = falseClears the terminal before running the given command.
cmd
JSON{}
"cmd": "echo hello world!"Go
cmd.CmdString = "echo hello world!"A string containing the command as you would type it into a terminal.
hideWindow
JSON{}
"hideWindow": falseGo
cmd.HideWindow = falseHides the window associated with the command after execution is complete.
postDelay
JSON{}
"postDelay": 500Go
cmd.PostDelay = 500Sets the amount of delay in milliseconds before the command will be executed. While postDelay is waiting, the command prompt and command to be executed will be visible in the terminal.
preDelay
JSON{}
"preDelay": 500Go
cmd.PreDelay = 500Sets the amount of delay in milliseconds before the command will be typed/printed to the terminal. While preDelay is waiting, the command prompt will be visible in the terminal.
typed
JSON{}
"typed": falseGo
cmd.Typed = falseDetermines whether the command will be typed into the terminal. If set to false, the whole command string will be printed to the terminal.
resizeWindows
JSON{}
"resizeWindows": {}Go
cmd.ResizeWindows = []clide.Window{}Resize windows adjust the window position and size of each window defined in the given window array. Any windows being adjusted must already be defined in the window field in Config.
timeout
JSON{}
"timeout": 5Go
cmd.Timeout = 5Sets the amount of time to wait in seconds before killing the process. Use this field with commands that don't exit without user input (ex. listening servers, ping)
waitForKey
JSON{}
"waitForKey": falseGo
cmd.WaitForKey = falseWaits for a key present in triggerKeys to be pressed to execute the printing/typing of the command, and the execution of the command. If set, timings in preDelay and postDelay will be ignored.
window
JSON{}
"window": "clide"Go
cmd.Window = "clide"Specifies the window in a multi-window demo to execute the command in. Note that the process is executed in a separate process and the output is sent to the given window.