cmd

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package cmd - the "cmd" package is the core packaged used to reference and manage all grumble integrated commands/features of the application.

The "cmd" package houses all of the core "interface/application" code which is a mix of both user interface and logical functionality.

Index

Constants

This section is empty.

Variables

View Source
var ActiveSession = -1

ActiveSession - Active session that is being interacted with by the user

This data is supplied as a parameter when switching sessions with either the "interact" command or "session" sub-shell

View Source
var App = lupoApp

App - Primary grumble CLI construction variable for switching nested app contexts

On initialization this is set to the "lupo" grumble config, but is used to switch to nested/sub-shells throughout the application where necessary.

The primary use case is switching between the "lupo" core shell and the nested "session" sub-shell that handles session management.

View Source
var Operator string

Operator username, will be loaded from config

View Source
var SessionAppConfig = &grumble.Config{
	Name:                  "session",
	Description:           "Interactive Session CLI",
	HistoryFile:           ".lupo.history",
	Prompt:                "lupo session " + strconv.Itoa(0) + " ☾ ",
	PromptColor:           color.New(color.FgMagenta, color.Bold),
	HelpHeadlineColor:     color.New(color.FgWhite),
	HelpHeadlineUnderline: true,
	HelpSubCommands:       true,
}

SessionAppConfig - Primary session nested grumble CLI config construction This sets up the lupo "session" nested/sub-prompt and color scheme, defines a history logfile, and toggles various grumble sepcific parameters for help command options.

Functions

func InitializeSessionCLI

func InitializeSessionCLI(sessionApp *grumble.App, activeSession int)

InitializeSessionCLI - Initialize the nested session CLI arguments

"session" has no arguments and is not a grumble command in and of itself. It is a separate nested grumble application and contains all new base commands.

"session" base commands include:

"back" - resets the current active session to "-1" and closes the nested session sub-shell.

"session" - the actual "session" command which is used to switch sessions by specifying an argument of a session ID to switch to. This is identical to the interact command only it allows you to switch sessions while in the session sub-shell as "interact" is unavailable in the sub-shell.

"cmd" - built in command directive to denote commands that are intended to be executed as a system command of a specified session. These commands are usually sent to the client as JSON in the format of {"cmd":"<some command"}. It supports multi-line/multi-arg commands.

"kill" - takes an argument of "id" which is used to de-register the specified session.

"load" - will load any additional functions that were registered by an implant. Must be ran each time you interact with a different session unless the implants of those sessions use the same additional functions.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL