commands

package
v0.0.0-...-e6ecba1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 39 Imported by: 0

Documentation

Overview

Package commands implements CLI commands for the Fizzy CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute runs the root command.

func GetRootCmd

func GetRootCmd() *cobra.Command

GetRootCmd returns the root command for testing.

func IsMachineOutput

func IsMachineOutput() bool

IsMachineOutput returns true when output should be treated as machine-consumable. True when any machine format flag is set, --agent is set, or stdout/stdin is not a TTY.

func ResetTestMode

func ResetTestMode()

ResetTestMode resets the test mode configuration.

func SetTestConfig

func SetTestConfig(token, account, apiURL string)

SetTestConfig sets the config for testing.

func SetTestCreds

func SetTestCreds(store *credstore.Store)

SetTestCreds sets the credential store for testing.

func SetTestFormat

func SetTestFormat(format output.Format)

SetTestFormat reconfigures the output writer with the given format. Must be called after SetTestMode.

func SetTestProfiles

func SetTestProfiles(store *profile.Store)

SetTestProfiles sets the profile store for testing.

func SetTestSDK

func SetTestSDK(baseURL string)

SetTestSDK configures the commands package for SDK-based testing. Pass an httptest.Server URL and the SDK will be created pointing at it.

func SetVersion

func SetVersion(v string)

SetVersion sets the CLI version used for `--version` and `version`.

func TestOutput

func TestOutput() string

TestOutput returns the raw output from the last command execution. Useful for verifying non-JSON format output.

Types

type Account

type Account struct {
	ID   string
	Name string
	Slug string
}

Account represents an account from the identity response.

type Attachment

type Attachment struct {
	Index       int    `json:"index"`
	Filename    string `json:"filename"`
	ContentType string `json:"content_type"`
	Filesize    int64  `json:"filesize"`
	Width       int    `json:"width,omitempty"`
	Height      int    `json:"height,omitempty"`
	DownloadURL string `json:"download_url"`
	SGID        string `json:"sgid"`
}

Attachment represents a parsed attachment from description_html

type Board

type Board struct {
	ID   string
	Name string
}

Board represents a board from the boards response.

type Breadcrumb = output.Breadcrumb

Breadcrumb is a type alias for output.Breadcrumb.

type CommandResult

type CommandResult struct {
	Response *output.Response
}

CommandResult holds the result of a command execution for testing.

func SetTestMode

func SetTestMode(mockClient client.API) *CommandResult

SetTestMode configures the commands package for testing. It sets a mock client factory and captures results instead of exiting.

type CommentAttachment

type CommentAttachment struct {
	Attachment
	CommentID string `json:"comment_id"`
}

CommentAttachment extends Attachment with comment context

type SkillLocation

type SkillLocation struct {
	Name string
	Path string
}

SkillLocation represents a predefined skill installation target.

Jump to

Keyboard shortcuts

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