commands

package
v0.0.0-...-555a7fe Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ExitSuccess indicates the operation completed successfully
	ExitSuccess = 0

	// ExitGenericError indicates a generic error occurred
	ExitGenericError = 1

	// ExitAuthError indicates authentication failed (invalid credentials, expired token)
	ExitAuthError = 2

	// ExitNotFound indicates the requested resource was not found
	// (theme, server, content change, etc.)
	ExitNotFound = 3

	// ExitValidationError indicates validation failed
	// (invalid Liquid syntax, bad configuration, missing required fields)
	ExitValidationError = 4

	// ExitNetworkError indicates a network or connection error
	// (cannot reach server, timeout, DNS failure)
	ExitNetworkError = 5

	// ExitConflict indicates a resource conflict
	// (draft already exists, theme name taken, concurrent modification)
	ExitConflict = 6

	// ExitUserCancelled indicates the user cancelled the operation
	// (responded "no" to confirmation prompt, interrupted with Ctrl+C)
	ExitUserCancelled = 7

	// ExitConfigError indicates a configuration error
	// (missing config file, invalid YAML, no server configured)
	ExitConfigError = 8
)

Exit codes for the CLI These provide semantic information about the type of error that occurred, allowing calling scripts and agents to handle different errors appropriately.

View Source
const Version = "0.1.0"

Version is the current version of the CLI

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the root command

Types

type ContentChangeResponse

type ContentChangeResponse struct {
	ContentChangeID string `json:"content_change_id"`
	ThemeName       string `json:"theme_name"`
	Status          string `json:"status"`
}

ContentChangeResponse is the response for content change operations (push, publish)

type ErrorDetail

type ErrorDetail struct {
	Code    string                 `json:"code"`
	Message string                 `json:"message"`
	Details map[string]interface{} `json:"details,omitempty"`
}

ErrorDetail provides structured error information

type ErrorResponse

type ErrorResponse struct {
	Success    bool        `json:"success"`
	Error      ErrorDetail `json:"error"`
	Suggestion string      `json:"suggestion,omitempty"`
}

ErrorResponse is the standard JSON error response format

type PreviewURLResponse

type PreviewURLResponse struct {
	PreviewURL      string `json:"preview_url"`
	ContentChangeID string `json:"content_change_id"`
	ThemeID         string `json:"theme_id,omitempty"`
}

PreviewURLResponse is the response for theme preview command

type ServerStatus

type ServerStatus struct {
	URL           string    `json:"url"`
	Version       string    `json:"version,omitempty"`
	Authenticated bool      `json:"authenticated"`
	LastChecked   time.Time `json:"last_checked,omitempty"`
}

ServerStatus contains status information for a single server

type StatusResponse

type StatusResponse struct {
	Connected     bool                    `json:"connected"`
	Servers       map[string]ServerStatus `json:"servers"`
	DefaultServer string                  `json:"default_server,omitempty"`
	ProjectDir    string                  `json:"project_dir,omitempty"`
}

StatusResponse is the response for status command

type SuccessResponse

type SuccessResponse struct {
	Success bool                   `json:"success"`
	Data    interface{}            `json:"data,omitempty"`
	Message string                 `json:"message,omitempty"`
	Meta    map[string]interface{} `json:"meta,omitempty"`
}

SuccessResponse is the standard JSON success response format

type ThemeInfo

type ThemeInfo struct {
	Name      string    `json:"name"`
	SCID      string    `json:"sc_id"`
	SFID      string    `json:"sfid,omitempty"`
	CreatedAt time.Time `json:"created_at,omitempty"`
	UpdatedAt time.Time `json:"updated_at,omitempty"`
}

ThemeInfo contains information about a single theme

type ThemeListResponse

type ThemeListResponse struct {
	Themes []ThemeInfo `json:"themes"`
	Total  int         `json:"total"`
}

ThemeListResponse is the response for theme list command

type ThemePublishResponse

type ThemePublishResponse struct {
	ThemeName       string `json:"theme_name"`
	ContentChangeID string `json:"content_change_id"`
	Status          string `json:"status"`
}

ThemePublishResponse is the response for theme publish command

type ThemePullResponse

type ThemePullResponse struct {
	ThemeName  string `json:"theme_name"`
	ThemeID    string `json:"theme_id"`
	FilesCount int    `json:"files_count"`
}

ThemePullResponse is the response for theme pull command

Jump to

Keyboard shortcuts

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