Documentation
¶
Index ¶
- func Execute(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (err error)
- func ExitCode(err error) int
- func VersionString() string
- type CLI
- type CompletionCmd
- type DoctorCmd
- type InspectCmd
- type LoginCmd
- type LogoutCmd
- type MCPCmd
- type PinCmd
- type PinsCmd
- type RootFlags
- type SearchCmd
- type SessionCmd
- type SessionsCmd
- type VersionCmd
- type WatchCmd
- type WhoamiCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute(ctx context.Context, args []string, stdin io.Reader, stdout, stderr io.Writer) (err error)
Execute parses args and dispatches to the selected command.
func VersionString ¶
func VersionString() string
VersionString returns the human-readable version string.
Types ¶
type CLI ¶
type CLI struct {
RootFlags
Version kong.VersionFlag `name:"version" help:"Show version."`
Sessions SessionsCmd `cmd:"" name:"sessions" help:"List sessions."`
Session SessionCmd `cmd:"" name:"session" help:"Show a session by report URL."`
Pin PinCmd `cmd:"" name:"pin" help:"Show a pin by report URL."`
Pins PinsCmd `cmd:"" name:"pins" help:"Fetch pins by report URL."`
Search SearchCmd `cmd:"" name:"search" help:"Search Disbug data."`
Watch WatchCmd `cmd:"" name:"watch" help:"Stream new sessions as events."`
Inspect InspectCmd `cmd:"" name:"inspect" help:"Inspect a downloaded local report JSON file."`
Login LoginCmd `cmd:"" name:"login" help:"Log in to Disbug."`
Logout LogoutCmd `cmd:"" name:"logout" help:"Log out of Disbug."`
Whoami WhoamiCmd `cmd:"" name:"whoami" help:"Show the current user."`
Doctor DoctorCmd `cmd:"" name:"doctor" help:"Check CLI configuration."`
MCP MCPCmd `cmd:"" name:"mcp" help:"Run MCP integration commands."`
Completion CompletionCmd `cmd:"" name:"completion" help:"Generate shell completion scripts."`
VersionCmd VersionCmd `cmd:"" name:"version" help:"Print the disbug version."`
}
CLI is the root Kong command graph.
type CompletionCmd ¶
type CompletionCmd struct {
Shell string `arg:"" enum:"bash,zsh,fish,powershell" help:"Shell to generate completions for."`
}
CompletionCmd prints shell completion scripts.
func (CompletionCmd) Run ¶
func (c CompletionCmd) Run(b bindings) error
Run writes the placeholder shell completion script.
type DoctorCmd ¶
type DoctorCmd struct{}
DoctorCmd checks local CLI configuration and backend compatibility.
type InspectCmd ¶
type InspectCmd struct {
Path string `arg:"" name:"path" help:"Path to a downloaded Disbug local report JSON file."`
Pin int `help:"Inspect one pin by number instead of returning the session summary."`
Fields string `help:"Comma-separated fields for --pin: screenshot,console,network,events,replay,voice_note,video,all."`
CacheDir string `name:"cache-dir" help:"Directory for decoded local artifacts. Defaults to the user cache directory."`
}
InspectCmd reads a downloaded local Disbug report JSON file.
type LoginCmd ¶
type LoginCmd struct {
Name string `help:"Agent name to pre-fill. Defaults to hostname."`
APIURL string `name:"api-url" env:"DISBUG_API_URL" default:"https://disbug.io" help:"Disbug API URL."`
ListenAddr string `name:"listen-addr" help:"Local listener host:port override."`
Manual bool `help:"Print auth URL and paste redirect URL back instead of listening."`
NoBrowser bool `name:"no-browser" help:"Print auth URL instead of opening the browser."`
Force bool `help:"Overwrite an existing token profile."`
Token *string `help:"Set token directly."`
TokenFromStdin bool `name:"token-from-stdin" help:"Read token from the first stdin line."`
TokenFromEnv bool `name:"token-from-env" help:"Read token from DISBUG_LOGIN_TOKEN."`
}
LoginCmd logs in to Disbug and persists a token profile.
type LogoutCmd ¶
type LogoutCmd struct {
LocalOnly bool `name:"local-only" help:"Skip server revoke; just delete local profile."`
}
LogoutCmd logs out by revoking the current token and removing the local profile.
type PinCmd ¶
type PinCmd struct {
Ref string `arg:"" name:"url" help:"Disbug report URL with ?pin=<number>."`
Pin int64 `help:"Pin number when the report URL does not include ?pin=."`
Fields string `help:"Comma-separated fields: screenshot,console,network,events,replay,voice_note,video,all" default:"all"`
}
PinCmd shows a single pin by report URL and pin number.
type PinsCmd ¶
type PinsCmd struct {
Refs []string `arg:"" name:"urls" help:"One or more Disbug report URLs with ?pin=<number>."`
Fields string `help:"Default fields when a URL omits the fields query parameter." default:"all"`
}
PinsCmd fetches multiple pins by report URL and pin number.
type RootFlags ¶
type RootFlags struct {
Pretty bool `help:"Indent JSON output with 2 spaces."`
Profile string `default:"default" env:"DISBUG_PROFILE" help:"Configuration profile to use."`
Verbose bool `short:"v" help:"Enable verbose logging."`
}
RootFlags are global flags accepted by every command.
type SearchCmd ¶
type SearchCmd struct {
Query string `arg:"" name:"query" help:"Search query"`
Scope string `help:"Search scope" enum:"sessions,pins" default:"sessions"`
Limit int `help:"Max results (1-50)" default:"20"`
}
SearchCmd searches sessions or pins.
type SessionCmd ¶
type SessionCmd struct {
Ref string `arg:"" name:"url" help:"Disbug report URL (e.g. https://app.disbug.io/team/projects/1/sessions/2/)"`
}
SessionCmd shows a single session by report URL.
type SessionsCmd ¶
type SessionsCmd struct {
Status string `help:"Filter by status" enum:"open,resolved,dismissed," default:""`
Project string `help:"Filter by project slug"`
Limit int `help:"Max results (1-100)" default:"50"`
Cursor string `help:"Pagination cursor"`
Since string `help:"Only include sessions newer than this duration, e.g. 30s, 15m, or 2h."`
}
SessionsCmd lists sessions.
type WatchCmd ¶
type WatchCmd struct {
CloudOnly bool `name:"cloud-only" help:"Watch cloud sessions only."`
Since string `help:"Backfill sessions newer than this duration before watching, e.g. 30s, 15m, or 2h."`
Status string `help:"Filter by status." enum:"open,resolved,dismissed," default:""`
Project string `help:"Filter by project slug."`
Exec string `help:"Run this shell command once per non-backfill event."`
Format string `help:"Output format." enum:"jsonl,text" default:"jsonl"`
PollInterval string `help:"Polling interval." default:"30s"`
}
WatchCmd streams new Disbug sessions as JSONL events.