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
- Variables
- func AgentHelp()
- func AuthHelp()
- func CORSHelp()
- func ChannelHelp()
- func ChannelWebHelp()
- func ClusterHelp()
- func ClusterTokenHelp()
- func CmdAgent()
- func CmdAuth()
- func CmdCORS()
- func CmdChannel()
- func CmdChannelExternal(cfg *config.Config)
- func CmdChannelWeb(cfg *config.Config)
- func CmdChannelWebSocket(cfg *config.Config)
- func CmdCluster()
- func CmdClusterToken()
- func CmdCron()
- func CmdGateway()
- func CmdLog()
- func CmdMCP()
- func CmdMigrate()
- func CmdModel()
- func CmdSecurity()
- func CmdSkills()
- func CmdStatus()
- func CopyDirectory(src, dst string) error
- func CopyEmbeddedToTarget(targetDir string) error
- func CreateAgentLoop(cfg *config.Config) (*agent.AgentLoop, providers.LLMProvider, error)
- func CronHelp()
- func Dispatch()
- func ExternalHelp()
- func FormatBuildInfo() (build string, goVer string)
- func FormatVersion() string
- func GatewayHelp()
- func GetConfigPath() string
- func GetGlobalShutdownChan() chan struct{}
- func GetMCPConfigPath() string
- func GetSecurityConfigPath() string
- func InitLoggerFromConfig(cfg *config.Config, checkArgs []string) int
- func LoadConfig() (*config.Config, error)
- func LogGeneralHelp()
- func LogHelp()
- func LogLLMHelp()
- func MCPHelp()
- func MigrateHelp()
- func ModelHelp()
- func PrintAgentStartupInfo(agentLoop *agent.AgentLoop)
- func PrintHelp()
- func PrintVersion()
- func RunInteractiveMode(agentLoop *agent.AgentLoop, sessionKey string) error
- func RunSimpleInteractiveMode(agentLoop *agent.AgentLoop, sessionKey string) error
- func SecurityConfigHelp()
- func SecurityHelp()
- func SecurityRulesHelp()
- func SetEmbeddedFS(embedded, defaultFs, configFs embed.FS)
- func SetVersionInfo(v, gc, bt, gv string)
- func SetupCronTool(agentLoop *agent.AgentLoop, msgBus *bus.MessageBus, workspace string, ...) *cron.CronService
- func ShouldSkipHeartbeatForBootstrap(workspace string) bool
- func SkillsHelp()
- func StatusHelp()
- func TriggerShutdown()
- func WaitForShutdownOrSignal()
- func WebSocketHelp()
- type CORSConfig
Constants ¶
const Logo = "🤖"
Variables ¶
var ( Version = "dev" GitCommit string BuildTime string GoVersion string )
Version information (set by linker)
var ConfigFiles embed.FS
var DefaultFiles embed.FS
var EmbeddedFiles embed.FS
Embedded filesystems (must be set by main)
Functions ¶
func CmdChannelExternal ¶
CmdChannelExternal handles external channel specific commands
func CmdChannelWeb ¶
CmdChannelWeb handles web channel specific commands
func CmdChannelWebSocket ¶
CmdChannelWebSocket handles websocket channel specific commands
func CmdGateway ¶
func CmdGateway()
CmdGateway starts the NemesisBot gateway server This command starts the bot service immediately (traditional behavior)
func CopyDirectory ¶
CopyDirectory copies a directory recursively
func CopyEmbeddedToTarget ¶
CopyEmbeddedToTarget copies embedded files to target directory
func CreateAgentLoop ¶
CreateAgentLoop creates a new agent loop with provider
func FormatBuildInfo ¶
FormatBuildInfo returns build time and go version info
func FormatVersion ¶
func FormatVersion() string
FormatVersion returns the version string with optional git commit
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 ¶
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 PrintAgentStartupInfo ¶
PrintAgentStartupInfo prints agent initialization info
func RunInteractiveMode ¶
RunInteractiveMode runs the CLI interactive mode
func RunSimpleInteractiveMode ¶
RunSimpleInteractiveMode runs a simple CLI interactive mode without readline
func SecurityConfigHelp ¶
func SecurityConfigHelp()
func SecurityRulesHelp ¶
func SecurityRulesHelp()
func SetEmbeddedFS ¶
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 ¶
ShouldSkipHeartbeatForBootstrap checks if BOOTSTRAP.md exists
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
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