{"modulePath":"github.com/stainless-api/stainless-api-cli","version":"v0.1.0-alpha.89","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package cmd\n\n## Constants\n\n```go\nconst Version = \"0.1.0-alpha.89\" // x-release-please-version\n\n```\n\n## Variables\n\n```go\nvar (\n\tCommand            *cli.Command\n\tCommandErrorBuffer bytes.Buffer\n)\n```\n\n```go\nvar OutputFormats = []string{\"auto\", \"explore\", \"json\", \"jsonl\", \"pretty\", \"raw\", \"yaml\"}\n```\n\n## Functions\n\n```go\nfunc CheckForUpdate() \u003c-chan string\n```\nCheckForUpdate starts a background check for new versions and returns a channel that will contain an update message if one is available\n\n```go\nfunc ConfigDir() (string, error)\n```\nConfigDir returns the directory where config files are stored\n\n```go\nfunc Rel(basepath, targpath string) string\n```\nRel 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 \"./\"\n\n```go\nfunc ShowJSON(res gjson.Result, opts ShowJSONOpts) error\n```\nShowJSON displays a single JSON result to the user.\n\n```go\nfunc ShowJSONIterator[T any](iter jsonview.Iterator[T], itemsToDisplay int64, opts ShowJSONOpts) error\n```\nShowJSONIterator displays an iterator of values to the user. Use itemsToDisplay = -1 for no limit.\n\n```go\nfunc ValidateBaseURL(value, source string) error\n```\nValidateBaseURL checks that a base URL is correctly prefixed with a protocol scheme and produces a better error message than the person would see otherwise if it doesn't.\n\n## Types\n\n```go\ntype AuthConfig struct {\n\tAccessToken  string `json:\"access_token\"`\n\tRefreshToken string `json:\"refresh_token,omitempty\"`\n\tTokenType    string `json:\"token_type\"`\n\n\tConfigPath string `json:\"-\"`\n}\n```\nAuthConfig stores the OAuth credentials\n\n```go\nfunc NewAuthConfig() (*AuthConfig, error)\n```\nNewAuthConfig creates a new AuthConfig with ConfigPath populated. Use this when creating a new config that you plan to save. For loading existing configs, use \u0026AuthConfig{} and call Find() or Load().\n\n```go\nfunc (config *AuthConfig) Exists() bool\n```\nExists checks if the auth config file exists\n\n```go\nfunc (config *AuthConfig) Find() (bool, error)\n```\nFind 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.\n\n```go\nfunc (config *AuthConfig) Load(configPath string) error\n```\nLoad 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.\n\n```go\nfunc (config *AuthConfig) Remove() error\n```\nRemove removes the auth config file\n\n```go\nfunc (config *AuthConfig) Save() error\n```\nSave saves the auth config to disk\n\n```go\ntype BodyContentType int\n```\n\n```go\nconst (\n\tEmptyBody BodyContentType = iota\n\tMultipartFormEncoded\n\tApplicationJSON\n\tApplicationOctetStream\n)\n```\n\n```go\ntype FileEmbedStyle int\n```\n\n```go\nconst (\n\t// EmbedText reads referenced files fully into memory and substitutes the file's contents back into the\n\t// value as a string. Binary files are base64-encoded. Used for JSON request bodies and for headers and\n\t// query parameters, where the file contents need to be serialized inline.\n\tEmbedText FileEmbedStyle = iota\n\n\t// EmbedIOReader replaces file references with an io.Reader that streams the file's contents. Used for\n\t// `multipart/form-data` and `application/octet-stream` request bodies, where files are uploaded as binary\n\t// parts rather than embedded into a text value.\n\tEmbedIOReader\n)\n```\n\n```go\ntype FilePathValue string\n```\nFilePathValue is a string wrapper that marks a value as a file path whose contents should be read and embedded in the request. Unlike a regular string, embedFilesValue always treats a FilePathValue as a file path without needing the \"@\" prefix.\n\n```go\ntype GenerateSpecParams struct {\n\tProject string `json:\"project\"`\n\tSource  struct {\n\t\tType            string `json:\"type\"`\n\t\tOpenAPISpec     string `json:\"openapi_spec\"`\n\t\tStainlessConfig string `json:\"stainless_config\"`\n\t} `json:\"source\"`\n}\n```\n\n```go\ntype GitHubRelease struct {\n\tTagName string `json:\"tag_name\"`\n}\n```\n\n```go\ntype ShowJSONOpts struct {\n\tExplicitFormat bool      // true if the user explicitly passed --format\n\tFormat         string    // output format (auto, explore, json, jsonl, pretty, raw, yaml)\n\tRawOutput      bool      // like jq -r: print strings without JSON quotes\n\tStderr         io.Writer // stderr for warnings; injectable for testing; defaults to os.Stderr\n\tStdout         *os.File  // stdout (or pager); injectable for testing; defaults to os.Stdout\n\tTitle          string    // display title\n\tTransform      string    // GJSON path to extract before displaying\n}\n```\nShowJSONOpts configures how JSON output is displayed.\n\n```go\ntype TargetInfo struct {\n\tDisplayName     string\n\tName            stainless.Target\n\tDefaultSelected bool\n}\n```\nTargetInfo represents a target with its display name and default selection\n\n","path":"github.com/stainless-api/stainless-api-cli/pkg/cmd","name":"cmd","synopsis":"","isRedistributable":true}
