cmd

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 13 Imported by: 0

README

HotPlex CLI Commands

This package contains the implementation of the hotplexd command-line interface using the Cobra library. It provides subcommands for managing the daemon, sessions, and configuration.

Commands

  • root.go: Defines the hotplexd root command and global flags.
  • config.go: Implements configuration-related commands, such as config validate.
  • doctor.go: Implements the doctor command for environment and dependency diagnostics.
  • http.go: Provides helper functions for interacting with the main daemon's Admin API.
  • status.go: Implements the status command to show runtime statistics (uptime, memory, active sessions).
  • version.go: Implements the version command to display build information.

Sub-Packages

  • session: Commands specifically for managing active agent sessions (list, kill, logs).

Admin API Utility

The DoAdminAPI function in http.go is a shared utility used by most subcommands to communicate with the hotplexd daemon's administrative endpoint. It handles:

  • Authentication via HOTPLEX_ADMIN_TOKEN.
  • Sending HTTP requests to the daemon.
  • Basic error handling for connection issues.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "v0.0.0-dev"
	Commit    = "unknown"
	BuildTime = "unknown"
)

Version, Commit, BuildTime are set via ldflags

View Source
var RootCmd = &cobra.Command{
	Use:   "hotplexd",
	Short: "HotPlex AI Agent Runtime Daemon",
	Long: `HotPlex is an AI Agent Runtime Engine that provides long-lived sessions
for Claude Code and OpenCode CLI tools.

Supports multiple chat platforms (Slack, Feishu, DingTalk, etc.)
and provides session management, diagnostics, and admin APIs.`,
	Version: Version,
}

RootCmd is the root command for hotplexd CLI.

Functions

func DoAdminAPI

func DoAdminAPI(cmd *cobra.Command, method, path string, body io.Reader, headers ...string) (*http.Response, error)

DoAdminAPI creates an authenticated HTTP request to the admin API. It reads --server-url and --admin-token flags, falling back to HOTPLEX_ADMIN_TOKEN env var. The body parameter supports POST requests; pass nil for GET. headers are optional extra headers (e.g., Content-Type).

func Execute

func Execute()

Execute runs the root command.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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