command

package
v0.0.0-...-4bd36a1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package command implements CLI commands for NemesisBot

Package command implements CLI commands for NemesisBot

Package command implements CLI commands for NemesisBot

Package command implements CLI commands for NemesisBot

Index

Constants

View Source

Variables

View Source
var (
	Version   = "dev"
	GitCommit string
	BuildTime string
	GoVersion string
)

Version information (set by linker)

View Source
var ConfigFiles embed.FS
View Source
var DefaultFiles embed.FS
View Source
var EmbeddedFiles embed.FS

Embedded filesystems (must be set by main)

Functions

func AgentHelp

func AgentHelp()

AgentHelp prints agent command help

func AuthHelp

func AuthHelp()

AuthHelp prints auth command help

func CORSHelp

func CORSHelp()

CORSHelp prints CORS command help

func ChannelHelp

func ChannelHelp()

ChannelHelp prints channel command help

func ChannelWebHelp

func ChannelWebHelp()

ChannelWebHelp prints web channel command help

func ClusterHelp

func ClusterHelp()

ClusterHelp prints cluster command help

func ClusterTokenHelp

func ClusterTokenHelp()

ClusterTokenHelp prints token command help

func CmdAgent

func CmdAgent()

CmdAgent runs the agent in CLI mode

func CmdAuth

func CmdAuth()

CmdAuth manages authentication

func CmdCORS

func CmdCORS()

CmdCORS manages CORS configuration

func CmdChannel

func CmdChannel()

CmdChannel manages communication channels

func CmdChannelExternal

func CmdChannelExternal(cfg *config.Config)

CmdChannelExternal handles external channel specific commands

func CmdChannelWeb

func CmdChannelWeb(cfg *config.Config)

CmdChannelWeb handles web channel specific commands

func CmdChannelWebSocket

func CmdChannelWebSocket(cfg *config.Config)

CmdChannelWebSocket handles websocket channel specific commands

func CmdCluster

func CmdCluster()

CmdCluster manages cluster configuration and status

func CmdClusterToken

func CmdClusterToken()

CmdClusterToken manages RPC authentication token

func CmdCron

func CmdCron()

CmdCron manages scheduled tasks

func CmdGateway

func CmdGateway()

CmdGateway starts the NemesisBot gateway server This command starts the bot service immediately (traditional behavior)

func CmdLog

func CmdLog()

CmdLog manages logging

func CmdMCP

func CmdMCP()

CmdMCP manages MCP servers

func CmdMigrate

func CmdMigrate()

CmdMigrate migrates from OpenClaw to NemesisBot

func CmdModel

func CmdModel()

CmdModel manages LLM models

func CmdSecurity

func CmdSecurity()

CmdSecurity manages security settings

func CmdSkills

func CmdSkills()

CmdSkills manages skills

func CmdStatus

func CmdStatus()

CmdStatus shows nemesisbot status

func CopyDirectory

func CopyDirectory(src, dst string) error

CopyDirectory copies a directory recursively

func CopyEmbeddedToTarget

func CopyEmbeddedToTarget(targetDir string) error

CopyEmbeddedToTarget copies embedded files to target directory

func CreateAgentLoop

func CreateAgentLoop(cfg *config.Config) (*agent.AgentLoop, providers.LLMProvider, error)

CreateAgentLoop creates a new agent loop with provider

func CronHelp

func CronHelp()

CronHelp prints cron command help

func Dispatch

func Dispatch()

Dispatch routes commands to their handlers

func ExternalHelp

func ExternalHelp()

ExternalHelp prints external channel help

func FormatBuildInfo

func FormatBuildInfo() (build string, goVer string)

FormatBuildInfo returns build time and go version info

func FormatVersion

func FormatVersion() string

FormatVersion returns the version string with optional git commit

func GatewayHelp

func GatewayHelp()

GatewayHelp prints gateway command help

func GetConfigPath

func GetConfigPath() string

GetConfigPath returns the main config file path

func GetGlobalShutdownChan

func GetGlobalShutdownChan() chan struct{}

GetGlobalShutdownChan returns the global shutdown channel Components can wait on this channel to be notified when shutdown is requested

func GetMCPConfigPath

func GetMCPConfigPath() string

GetMCPConfigPath returns the MCP config file path

func GetSecurityConfigPath

func GetSecurityConfigPath() string

GetSecurityConfigPath returns the security config file path

func InitLoggerFromConfig

func InitLoggerFromConfig(cfg *config.Config, checkArgs []string) int

InitLoggerFromConfig initializes the logger from configuration Returns a bitmask of what was overridden:

1 = --debug was used
2 = --quiet was used
4 = --no-console was used

func LoadConfig

func LoadConfig() (*config.Config, error)

LoadConfig loads the main configuration

func LogGeneralHelp

func LogGeneralHelp()

LogGeneralHelp prints general logging help

func LogHelp

func LogHelp()

LogHelp prints log command help

func LogLLMHelp

func LogLLMHelp()

LogLLMHelp prints LLM log help

func MCPHelp

func MCPHelp()

MCPHelp prints MCP command help

func MigrateHelp

func MigrateHelp()

MigrateHelp prints migrate command help

func ModelHelp

func ModelHelp()

ModelHelp prints model command help

func PrintAgentStartupInfo

func PrintAgentStartupInfo(agentLoop *agent.AgentLoop)

PrintAgentStartupInfo prints agent initialization info

func PrintHelp

func PrintHelp()

PrintHelp prints the main help message

func PrintVersion

func PrintVersion()

PrintVersion prints version information

func RunInteractiveMode

func RunInteractiveMode(agentLoop *agent.AgentLoop, sessionKey string) error

RunInteractiveMode runs the CLI interactive mode

func RunSimpleInteractiveMode

func RunSimpleInteractiveMode(agentLoop *agent.AgentLoop, sessionKey string) error

RunSimpleInteractiveMode runs a simple CLI interactive mode without readline

func SecurityConfigHelp

func SecurityConfigHelp()

func SecurityHelp

func SecurityHelp()

SecurityHelp prints security command help

func SecurityRulesHelp

func SecurityRulesHelp()

func SetEmbeddedFS

func SetEmbeddedFS(embedded, defaultFs, configFs embed.FS)

SetEmbeddedFS sets the embedded filesystems from main

func SetVersionInfo

func SetVersionInfo(v, gc, bt, gv string)

SetVersionInfo sets version information from main

func SetupCronTool

func SetupCronTool(agentLoop *agent.AgentLoop, msgBus *bus.MessageBus, workspace string, restrict bool, execTimeout time.Duration, cfg *config.Config) *cron.CronService

SetupCronTool creates and configures the cron service

func ShouldSkipHeartbeatForBootstrap

func ShouldSkipHeartbeatForBootstrap(workspace string) bool

ShouldSkipHeartbeatForBootstrap checks if BOOTSTRAP.md exists

func SkillsHelp

func SkillsHelp()

SkillsHelp prints skills command help

func StatusHelp

func StatusHelp()

StatusHelp prints status command help

func TriggerShutdown

func TriggerShutdown()

TriggerShutdown triggers the global shutdown signal This can be called from: - System tray quit menu - Desktop UI close event - WebSocket close message - Any other component that needs to initiate shutdown

func WaitForShutdownOrSignal

func WaitForShutdownOrSignal()

WaitForShutdownOrSignal waits for either global shutdown signal or OS signal (Ctrl+C) This is the preferred method for waiting for shutdown in long-running commands

func WebSocketHelp

func WebSocketHelp()

WebSocketHelp prints websocket channel help

Types

type CORSConfig

type CORSConfig struct {
	AllowedOrigins    []string `json:"allowed_origins"`
	AllowedMethods    []string `json:"allowed_methods"`
	AllowedHeaders    []string `json:"allowed_headers"`
	AllowCredentials  bool     `json:"allow_credentials"`
	MaxAge            int      `json:"max_age"`
	AllowLocalhost    bool     `json:"allow_localhost"`
	DevelopmentMode   bool     `json:"development_mode"`
	AllowedCDNDomains []string `json:"allowed_cdn_domains"`
	AllowNoOrigin     bool     `json:"allow_no_origin"`
}

CORSConfig represents CORS configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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