Clide

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

example clide demo in json format

Global Configuration

clide config struct

clearBeforeAll

JSON{}

"clearBeforeAll": false

Go

cfg.ClearBeforeAll = false

A 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": 18

Go

cfg.FontSize = 18

The size of the font written to all clide windows.

hideWarnings

JSON{}

"hideWarnings": false

Go

cfg.HideWarnings = false

Sets 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": false

Go

cfg.HideWindows = false

If 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.5

Go

cfg.Humanize = 0.5

The 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": false

Go

cfg.KeyTriggerAll = false

A 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": 100

Go

cfg.TypeSpeed = 100

The 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

clide command struct

async

JSON{}

"async": false

Go

cmd.Async = false

Runs 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": false

Go

cmd.ClearBeforeRun = false

Clears 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.

hidden

JSON{}

"hidden": false

Go

cmd.Hidden = false

Runs the command in the background. The command will not be typed into the terminal and no output will be displayed.

hideWindow

JSON{}

"hideWindow": false

Go

cmd.HideWindow = false

Hides the window associated with the command after execution is complete.

postDelay

JSON{}

"postDelay": 500

Go

cmd.PostDelay = 500

Sets 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": 500

Go

cmd.PreDelay = 500

Sets 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": false

Go

cmd.Typed = false

Determines 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": 5

Go

cmd.Timeout = 5

Sets 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": false

Go

cmd.WaitForKey = false

Waits 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.