Got a question that the wiki doesn't answer? Ask on the forum (preferred), or join us on IRC.

BeastNode

CommandHelper/Staged/CommandLineTools

From EngineHub.org Wiki
Jump to: navigation, search


CommandHelper has a rich set of command line tools for various tasks. To use the command line tools, run

java -jar CommandHelper.jar <arguments>

Explain Like I'm 5

Windows

First, open a command prompt. Hit WindowsKey+R, type "cmd" in the box, then hit enter. A black box should appear. cd to the directory your plugins are in, for instance, if your server was located at C:\Server\ then you would run cd C:\Server\plugins. Type dir to verify the name of the CommandHelper jar. This may be different depending on what you named it, but you'll use whatever it's named in place of CommandHelper.jar. Skip ahead to the next section.

Linux

Open a terminal. Depending on your linux distribution, this will be different, but the program is likely called "Terminal". Change to the directory your plugins are in. For instance, if your server was located at /server/ then you would run cd /server/plugins/. Run ls to verify the name of the CommandHelper jar. This may be different depending on what you named it, but you'll use whatever it's named in place of CommandHelper.jar. Skip ahead to the next section

Step 2

Run java -jar CommandHelper.jar from your prompt. You will see the help listing. Each tool is it's own "verb". The syntax for running a particular tool is java -jar CommandHelper.jar <verb> [<arguments for this tool>]

See the section below that shows the help listing for more details about each tool.

Tool listing

These are the command line tools for CommandHelper. For more information about a particular mode, run help <mode name>. To run a command, in general, use the command:

	java -jar classes <mode name> <[mode specific arguments]>


Modes: (a mode must be the first argument) 
	help (Aliases: --help, -help, /?): Displays help for all modes, or the given mode if one is provided.
	manager: Launches the built in interactive data manager, which will allow command line access to the full persistence database.
	interpreter: Launches the minimal cmdline interpreter.
	mslp: Creates an MSLP file based on the directory specified.
	version (Aliases: --version, -version, -v): Prints the version of CommandHelper, and exits.
	copyright: Prints the copyright and exits.
	print-db: Prints out the built in database in a human readable form, then exits.
	docs: Prints documentation for the functions that CommandHelper knows about, then exits.
	verify: Compiles all the files in the system, simply checking for compile errors, then exits.
	install-cmdline: Installs MethodScript to your system, so that commandline scripts work. (Currently only unix is supported.)
	uninstall-cmdline: Uninstalls the MethodScript interpreter from your system.
	syntax: Generates the syntax highlighter for the specified editor (if available).
	docgen: Starts the automatic wiki uploader GUI.
	api: Prints documentation for the function specified, then exits.
	examples: Installs one of the built in LocalPackage examples, which may in and of itself be useful.
	optimizer-test: Given a source file, reads it in and outputs the "optimized" version. This is meant as a debug tool, but could be used as an obfuscation tool as well.
	cmdline: Given a source file, runs it in cmdline mode. This is similar to the interpreter mode, but allows for tty input (which is required for some functions, like the prompt_* functions) and provides better information for errors, as the file is known.
	extension-docs: Generates markdown documentation for the specified extension utilizing its code, to be used most likely on the extensions github page.
	doc-export: Outputs all known function documentation as a json. This includes known extensions as well as the built in functions.
	profiler-summary: Analyzes the output file for a profiler session, and generates a summary report of the results.
	key-gen: Creates an ssh compatible rsa key pair. This is used with the Federation system, but is useful with other tools as well.
	pn-viewer: Launches the Persistence Network viewer. This is a GUI tool that can help you visualize your databases.
	core-functions: Prints a list of functions tagged with the @core annotation, then exits.
	ui: Launches a GUI that provides a list of all the sub GUI tools provided, and allows selection of a module. This command creates a subshell to run the launcher in, so that the original cmdline shell returns.

help

	Displays help for all modes, or the given mode if one is provided.

Usage:
	<mode name, ...>

Options:

	<mode name>: Displays help for the given mode.
	No flags.

manager

	Launches the built in interactive data manager, which will allow command line access to the full persistence database.

Usage:
	No arguments.

Options:

	No flags or options.

interpreter

	Launches the minimal cmdline interpreter.

Usage:
	[--location----- <location-----> (default ".")]

Options:

	No flags.
	--location-----: Optional. Sets the initial working directory of the interpreter. This is optional, but is automatically set by the mscript program. The option name is strange, to avoid any conflicts with script arguments.

mslp

	Creates an MSLP file based on the directory specified.

Usage:
	<path/to/folder, ...>

Options:

	<path/to/folder>: The path to the folder
	No flags.

version

	Prints the version of CommandHelper, and exits.

Usage:
	No arguments.

Options:

	No flags or options.

copyright

	Prints the copyright and exits.

Usage:
	No arguments.

Options:

	No flags or options.

printDB

	Prints out the built in database in a human readable form, then exits.

Usage:
	No arguments.

Options:

	No flags or options.

docs

	Prints documentation for the functions that CommandHelper knows about, then exits.

Usage:
	<type, ...>

Options:

	<type>: The type of the documentation, defaulting to html. It may be one of the following: HTML, WIKI, TEXT, or MARKDOWN
	No flags.

verify

	Compiles all the files in the system, simply checking for compile errors, then exits.

Usage:
	No arguments.

Options:

	No flags or options.

installCmdline

	Installs MethodScript to your system, so that commandline scripts work. (Currently only unix is supported.)

Usage:
	No arguments.

Options:

	No flags or options.

uninstallCmdline

	Uninstalls the MethodScript interpreter from your system.

Usage:
	No arguments.

Options:

	No flags or options.

syntax

	Generates the syntax highlighter for the specified editor (if available).

Usage:
	<[type], ...>

Options:

	<[type]>: The type of the syntax file to generate. Don't specify a type to see the available options.
	No flags.

docgen

	Starts the automatic wiki uploader GUI.

Usage:
	No arguments.

Options:

	No flags or options.

apiMode

	Prints documentation for the function specified, then exits.

Usage:
	<function, ...>

Options:

	<function>: The name of the function to print the information for
	No flags.

examples

	Installs one of the built in LocalPackage examples, which may in and of itself be useful.

Usage:
	<[packageName], ...>

Options:

	<[packageName]>: The name of the package to install. Leave blank to see a list of examples to choose from.
	No flags.

optimizerTest

	Given a source file, reads it in and outputs the "optimized" version. This is meant as a debug tool, but could be used as an obfuscation tool as well.

Usage:
	<file, ...>

Options:

	<file>: File path
	No flags.

cmdline

	Given a source file, runs it in cmdline mode. This is similar to the interpreter mode, but allows for tty input (which is required for some functions, like the prompt_* functions) and provides better information for errors, as the file is known.

Usage:
	<fileAndArgs, ...>

Options:

	<fileAndArgs>: File path/arguments
	No flags.

extensionDocs

	Generates markdown documentation for the specified extension utilizing its code, to be used most likely on the extensions github page.

Usage:
	-i <input-jar> [-o <output-file>]

Options:

	No flags.
	-i: Required. The extension jar to generate doucmenation for.
	-o: Optional. The file to output the generated documentation to.
	--input-jar: Alias to -i
	--output-file: Alias to -o

docExport

	Outputs all known function documentation as a json. This includes known extensions as well as the built in functions.

Usage:
	[-o <output-file>] [--extension-dir <extension-dir> (default "./CommandHelper/extensions")]

Options:

	No flags.
	-o: Optional. The file to output the generated json to. If this parameter is missing, it is simply printed to screen.
	--extension-dir: Optional. Provides the path to your extension directory, if not the default, "./CommandHelper/extensions"
	--output-file: Alias to -o

profilerSummary

	Analyzes the output file for a profiler session, and generates a summary report of the results.

Usage:
	[-i <#ignore-percentage> (default 0)] <input-file, ...>

Options:

	<input-file>: Path to the profiler file to use
	No flags.
	-i: Optional. A numeric value. This value dictates how much of the lower end data is ignored. If the function took less time than this percentage of the total time, it is omitted from the results.
	--ignore-percentage: Alias to -i

rsaKeyGen

	Creates an ssh compatible rsa key pair. This is used with the Federation system, but is useful with other tools as well.

Usage:
	-l <label> -o <output-file>

Options:

	No flags.
	-l: Required. Label for the public key. For instance, "[email protected]"
	-o: Required. Output file for the keys. For instance, "/home/user/.ssh/id_rsa". The public key will have the same name, with ".pub" appended.
	--label: Alias to -l
	--output-file: Alias to -o

pnViewer

	Launches the Persistence Network viewer. This is a GUI tool that can help you visualize your databases.

Usage:
	[--server] [--password <password>] [--port <#port>]

Options:

Flags:
	--server: Sets up a server running on this machine, that can be accessed by remote Persistence Network Viewers. If this is set, you must also provide the --port and --password options.

	--password: Optional. The password that remote clients will need to provide to connect. Leave the field blank to be prompted for a password.
	--port: Optional. A numeric value. The port for the server to listen on.

coreFunctions

	Prints a list of functions tagged with the @core annotation, then exits.

Usage:
	No arguments.

Options:

	No flags or options.

uiMode

	Launches a GUI that provides a list of all the sub GUI tools provided, and allows selection of a module. This command creates a subshell to run the launcher in, so that the original cmdline shell returns.

Usage:
	[--in-shell]

Options:

Flags:
	--in-shell: Runs the launcher in the same shell process. By default, it creates a new process and causes the initial shell to return.

Navigation menu