Documentation
¶
Index ¶
- Variables
- func DataWriteCommandsList() []string
- func Execute() int
- func ExemptCommandsList() []string
- func VersionString() string
- type AccountsAliasCmd
- type AccountsAliasListCmd
- type AccountsAliasSetCmd
- type AccountsAliasUnsetCmd
- type AccountsCmd
- type AccountsListCmd
- type AccountsListResponse
- type AssetsCmd
- type AssetsDownloadCmd
- type AuthClearCmd
- type AuthCmd
- type AuthSetCmd
- type AuthStatusCmd
- type CLI
- type CapCommands
- type CapDefaults
- type CapSafety
- type CapabilitiesCmd
- type CapabilitiesResponse
- type ChatsArchiveCmd
- type ChatsCmd
- type ChatsCreateCmd
- type ChatsGetCmd
- type ChatsListCmd
- type ChatsResolveCmd
- type ChatsSearchCmd
- type CompletionCmd
- type ContactsCmd
- type ContactsResolveCmd
- type ContactsSearchCmd
- type DoctorCmd
- type DoctorResult
- type FocusCmd
- type MessagesCmd
- type MessagesContextCmd
- type MessagesListCmd
- type MessagesSearchCmd
- type MessagesSendCmd
- type MessagesTailCmd
- type MessagesWaitCmd
- type RemindersClearCmd
- type RemindersCmd
- type RemindersSetCmd
- type RootFlags
- type SearchCmd
- type StatusCmd
- type UnreadCmd
- type ValidateTokenResult
- type VersionCmd
Constants ¶
This section is empty.
Variables ¶
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 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.
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.
type AccountsAliasUnsetCmd ¶ added in v0.9.0
type AccountsAliasUnsetCmd struct {
Alias string `arg:"" help:"Alias name to remove"`
}
AccountsAliasUnsetCmd removes an account alias.
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.
type AccountsListResponse ¶
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"`
}
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.
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"`
}
AuthSetCmd stores an API token.
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.
type CLI ¶
type CLI struct {
RootFlags
Auth AuthCmd `cmd:"" help:"Manage authentication"`
Accounts AccountsCmd `cmd:"" help:"Manage messaging accounts"`
Contacts ContactsCmd `cmd:"" help:"Search contacts"`
Assets AssetsCmd `cmd:"" help:"Download 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"`
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
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.
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"`
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.
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"`
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.
type ChatsGetCmd ¶
type ChatsGetCmd struct {
ChatID string `arg:"" name:"chatID" help:"Chat ID to retrieve"`
}
ChatsGetCmd gets a single chat.
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:""`
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.
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.
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:""`
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.
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 ContactsCmd ¶ added in v0.3.0
type ContactsCmd struct {
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 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.
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.
type DoctorCmd ¶
type DoctorCmd struct {
Fields []string `help:"Comma-separated list of fields for --plain output" name:"fields" sep:","`
}
DoctorCmd validates configuration and connectivity.
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"`
AllPassed bool `json:"all_passed"`
Errors []string `json:"errors,omitempty"`
}
DoctorResult holds the results of all checks.
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.
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 message to a chat"`
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.
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"`
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.
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:","`
FailIfEmpty bool `help:"Exit with code 1 if no results" name:"fail-if-empty"`
}
MessagesSearchCmd searches for messages.
type MessagesSendCmd ¶
type MessagesSendCmd struct {
ChatID string `arg:"" name:"chatID" help:"Chat ID to send message to"`
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"`
}
MessagesSendCmd sends a message to a chat.
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.
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.
type RemindersClearCmd ¶
type RemindersClearCmd struct {
ChatID string `arg:"" name:"chatID" help:"Chat ID to clear reminder from"`
}
RemindersClearCmd clears a reminder from a chat.
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:"" name:"chatID" help:"Chat ID to set reminder for"`
At string `arg:"" 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.
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"`
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"`
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"`
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"`
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.
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.
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.
type ValidateTokenResult ¶
type ValidateTokenResult struct {
Valid bool `json:"valid"`
Error string `json:"error,omitempty"`
Account string `json:"account,omitempty"` // First account ID if available
}
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.