cmd

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = ""
	Date    = ""
)

Build info set at build time via ldflags.

Functions

func DataWriteCommandsList added in v0.9.0

func DataWriteCommandsList() []string

DataWriteCommandsList returns a sorted list of data write commands.

func Execute

func Execute() int

Execute runs the CLI and returns an exit code.

func ExemptCommandsList added in v0.9.0

func ExemptCommandsList() []string

ExemptCommandsList returns a sorted list of exempt commands.

func VersionString

func VersionString() string

VersionString returns a human-readable version string.

Types

type AccountsAliasCmd added in v0.9.0

type AccountsAliasCmd struct {
	Set   AccountsAliasSetCmd   `cmd:"" help:"Create or update an account alias"`
	List  AccountsAliasListCmd  `cmd:"" help:"List account aliases"`
	Unset AccountsAliasUnsetCmd `cmd:"" help:"Remove an account alias"`
}

AccountsAliasCmd is the parent command for alias subcommands.

type AccountsAliasListCmd added in v0.9.0

type AccountsAliasListCmd struct{}

AccountsAliasListCmd lists all account aliases.

func (*AccountsAliasListCmd) Run added in v0.9.0

Run executes the accounts alias list command.

type AccountsAliasSetCmd added in v0.9.0

type AccountsAliasSetCmd struct {
	Alias     string `arg:"" help:"Alias name (e.g., 'work', 'personal')"`
	AccountID string `arg:"" help:"Account ID to map the alias to"`
}

AccountsAliasSetCmd creates or updates an account alias.

func (*AccountsAliasSetCmd) Run added in v0.9.0

func (c *AccountsAliasSetCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the accounts alias set command.

type AccountsAliasUnsetCmd added in v0.9.0

type AccountsAliasUnsetCmd struct {
	Alias string `arg:"" help:"Alias name to remove"`
}

AccountsAliasUnsetCmd removes an account alias.

func (*AccountsAliasUnsetCmd) Run added in v0.9.0

func (c *AccountsAliasUnsetCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the accounts alias unset command.

type AccountsCmd

type AccountsCmd struct {
	List  AccountsListCmd  `cmd:"" help:"List connected messaging accounts"`
	Alias AccountsAliasCmd `cmd:"" help:"Manage account aliases"`
}

AccountsCmd is the parent command for account subcommands.

type AccountsListCmd

type AccountsListCmd struct {
	Fields      []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

AccountsListCmd lists all connected accounts.

func (*AccountsListCmd) Run

func (c *AccountsListCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the accounts list command.

type AccountsListResponse

type AccountsListResponse struct {
	Accounts []beeperapi.Account `json:"accounts"`
}

AccountsListResponse is the JSON output structure.

type AssetsCmd added in v0.4.0

type AssetsCmd struct {
	Download     AssetsDownloadCmd     `cmd:"" help:"Download an asset by mxc:// URL"`
	Serve        AssetsServeCmd        `cmd:"" help:"Stream an asset by URL (raw bytes)"`
	Upload       AssetsUploadCmd       `cmd:"" help:"Upload an asset and return upload ID"`
	UploadBase64 AssetsUploadBase64Cmd `cmd:"" name:"upload-base64" help:"Upload base64 data and return upload ID"`
}

AssetsCmd is the parent command for asset subcommands.

type AssetsDownloadCmd added in v0.4.0

type AssetsDownloadCmd struct {
	URL  string `arg:"" name:"url" help:"Matrix content URL (mxc:// or localmxc://)"`
	Dest string `help:"Destination file or directory (optional)" name:"dest"`
}

AssetsDownloadCmd downloads an asset from a Matrix URL.

func (*AssetsDownloadCmd) Run added in v0.4.0

func (c *AssetsDownloadCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the assets download command.

type AssetsServeCmd added in v0.12.0

type AssetsServeCmd struct {
	URL    string `arg:"" name:"url" help:"Asset URL to stream (mxc://, localmxc://, or file://)"`
	Dest   string `help:"Destination file path (writes raw bytes to file)" name:"dest"`
	Stdout bool   `help:"Force writing raw bytes to stdout (even on a terminal)" name:"stdout"`
}

AssetsServeCmd streams an asset by URL.

func (*AssetsServeCmd) Run added in v0.12.0

func (c *AssetsServeCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the assets serve command.

type AssetsUploadBase64Cmd added in v0.10.0

type AssetsUploadBase64Cmd struct {
	Content     string `arg:"" optional:"" help:"Base64-encoded content"`
	ContentFile string `help:"Read base64 content from file ('-' for stdin)" name:"content-file"`
	Stdin       bool   `help:"Read base64 content from stdin" name:"stdin"`
	FileName    string `help:"Filename to send in metadata (optional)" name:"file-name"`
	MimeType    string `help:"MIME type override (optional)" name:"mime-type"`
}

AssetsUploadBase64Cmd uploads base64 content.

func (*AssetsUploadBase64Cmd) Run added in v0.10.0

func (c *AssetsUploadBase64Cmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the assets upload-base64 command.

type AssetsUploadCmd added in v0.10.0

type AssetsUploadCmd struct {
	FilePath string `arg:"" name:"file" help:"File path to upload"`
	FileName string `help:"Filename to send in metadata (optional)" name:"file-name"`
	MimeType string `help:"MIME type override (optional)" name:"mime-type"`
}

AssetsUploadCmd uploads a local file.

func (*AssetsUploadCmd) Run added in v0.10.0

func (c *AssetsUploadCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the assets upload command.

type AuthClearCmd

type AuthClearCmd struct{}

AuthClearCmd removes the stored token.

func (*AuthClearCmd) Run

func (c *AuthClearCmd) Run(ctx context.Context) error

Run executes the auth clear command.

type AuthCmd

type AuthCmd struct {
	Set    AuthSetCmd    `cmd:"" help:"Store API token"`
	Status AuthStatusCmd `cmd:"" help:"Show authentication status"`
	Clear  AuthClearCmd  `cmd:"" help:"Remove stored token"`
}

AuthCmd is the parent command for auth subcommands.

type AuthSetCmd

type AuthSetCmd struct {
	Token   string `arg:"" help:"API token to store (avoid shell history; prefer --stdin)"`
	Stdin   bool   `help:"Read token from stdin (recommended to avoid shell history)"`
	FromEnv string `help:"Read token from an environment variable (e.g. BEEPER_TOKEN)" name:"from-env" placeholder:"VAR"`
}

AuthSetCmd stores an API token.

func (*AuthSetCmd) Run

func (c *AuthSetCmd) Run(ctx context.Context) error

Run executes the auth set command.

type AuthStatusCmd

type AuthStatusCmd struct {
	Check  bool     `help:"Validate token by making API call" short:"c"`
	Fields []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

AuthStatusCmd shows authentication status.

func (*AuthStatusCmd) Run

func (c *AuthStatusCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the auth status command.

type CLI

type CLI struct {
	RootFlags

	Auth         AuthCmd         `cmd:"" help:"Manage authentication"`
	Connect      ConnectCmd      `cmd:"" help:"Discover Connect server metadata"`
	Events       EventsCmd       `cmd:"" help:"Manage websocket live events (experimental)"`
	Accounts     AccountsCmd     `cmd:"" help:"Manage messaging accounts"`
	Contacts     ContactsCmd     `cmd:"" help:"Manage contacts"`
	Assets       AssetsCmd       `cmd:"" help:"Manage assets"`
	Chats        ChatsCmd        `cmd:"" help:"Manage chats"`
	Messages     MessagesCmd     `cmd:"" help:"Manage messages"`
	Reminders    RemindersCmd    `cmd:"" help:"Manage chat reminders"`
	Search       SearchCmd       `cmd:"" help:"Global search across chats and messages"`
	Status       StatusCmd       `cmd:"" help:"Show chat and unread summary"`
	Unread       UnreadCmd       `cmd:"" help:"List unread chats"`
	Focus        FocusCmd        `cmd:"" help:"Focus Beeper Desktop app"`
	Doctor       DoctorCmd       `cmd:"" help:"Diagnose configuration and connectivity"`
	Version      VersionCmd      `cmd:"" help:"Show version information"`
	Describe     DescribeCmd     `cmd:"" help:"Describe command schema for runtime introspection"`
	Capabilities CapabilitiesCmd `cmd:"" help:"Show CLI capabilities for agent discovery"`
	Completion   CompletionCmd   `cmd:"" help:"Generate shell completions"`
}

CLI is the root command structure.

type CapCommands added in v0.9.0

type CapCommands struct {
	Read   []string `json:"read"`
	Write  []string `json:"write"`
	Exempt []string `json:"exempt"`
}

CapCommands categorizes commands by type.

type CapDefaults added in v0.9.0

type CapDefaults struct {
	Timeout int    `json:"timeout"`
	BaseURL string `json:"base_url"`
}

CapDefaults shows default values for key settings.

type CapSafety added in v0.9.0

type CapSafety struct {
	EnableCommandsDesc string `json:"enable_commands_desc"`
	ReadonlyDesc       string `json:"readonly_desc"`
	AgentDesc          string `json:"agent_desc"`
}

CapSafety describes the safety-related flags.

type CapabilitiesCmd added in v0.9.0

type CapabilitiesCmd struct{}

CapabilitiesCmd shows CLI capabilities for agent discovery.

func (*CapabilitiesCmd) Run added in v0.9.0

func (c *CapabilitiesCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the capabilities command.

type CapabilitiesResponse added in v0.9.0

type CapabilitiesResponse struct {
	Version      string            `json:"version"`
	Features     []string          `json:"features"`
	Defaults     CapDefaults       `json:"defaults"`
	OutputModes  []string          `json:"output_modes"`
	Safety       CapSafety         `json:"safety"`
	Commands     CapCommands       `json:"commands"`
	RetryClasses map[string]string `json:"retry_classes"`
	Flags        map[string]string `json:"flags"`
}

CapabilitiesResponse is the JSON output structure.

type ChatsArchiveCmd

type ChatsArchiveCmd struct {
	ChatID    string `arg:"" name:"chatID" help:"Chat ID to archive/unarchive"`
	Unarchive bool   `help:"Unarchive instead of archive" name:"unarchive"`
}

ChatsArchiveCmd archives or unarchives a chat.

func (*ChatsArchiveCmd) Run

func (c *ChatsArchiveCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats archive command.

type ChatsCmd

type ChatsCmd struct {
	List    ChatsListCmd    `cmd:"" help:"List chats"`
	Search  ChatsSearchCmd  `cmd:"" help:"Search chats"`
	Resolve ChatsResolveCmd `cmd:"" help:"Resolve a chat by exact match"`
	Get     ChatsGetCmd     `cmd:"" help:"Get chat details"`
	Create  ChatsCreateCmd  `cmd:"" help:"Create a new chat"`
	Start   ChatsStartCmd   `cmd:"" help:"Resolve/create a direct chat from merged contact data"`
	Archive ChatsArchiveCmd `cmd:"" help:"Archive or unarchive a chat"`
}

ChatsCmd is the parent command for chat subcommands.

type ChatsCreateCmd added in v0.3.0

type ChatsCreateCmd struct {
	AccountID    string   `arg:"" name:"accountID" optional:"" help:"Account ID to create the chat on (uses --account default if omitted)"`
	Participants []string `help:"Participant IDs (repeatable)" name:"participant"`
	Type         string   `help:"Chat type: single|group" enum:"single,group," default:""`
	Title        string   `help:"Title for group chats"`
	Message      string   `help:"Optional first message content"`
}

ChatsCreateCmd creates a new chat.

func (*ChatsCreateCmd) Run added in v0.3.0

func (c *ChatsCreateCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats create command.

type ChatsGetCmd

type ChatsGetCmd struct {
	ChatID              string `arg:"" name:"chatID" help:"Chat ID to retrieve"`
	MaxParticipantCount int    `help:"Maximum participants to return: -1 for all, otherwise 0-500" name:"max-participant-count" default:"-1"`
}

ChatsGetCmd gets a single chat.

func (*ChatsGetCmd) Run

func (c *ChatsGetCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats get command.

type ChatsListCmd

type ChatsListCmd struct {
	AccountIDs  []string `help:"Filter by account IDs" name:"account-ids"`
	Cursor      string   `help:"Pagination cursor"`
	Direction   string   `help:"Pagination direction: before|after" enum:"before,after," default:""`
	All         bool     `help:"Fetch all pages automatically" name:"all"`
	MaxItems    int      `help:"Maximum items to collect with --all (default 500, max 5000)" name:"max-items" default:"0"`
	Fields      []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

ChatsListCmd lists chats.

func (*ChatsListCmd) Run

func (c *ChatsListCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats list command.

type ChatsResolveCmd added in v0.6.0

type ChatsResolveCmd struct {
	Query      string   `arg:"" help:"Exact chat title, display name, or ID"`
	AccountIDs []string `help:"Filter by account IDs" name:"account-ids"`
	Fields     []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

ChatsResolveCmd resolves a chat by exact match.

func (*ChatsResolveCmd) Run added in v0.6.0

func (c *ChatsResolveCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats resolve command.

type ChatsSearchCmd

type ChatsSearchCmd struct {
	Query              string   `arg:"" optional:"" help:"Search query"`
	AccountIDs         []string `help:"Filter by account IDs" name:"account-ids"`
	Inbox              string   `help:"Filter by inbox: primary|low-priority|archive" enum:"primary,low-priority,archive," default:""`
	UnreadOnly         bool     `help:"Only show unread chats" name:"unread-only"`
	IncludeMuted       *bool    `help:"Include muted chats (default true)" name:"include-muted"`
	LastActivityAfter  string   `help:"Only include chats after time (RFC3339 or duration)" name:"last-activity-after"`
	LastActivityBefore string   `help:"Only include chats before time (RFC3339 or duration)" name:"last-activity-before"`
	Type               string   `help:"Filter by type: direct|group|any" enum:"direct,group,any," default:""`
	Scope              string   `help:"Search scope: titles|participants" enum:"titles,participants," default:""`
	Limit              int      `help:"Max results (1-200)" default:"50"`
	Cursor             string   `help:"Pagination cursor"`
	Direction          string   `help:"Pagination direction: before|after" enum:"before,after," default:""`
	All                bool     `help:"Fetch all pages automatically" name:"all"`
	MaxItems           int      `help:"Maximum items to collect with --all (default 500, max 5000)" name:"max-items" default:"0"`
	Fields             []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty        bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

ChatsSearchCmd searches for chats.

func (*ChatsSearchCmd) Run

func (c *ChatsSearchCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats search command.

type ChatsStartCmd added in v0.15.0

type ChatsStartCmd struct {
	AccountID   string `arg:"" name:"accountID" optional:"" help:"Account ID to start the chat on (uses --account default if omitted)"`
	UserID      string `help:"Known user ID candidate" name:"user-id"`
	Email       string `help:"Email candidate" name:"email"`
	PhoneNumber string `help:"Phone number candidate (E.164 preferred)" name:"phone-number"`
	Username    string `help:"Username/handle candidate" name:"username"`
	FullName    string `help:"Display name hint for ranking" name:"full-name"`
	AllowInvite *bool  `help:"Allow invite-based DM creation when required by the platform" name:"allow-invite"`
	Message     string `help:"Optional first message content if required by the platform"`
}

ChatsStartCmd resolves or creates a direct chat from merged contact data.

func (*ChatsStartCmd) Run added in v0.15.0

func (c *ChatsStartCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the chats start command.

type CompletionCmd

type CompletionCmd struct {
	Shell string `arg:"" enum:"bash,zsh,fish" help:"Shell type (bash, zsh, fish)"`
}

CompletionCmd generates shell completions.

func (*CompletionCmd) Run

func (c *CompletionCmd) Run() error

Run executes the completion command.

type ConnectCmd added in v0.15.0

type ConnectCmd struct {
	Info ConnectInfoCmd `cmd:"" help:"Show Connect server metadata and discovered endpoints"`
}

ConnectCmd is the parent command for connect/discovery subcommands.

type ConnectInfoCmd added in v0.15.0

type ConnectInfoCmd struct {
	Fields []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

ConnectInfoCmd retrieves server metadata from GET /v1/info.

func (*ConnectInfoCmd) Run added in v0.15.0

func (c *ConnectInfoCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the connect info command.

type ContactsCmd added in v0.3.0

type ContactsCmd struct {
	List    ContactsListCmd    `cmd:"" help:"List contacts on an account"`
	Search  ContactsSearchCmd  `cmd:"" help:"Search contacts on an account"`
	Resolve ContactsResolveCmd `cmd:"" help:"Resolve a contact by exact match"`
}

ContactsCmd is the parent command for contacts subcommands.

type ContactsListCmd added in v0.15.0

type ContactsListCmd struct {
	AccountID     string   `arg:"" optional:"" name:"accountID" help:"Account ID or alias"`
	AccountIDFlag string   `help:"Account ID to list (uses --account default if omitted)" name:"account-id"`
	Cursor        string   `help:"Pagination cursor"`
	Direction     string   `help:"Pagination direction: before|after" enum:"before,after," default:""`
	All           bool     `help:"Fetch all pages automatically" name:"all"`
	MaxItems      int      `help:"Maximum items to collect with --all (default 500, max 5000)" name:"max-items" default:"0"`
	Fields        []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty   bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

ContactsListCmd lists contacts within an account.

func (*ContactsListCmd) Run added in v0.15.0

func (c *ContactsListCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the contacts list command.

type ContactsResolveCmd added in v0.6.0

type ContactsResolveCmd struct {
	AccountID     string   `arg:"" optional:"" name:"accountID" help:"Account ID or alias"`
	Query         string   `arg:"" optional:"" help:"Exact contact name, username, email, phone, or ID"`
	AccountIDFlag string   `help:"Account ID to search (uses --account default if omitted)" name:"account-id"`
	Fields        []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

ContactsResolveCmd resolves a contact by exact match.

func (*ContactsResolveCmd) Run added in v0.6.0

func (c *ContactsResolveCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the contacts resolve command.

type ContactsSearchCmd added in v0.3.0

type ContactsSearchCmd struct {
	AccountID     string   `arg:"" optional:"" name:"accountID" help:"Account ID or alias"`
	Query         string   `arg:"" optional:"" help:"Search query"`
	AccountIDFlag string   `help:"Account ID to search (uses --account default if omitted)" name:"account-id"`
	Fields        []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty   bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

ContactsSearchCmd searches contacts within an account.

func (*ContactsSearchCmd) Run added in v0.3.0

func (c *ContactsSearchCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the contacts search command.

type DescribeCmd added in v0.17.0

type DescribeCmd struct {
	CommandPath []string `arg:"" optional:"" name:"command" help:"Command path to describe (example: messages send)"`
}

DescribeCmd describes command schema for runtime introspection.

func (*DescribeCmd) Run added in v0.17.0

func (c *DescribeCmd) Run(ctx context.Context) error

Run executes the describe command.

type DescribeFlag added in v0.17.0

type DescribeFlag struct {
	Name      string   `json:"name"`
	Long      string   `json:"long"`
	Short     string   `json:"short,omitempty"`
	Help      string   `json:"help,omitempty"`
	Required  bool     `json:"required"`
	Default   string   `json:"default,omitempty"`
	Enum      []string `json:"enum,omitempty"`
	Envs      []string `json:"env,omitempty"`
	Type      string   `json:"type,omitempty"`
	Inherited bool     `json:"inherited,omitempty"`
}

type DescribePositional added in v0.17.0

type DescribePositional struct {
	Name     string   `json:"name"`
	Help     string   `json:"help,omitempty"`
	Required bool     `json:"required"`
	Default  string   `json:"default,omitempty"`
	Enum     []string `json:"enum,omitempty"`
	Type     string   `json:"type,omitempty"`
}

type DescribeResponse added in v0.17.0

type DescribeResponse struct {
	Command     string               `json:"command"`
	Path        []string             `json:"path,omitempty"`
	Kind        string               `json:"kind"`
	Help        string               `json:"help,omitempty"`
	Detail      string               `json:"detail,omitempty"`
	Aliases     []string             `json:"aliases,omitempty"`
	Positionals []DescribePositional `json:"positionals,omitempty"`
	Flags       []DescribeFlag       `json:"flags,omitempty"`
	Subcommands []DescribeSubcommand `json:"subcommands,omitempty"`
	Safety      *DescribeSafety      `json:"safety,omitempty"`
}

type DescribeSafety added in v0.17.0

type DescribeSafety struct {
	ReadonlyBlocked bool   `json:"readonly_blocked"`
	ReadonlyExempt  bool   `json:"readonly_exempt"`
	RetryClass      string `json:"retry_class,omitempty"`
}

type DescribeSubcommand added in v0.17.0

type DescribeSubcommand struct {
	Name    string   `json:"name"`
	Help    string   `json:"help,omitempty"`
	Aliases []string `json:"aliases,omitempty"`
}

type DoctorCmd

type DoctorCmd struct {
	Fields []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

DoctorCmd validates configuration and connectivity.

func (*DoctorCmd) Run

func (c *DoctorCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the doctor command.

type DoctorResult

type DoctorResult struct {
	ConfigPath           string   `json:"config_path"`
	ConfigExists         bool     `json:"config_exists"`
	TokenSource          string   `json:"token_source"`
	HasToken             bool     `json:"has_token"`
	APIReachable         bool     `json:"api_reachable"`
	APIURL               string   `json:"api_url"`
	TokenValid           bool     `json:"token_valid"`
	AccountID            string   `json:"account_id,omitempty"`
	ValidationMethod     string   `json:"validation_method,omitempty"`
	ConnectInfoAvailable bool     `json:"connect_info_available,omitempty"`
	ConnectName          string   `json:"connect_name,omitempty"`
	ConnectVersion       string   `json:"connect_version,omitempty"`
	ConnectRuntime       string   `json:"connect_runtime,omitempty"`
	AllPassed            bool     `json:"all_passed"`
	Errors               []string `json:"errors,omitempty"`
}

DoctorResult holds the results of all checks.

type EventsCmd added in v0.16.0

type EventsCmd struct {
	Tail EventsTailCmd `cmd:"" help:"Follow live websocket events"`
}

EventsCmd is the parent command for websocket event streaming.

type EventsTailCmd added in v0.16.0

type EventsTailCmd struct {
	ChatIDs        []string      `help:"Subscribe to specific chat IDs (repeatable)" name:"chat-id"`
	All            bool          `help:"Subscribe to all chats" name:"all"`
	IncludeControl bool          `help:"Include control messages (ready, subscriptions.updated, error)" name:"include-control"`
	Reconnect      bool          `help:"Reconnect on disconnect/errors" default:"true"`
	ReconnectDelay time.Duration `help:"Delay before reconnect attempts" name:"reconnect-delay" default:"2s"`
	StopAfter      time.Duration `help:"Stop after duration (0=forever)" name:"stop-after" default:"0s"`
}

EventsTailCmd streams live events from GET /v1/ws.

func (*EventsTailCmd) Run added in v0.16.0

func (c *EventsTailCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the events tail command.

type FocusCmd

type FocusCmd struct {
	ChatID              string `help:"Chat ID to focus (optional)" name:"chat-id"`
	MessageID           string `help:"Message ID to jump to (optional)" name:"message-id"`
	DraftText           string `help:"Pre-fill draft text (optional)" name:"draft-text"`
	DraftTextFile       string `help:"Read draft text from file ('-' for stdin)" name:"draft-text-file"`
	DraftAttachmentPath string `help:"Pre-fill draft attachment path (optional)" name:"draft-attachment"`
}

FocusCmd focuses the Beeper Desktop app.

func (*FocusCmd) Run

func (c *FocusCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the focus command.

type MessagesCmd

type MessagesCmd struct {
	List     MessagesListCmd     `cmd:"" help:"List messages in a chat"`
	Search   MessagesSearchCmd   `cmd:"" help:"Search messages"`
	Send     MessagesSendCmd     `cmd:"" help:"Send a text message and/or attachment to a chat"`
	SendFile MessagesSendFileCmd `cmd:"" name:"send-file" help:"Upload a file and send it as an attachment"`
	Edit     MessagesEditCmd     `cmd:"" help:"Edit a previously sent message"`
	React    MessagesReactCmd    `cmd:"" help:"Add a reaction to a message"`
	Unreact  MessagesUnreactCmd  `cmd:"" help:"Remove a reaction from a message"`
	Tail     MessagesTailCmd     `cmd:"" help:"Follow messages in a chat"`
	Wait     MessagesWaitCmd     `cmd:"" help:"Wait for a matching message"`
	Context  MessagesContextCmd  `cmd:"" help:"Fetch context around a message"`
}

MessagesCmd is the parent command for message subcommands.

type MessagesContextCmd added in v0.7.0

type MessagesContextCmd struct {
	ChatID  string `arg:"" name:"chatID" help:"Chat ID to fetch context from"`
	SortKey string `arg:"" name:"sortKey" help:"Sort key of the anchor message"`
	Before  int    `help:"Number of messages before the anchor" default:"10"`
	After   int    `help:"Number of messages after the anchor" default:"0"`
}

MessagesContextCmd fetches messages around a sort key.

func (*MessagesContextCmd) Run added in v0.7.0

func (c *MessagesContextCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages context command.

type MessagesEditCmd added in v0.10.0

type MessagesEditCmd struct {
	ChatID          string `arg:"" optional:"" name:"chatID" help:"Chat ID containing the message"`
	MessageID       string `arg:"" optional:"" name:"messageID" help:"Message ID to edit"`
	Chat            string `help:"Exact chat title/display name or ID (alternative to chatID arg)" name:"chat"`
	Text            string `arg:"" optional:"" help:"Replacement message text"`
	TextFile        string `help:"Read replacement text from file ('-' for stdin)" name:"text-file"`
	Stdin           bool   `help:"Read replacement text from stdin" name:"stdin"`
	AllowToolOutput bool   `help:"Allow sending message text that looks like rr tool output (dangerous; may leak private data)" name:"allow-tool-output"`
}

MessagesEditCmd edits an existing message.

func (*MessagesEditCmd) Run added in v0.10.0

func (c *MessagesEditCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages edit command.

type MessagesListCmd

type MessagesListCmd struct {
	ChatID        string   `arg:"" name:"chatID" help:"Chat ID to list messages from"`
	Cursor        string   `help:"Pagination cursor (use sortKey from previous results)"`
	Direction     string   `help:"Pagination direction: before|after" enum:"before,after," default:"before"`
	All           bool     `help:"Fetch all pages automatically" name:"all"`
	MaxItems      int      `help:"Maximum items to collect with --all (default 500, max 5000)" name:"max-items" default:"0"`
	DownloadMedia bool     `help:"Download attachments for listed messages" name:"download-media"`
	DownloadDir   string   `help:"Directory to save downloaded attachments" name:"download-dir" default:"."`
	Fields        []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty   bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

MessagesListCmd lists messages in a chat.

func (*MessagesListCmd) Run

func (c *MessagesListCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages list command.

type MessagesReactCmd added in v0.15.0

type MessagesReactCmd struct {
	ChatID      string `arg:"" name:"chatID" help:"Chat ID containing the message"`
	MessageID   string `arg:"" name:"messageID" help:"Message ID to react to"`
	ReactionKey string `arg:"" name:"reactionKey" help:"Reaction key (emoji, shortcode, or network-specific key)"`
}

MessagesReactCmd adds a reaction to a message.

func (*MessagesReactCmd) Run added in v0.15.0

func (c *MessagesReactCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages react command.

type MessagesSearchCmd

type MessagesSearchCmd struct {
	Query              string   `arg:"" optional:"" help:"Search query (literal word match)"`
	AccountIDs         []string `help:"Filter by account IDs" name:"account-ids"`
	ChatIDs            []string `help:"Filter by chat IDs" name:"chat-id"`
	ChatType           string   `help:"Filter by chat type: single|group" name:"chat-type" enum:"single,group," default:""`
	Sender             string   `help:"Filter by sender: me|others|<user-id>" name:"sender"`
	MediaTypes         []string `help:"Filter by media types: any|image|video|link|file" name:"media-types"`
	DateAfter          string   `help:"Only include messages after time (RFC3339 or duration)" name:"date-after"`
	DateBefore         string   `help:"Only include messages before time (RFC3339 or duration)" name:"date-before"`
	IncludeMuted       *bool    `help:"Include muted chats (default true)" name:"include-muted"`
	ExcludeLowPriority *bool    `help:"Exclude low priority messages (default true)" name:"exclude-low-priority"`
	Cursor             string   `help:"Pagination cursor"`
	Direction          string   `help:"Pagination direction: before|after" enum:"before,after," default:""`
	Limit              int      `help:"Max results (1-20)" default:"20"`
	Fields             []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	All                bool     `help:"Fetch all pages automatically" name:"all"`
	MaxItems           int      `help:"Maximum items to collect with --all (default 500, max 5000)" name:"max-items" default:"0"`
	FailIfEmpty        bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

MessagesSearchCmd searches for messages.

func (*MessagesSearchCmd) Run

func (c *MessagesSearchCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages search command.

type MessagesSendCmd

type MessagesSendCmd struct {
	ChatID             string `arg:"" optional:"" name:"chatID" help:"Chat ID to send message to"`
	Chat               string `help:"Exact chat title/display name or ID (alternative to chatID arg)" name:"chat"`
	Text               string `arg:"" optional:"" help:"Message text to send"`
	ReplyToMessageID   string `help:"Message ID to reply to" name:"reply-to"`
	TextFile           string `help:"Read message text from file ('-' for stdin)" name:"text-file"`
	Stdin              bool   `help:"Read message text from stdin" name:"stdin"`
	AllowToolOutput    bool   `help:"Allow sending message text that looks like rr tool output (dangerous; may leak private data)" name:"allow-tool-output"`
	AttachmentUploadID string `help:"Upload ID from 'rr assets upload' to send as attachment" name:"attachment-upload-id"`
	AttachmentFileName string `help:"Filename override for attachment metadata" name:"attachment-file-name"`
	AttachmentMimeType string `help:"MIME type override for attachment metadata" name:"attachment-mime-type"`
	AttachmentType     string `help:"Attachment type override: gif|voiceNote|sticker" name:"attachment-type" enum:"gif,voiceNote,sticker," default:""`
	AttachmentDuration string `help:"Attachment duration override in seconds" name:"attachment-duration"`
	AttachmentWidth    string `help:"Attachment width override in pixels (requires --attachment-height)" name:"attachment-width"`
	AttachmentHeight   string `help:"Attachment height override in pixels (requires --attachment-width)" name:"attachment-height"`
}

MessagesSendCmd sends a message to a chat.

func (*MessagesSendCmd) Run

func (c *MessagesSendCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages send command.

type MessagesSendFileCmd added in v0.10.0

type MessagesSendFileCmd struct {
	ChatID             string `arg:"" optional:"" name:"chatID" help:"Chat ID to send message to"`
	Chat               string `help:"Exact chat title/display name or ID (alternative to chatID arg)" name:"chat"`
	FilePath           string `arg:"" optional:"" name:"path" help:"Path to the file to upload and send"`
	Text               string `arg:"" optional:"" help:"Optional message text"`
	ReplyToMessageID   string `help:"Message ID to reply to" name:"reply-to"`
	TextFile           string `help:"Read message text from file ('-' for stdin)" name:"text-file"`
	Stdin              bool   `help:"Read message text from stdin" name:"stdin"`
	AllowToolOutput    bool   `help:"Allow sending message text that looks like rr tool output (dangerous; may leak private data)" name:"allow-tool-output"`
	FileName           string `help:"Filename to send in upload metadata (optional)" name:"file-name"`
	MimeType           string `help:"MIME type override for upload (optional)" name:"mime-type"`
	AttachmentFileName string `help:"Filename override for attachment metadata" name:"attachment-file-name"`
	AttachmentMimeType string `help:"MIME type override for attachment metadata" name:"attachment-mime-type"`
	AttachmentType     string `help:"Attachment type override: gif|voiceNote|sticker" name:"attachment-type" enum:"gif,voiceNote,sticker," default:""`
	AttachmentDuration string `help:"Attachment duration override in seconds" name:"attachment-duration"`
	AttachmentWidth    string `help:"Attachment width override in pixels (requires --attachment-height)" name:"attachment-width"`
	AttachmentHeight   string `help:"Attachment height override in pixels (requires --attachment-width)" name:"attachment-height"`
}

MessagesSendFileCmd uploads a file and sends it as an attachment.

func (*MessagesSendFileCmd) Run added in v0.10.0

func (c *MessagesSendFileCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages send-file command.

type MessagesTailCmd added in v0.5.0

type MessagesTailCmd struct {
	ChatID    string        `arg:"" name:"chatID" help:"Chat ID to follow"`
	Cursor    string        `help:"Start cursor (sortKey)"`
	Contains  string        `help:"Only include messages containing text (case-insensitive)"`
	Sender    string        `help:"Only include messages from sender ID or name"`
	From      string        `help:"Only include messages after time (RFC3339 or duration)" name:"from"`
	To        string        `help:"Only include messages before time (RFC3339 or duration)" name:"to"`
	Interval  time.Duration `help:"Polling interval" default:"2s"`
	StopAfter time.Duration `help:"Stop after duration (0=forever)" name:"stop-after" default:"0s"`
}

MessagesTailCmd follows messages in a chat via polling.

func (*MessagesTailCmd) Run added in v0.5.0

func (c *MessagesTailCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages tail command.

type MessagesUnreactCmd added in v0.15.0

type MessagesUnreactCmd struct {
	ChatID      string `arg:"" name:"chatID" help:"Chat ID containing the message"`
	MessageID   string `arg:"" name:"messageID" help:"Message ID to remove reaction from"`
	ReactionKey string `arg:"" name:"reactionKey" help:"Reaction key to remove"`
}

MessagesUnreactCmd removes a reaction from a message.

func (*MessagesUnreactCmd) Run added in v0.15.0

func (c *MessagesUnreactCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages unreact command.

type MessagesWaitCmd added in v0.6.0

type MessagesWaitCmd struct {
	ChatID      string        `help:"Limit to a chat ID" name:"chat-id"`
	Contains    string        `help:"Only match messages containing text (case-insensitive)"`
	Sender      string        `help:"Only match messages from sender ID or name"`
	Interval    time.Duration `help:"Polling interval" default:"2s"`
	WaitTimeout time.Duration `help:"Stop waiting after duration (0=forever)" name:"wait-timeout" default:"0s"`
}

MessagesWaitCmd waits for a message that matches filters.

func (*MessagesWaitCmd) Run added in v0.6.0

func (c *MessagesWaitCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the messages wait command.

type RemindersClearCmd

type RemindersClearCmd struct {
	ChatID string `arg:"" optional:"" name:"chatID" help:"Chat ID to clear reminder from"`
	Chat   string `help:"Exact chat title/display name or ID (alternative to chatID arg)" name:"chat"`
}

RemindersClearCmd clears a reminder from a chat.

func (*RemindersClearCmd) Run

func (c *RemindersClearCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the reminders clear command.

type RemindersCmd

type RemindersCmd struct {
	Set   RemindersSetCmd   `cmd:"" help:"Set a reminder for a chat"`
	Clear RemindersClearCmd `cmd:"" help:"Clear a reminder from a chat"`
}

RemindersCmd is the parent command for reminder subcommands.

type RemindersSetCmd

type RemindersSetCmd struct {
	ChatID                   string `arg:"" optional:"" name:"chatID" help:"Chat ID to set reminder for"`
	Chat                     string `help:"Exact chat title/display name or ID (alternative to chatID arg)" name:"chat"`
	At                       string `arg:"" optional:"" help:"When to remind (RFC3339 or relative like '1h', '30m', '2h30m')"`
	DismissOnIncomingMessage bool   `help:"Cancel reminder if someone messages" name:"dismiss-on-message"`
}

RemindersSetCmd sets a reminder for a chat.

func (*RemindersSetCmd) Run

func (c *RemindersSetCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the reminders set command.

type RootFlags

type RootFlags struct {
	Color          string           `help:"Color output: auto|always|never" default:"auto" env:"BEEPER_COLOR"`
	JSON           bool             `help:"Output JSON to stdout (best for scripting)" env:"BEEPER_JSON"`
	JSONL          bool             `help:"Output JSON Lines (one JSON object per line)" env:"BEEPER_JSONL"`
	Plain          bool             `help:"Output stable TSV to stdout (no colors)" env:"BEEPER_PLAIN"`
	Verbose        bool             `help:"Enable debug logging" short:"v"`
	NoInput        bool             `help:"Never prompt; fail instead (useful for CI)" env:"BEEPER_NO_INPUT"`
	Force          bool             `help:"Skip confirmations for destructive commands" short:"f"`
	Timeout        int              `help:"Timeout for API calls in seconds (0=none)" default:"30" env:"BEEPER_TIMEOUT"`
	BaseURL        string           `help:"API base URL" default:"http://localhost:23373" env:"BEEPER_URL"`
	Version        kong.VersionFlag `help:"Show version and exit"`
	EnableCommands []string         `help:"Comma-separated allowlist of top-level commands" env:"BEEPER_ENABLE_COMMANDS" sep:","`
	Readonly       bool             `help:"Block data write operations" env:"BEEPER_READONLY"`
	DryRun         bool             `help:"Validate and preview mutating operations without sending API requests" env:"BEEPER_DRY_RUN"`
	Envelope       bool             `help:"Wrap JSON output in {success,data,error,metadata} envelope" env:"BEEPER_ENVELOPE"`
	Agent          bool             `help:"Agent profile: forces JSON, envelope, no-input, readonly" env:"BEEPER_AGENT"`
	RequestID      string           `help:"Optional request ID for envelope metadata (agent tracing)" env:"BEEPER_REQUEST_ID"`
	DedupeWindow   time.Duration    `` /* 151-byte string literal not displayed */
	Account        string           `help:"Default account ID for commands" env:"BEEPER_ACCOUNT"`
}

RootFlags contains global flags available to all commands.

type SearchCmd

type SearchCmd struct {
	Query             string   `arg:"" help:"Search query (literal word match)"`
	MessagesCursor    string   `help:"Cursor for message results pagination" name:"messages-cursor"`
	MessagesDirection string   `help:"Pagination direction for message results: before|after" name:"messages-direction" enum:"before,after," default:""`
	MessagesLimit     int      `help:"Max messages per page when paging (1-20)" name:"messages-limit" default:"0"`
	MessagesAll       bool     `help:"Fetch all message pages automatically" name:"messages-all"`
	MessagesMaxItems  int      `help:"Maximum message items to collect with --messages-all (default 500, max 5000)" name:"messages-max-items" default:"0"`
	FailIfEmpty       bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
	Fields            []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

SearchCmd performs a global search.

func (*SearchCmd) Run

func (c *SearchCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the search command.

type StatusCmd added in v0.6.0

type StatusCmd struct {
	ByAccount bool     `help:"Group unread counts by account" name:"by-account"`
	Fields    []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

StatusCmd summarizes unread counts and chat state.

func (*StatusCmd) Run added in v0.6.0

func (c *StatusCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the status command.

type UnreadCmd added in v0.7.0

type UnreadCmd struct {
	AccountIDs   []string `help:"Filter by account IDs" name:"account-ids"`
	Inbox        string   `help:"Filter by inbox: primary|low-priority|archive" enum:"primary,low-priority,archive," default:""`
	IncludeMuted *bool    `help:"Include muted chats (default true)" name:"include-muted"`
	Limit        int      `help:"Max results (1-200)" default:"200"`
	Cursor       string   `help:"Pagination cursor"`
	Direction    string   `help:"Pagination direction: before|after" enum:"before,after," default:""`
	Fields       []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
	FailIfEmpty  bool     `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}

UnreadCmd lists unread chats across all accounts.

func (*UnreadCmd) Run added in v0.7.0

func (c *UnreadCmd) Run(ctx context.Context, flags *RootFlags) error

Run executes the unread command.

type ValidateTokenResult

type ValidateTokenResult struct {
	Valid                  bool   `json:"valid"`
	Error                  string `json:"error,omitempty"`
	Account                string `json:"account,omitempty"` // First account ID if available
	ValidationMethod       string `json:"validation_method,omitempty"`
	IntrospectionAvailable bool   `json:"introspection_available,omitempty"`
	IntrospectionActive    bool   `json:"introspection_active,omitempty"`
	Subject                string `json:"subject,omitempty"`
	ConnectInfoAvailable   bool   `json:"connect_info_available,omitempty"`
	ConnectName            string `json:"connect_name,omitempty"`
	ConnectVersion         string `json:"connect_version,omitempty"`
	ConnectRuntime         string `json:"connect_runtime,omitempty"`
}

ValidateTokenResult holds the result of token validation.

func ValidateToken

func ValidateToken(ctx context.Context, token, baseURL string, timeoutSec int) ValidateTokenResult

ValidateToken checks if the token is valid by making a read-only API call. Returns account info if successful.

type VersionCmd

type VersionCmd struct {
	Fields []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}

VersionCmd shows version information.

func (*VersionCmd) Run

func (c *VersionCmd) Run(ctx context.Context) error

Run executes the version command.

Jump to

Keyboard shortcuts

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