Documentation
¶
Index ¶
- Variables
- func Execute()
- func FormatBool(b bool) string
- func FormatDuration(secs int) string
- func FormatPrivate(b bool) string
- func FormatTime(t time.Time) string
- func FormatTimePtr(t *time.Time) string
- func KV(label string, value string)
- func KVf(label string, format string, args ...any)
- func ParseArgs(args []string, trailingArgsCount int) (workspace, repoSlug string, trailing []string, err error)
- func PrintJSON(data any)
- func PrintOrJSON(cmd *cobra.Command, data any, formatter func())
- func PrintPaginationFooter(size, page, pageLen int, hasNext bool)
- func Truncate(s string, maxLen int) string
- type Table
Constants ¶
This section is empty.
Variables ¶
var RootCmd = &cobra.Command{ Use: "bbkt", Version: version.Version, Short: "A unified CLI and MCP server for Bitbucket Cloud", Long: `bbkt is a complete command-line interface and Model Context Protocol server for Bitbucket Cloud. It allows you to manage workspaces, repositories, pull requests, pipelines, and more directly from your terminal, or expose these capabilities to your AI agents via the MCP protocol. Try running 'bbkt auth' to get started!`, PersistentPreRun: func(cmd *cobra.Command, args []string) { if profile, _ := cmd.Flags().GetString("profile"); profile != "" { os.Setenv("BBKT_PROFILE", profile) } }, }
RootCmd represents the base command when called without any subcommands
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func FormatBool ¶ added in v0.1.3
FormatBool returns a readable yes/no.
func FormatDuration ¶ added in v0.1.3
FormatDuration formats seconds into a human-readable duration.
func FormatPrivate ¶ added in v0.1.3
FormatPrivate returns "private" or "public".
func FormatTime ¶ added in v0.1.3
FormatTime formats a time.Time as a short human-readable string.
func FormatTimePtr ¶ added in v0.1.3
FormatTimePtr handles nil time pointers.
func ParseArgs ¶
func ParseArgs(args []string, trailingArgsCount int) (workspace, repoSlug string, trailing []string, err error)
ParseArgs resolves workspace and repoSlug from the command line arguments, and returns any remaining trailing arguments. It expects either: - exact trailingArgsCount arguments (infers workspace and repoSlug from git) - trailingArgsCount + 2 arguments (explicit workspace and repoSlug provided first)
func PrintJSON ¶
func PrintJSON(data any)
PrintJSON formats any Go struct as pretty JSON and prints to stdout.
func PrintOrJSON ¶ added in v0.1.3
PrintOrJSON prints formatted output or JSON depending on the --json flag. The formatter func should print the human-readable output.
func PrintPaginationFooter ¶ added in v0.1.3
PrintPaginationFooter prints a summary line showing current page info.
Types ¶
type Table ¶ added in v0.1.3
type Table struct {
// contains filtered or unexported fields
}
Table is a simple tabwriter-based table printer.
func NewTable ¶ added in v0.1.3
func NewTable() *Table
NewTable creates a new table with tabwriter defaults.
func (*Table) Flush ¶ added in v0.1.3
func (t *Table) Flush()
Flush flushes the underlying tabwriter.