cmd

package
v0.1.0-alpha.73 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.1.0-alpha.73" // x-release-please-version

Variables

View Source
var (
	Command *cli.Command
)
View Source
var OutputFormats = []string{"auto", "explore", "json", "jsonl", "pretty", "raw", "yaml"}

Functions

func CheckForUpdate

func CheckForUpdate() <-chan string

CheckForUpdate starts a background check for new versions and returns a channel that will contain an update message if one is available

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the directory where config files are stored

func Rel

func Rel(basepath, targpath string) string

Rel returns a relative path similar to filepath.Rel but with custom behavior: - If target is empty, returns empty string - If relative path doesn't start with "../", it prefixes with "./"

func ShowJSON

func ShowJSON(out *os.File, title string, res gjson.Result, format string, transform string) error

Display JSON to the user in various different formats

func ShowJSONIterator

func ShowJSONIterator[T any](stdout *os.File, title string, iter jsonview.Iterator[T], format string, transform string) error

For an iterator over different value types, display its values to the user in different formats.

Types

type AuthConfig

type AuthConfig struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token,omitempty"`
	TokenType    string `json:"token_type"`

	ConfigPath string `json:"-"`
}

AuthConfig stores the OAuth credentials

func NewAuthConfig

func NewAuthConfig() (*AuthConfig, error)

NewAuthConfig creates a new AuthConfig with ConfigPath populated. Use this when creating a new config that you plan to save. For loading existing configs, use &AuthConfig{} and call Find() or Load().

func (*AuthConfig) Exists

func (config *AuthConfig) Exists() bool

Exists checks if the auth config file exists

func (*AuthConfig) Find

func (config *AuthConfig) Find() (bool, error)

Find searches for and loads the auth config from the standard location. Returns (true, nil) if config file exists and was successfully loaded. Returns (false, nil) if config file doesn't exist or is empty (not an error). Returns (false, error) if config file exists but failed to load due to an error.

func (*AuthConfig) Load

func (config *AuthConfig) Load(configPath string) error

Load loads the auth config from a specific path. Returns nil if the file doesn't exist (not treated as an error). Returns nil if the file exists but is empty (not treated as an error). Returns error only if the file exists but fails to parse or read. Only sets ConfigPath if a valid config with AccessToken is successfully loaded.

func (*AuthConfig) Remove

func (config *AuthConfig) Remove() error

Remove removes the auth config file

func (*AuthConfig) Save

func (config *AuthConfig) Save() error

Save saves the auth config to disk

type BodyContentType

type BodyContentType int
const (
	EmptyBody BodyContentType = iota
	MultipartFormEncoded
	ApplicationJSON
	ApplicationOctetStream
)

type FileEmbedStyle

type FileEmbedStyle int
const (
	EmbedText FileEmbedStyle = iota
	EmbedIOReader
)

type GenerateSpecParams

type GenerateSpecParams struct {
	Project string `json:"project"`
	Source  struct {
		Type            string `json:"type"`
		OpenAPISpec     string `json:"openapi_spec"`
		StainlessConfig string `json:"stainless_config"`
	} `json:"source"`
}

type GitHubRelease

type GitHubRelease struct {
	TagName string `json:"tag_name"`
}

type HasRawJSON

type HasRawJSON interface {
	RawJSON() string
}

type TargetInfo

type TargetInfo struct {
	DisplayName     string
	Name            stainless.Target
	DefaultSelected bool
}

TargetInfo represents a target with its display name and default selection

type WaitMode

type WaitMode int

WaitMode represents the level of waiting for build completion

const (
	WaitNone   WaitMode = iota // Don't wait
	WaitCommit                 // Wait for commit only
	WaitAll                    // Wait for everything including workflows
)

Jump to

Keyboard shortcuts

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