cmd

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 18 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 ChatAppConfig = &grumble.Config{
	Name:                  "chat",
	Description:           "Interactive Chat CLI",
	HistoryFile:           ".lupo.history",
	Prompt:                "lupo chat ☾ ",
	PromptColor:           color.New(color.FgGreen, color.Bold),
	HelpHeadlineColor:     color.New(color.FgWhite),
	HelpHeadlineUnderline: true,
	HelpSubCommands:       true,
	Flags: func(f *grumble.Flags) {
		f.String("c", "config", "wolfpack.json", "config file for lupo client, expects default filename to exist if not specified")
		f.String("r", "resource", "", "resource file for lupo server, all commands in this file will be executed on startup, expects default filename to exist if not specified")
	},
}

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

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,
	Flags: func(f *grumble.Flags) {
		f.String("c", "config", "wolfpack.json", "config file for lupo client, expects default filename to exist if not specified")
		f.String("r", "resource", "", "resource file for lupo server, all commands in this file will be executed on startup, expects default filename to exist if not specified")
	},
}

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 ExecuteResourceFile added in v1.0.1

func ExecuteResourceFile(resourceFile string)

ExecuteResourceFile - executes a provided set of lupo commands from a specified file.

func GetChatLog added in v1.0.1

func GetChatLog()

func InitializeChatCLI added in v1.0.1

func InitializeChatCLI(chatApp *grumble.App)

InitializeChatCLI - Initialize the nested chat CLI arguments

"chat" 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.

"chat" base commands include:

"back" - resets the current active chat to "false" and closes the nested chat sub-shell.

"message" - takes a message that will be sent to the chat API and broadcasts to all users in the chat.

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