config

package
v3.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package config contains the configuration for the bk CLI

Configuration can come from files or environment variables. File based configuration works similar to unix config file hierarchy where there is a "user" config file found under $HOME, and also a local config in the current repository root (referred to as "local" config)

Index

Constants

View Source
const (
	DefaultGraphQLEndpoint = "https://graphql.buildkite.com/v1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config contains the configuration for the currently selected organization to operate on with the CLI application

func New

func New(fs afero.Fs, repo *git.Repository) *Config

func (*Config) APIToken

func (conf *Config) APIToken() string

APIToken gets the API token configured for the currently selected organization

func (*Config) ConfiguredOrganizations

func (conf *Config) ConfiguredOrganizations() []string

func (*Config) GetGraphQLEndpoint added in v3.4.0

func (conf *Config) GetGraphQLEndpoint() string

func (*Config) GetTokenForOrg added in v3.10.0

func (conf *Config) GetTokenForOrg(org string) string

GetTokenForOrg gets the API token for a specific organization from the user configuration

func (*Config) HasConfiguredOrganization

func (conf *Config) HasConfiguredOrganization(slug string) bool

func (*Config) NoInput added in v3.22.0

func (conf *Config) NoInput() bool

NoInput returns whether interactive input is disabled. Precedence: env > user (not stored in local config)

func (*Config) OrganizationSlug

func (conf *Config) OrganizationSlug() string

OrganizationSlug gets the slug for the currently selected organization. This can be configured locally or per user. This will search for configuration in that order.

func (*Config) OutputFormat added in v3.22.0

func (conf *Config) OutputFormat() string

OutputFormat returns the configured output format (json, yaml, text). Precedence: env > local > user > default (json)

func (*Config) Pager added in v3.22.0

func (conf *Config) Pager() string

Pager returns the configured pager command. Precedence: PAGER env > user config > default (less -R)

func (*Config) PagerDisabled added in v3.17.0

func (conf *Config) PagerDisabled() bool

func (*Config) PreferredPipelines

func (conf *Config) PreferredPipelines() []pipeline.Pipeline

PreferredPipelines will retrieve the list of pipelines from local configuration

func (*Config) Quiet added in v3.22.0

func (conf *Config) Quiet() bool

Quiet returns whether quiet mode is enabled. Precedence: env > local > user

func (*Config) RESTAPIEndpoint added in v3.4.0

func (conf *Config) RESTAPIEndpoint() string

func (*Config) SelectOrganization

func (conf *Config) SelectOrganization(org string, inGitRepo bool) error

SelectOrganization sets the selected organization in the configuration file

func (*Config) SetNoInput added in v3.22.0

func (conf *Config) SetNoInput(v bool) error

SetNoInput sets whether interactive input is disabled (user config only)

func (*Config) SetNoPager added in v3.22.0

func (conf *Config) SetNoPager(v bool, saveLocal bool) error

func (*Config) SetOutputFormat added in v3.22.0

func (conf *Config) SetOutputFormat(v string, saveLocal bool) error

func (*Config) SetPager added in v3.22.0

func (conf *Config) SetPager(v string) error

SetPager sets the pager command (user config only)

func (*Config) SetPreferredPipelines

func (conf *Config) SetPreferredPipelines(pipelines []pipeline.Pipeline, inGitRepo bool) error

SetPreferredPipelines will write the provided list of pipelines to local configuration

func (*Config) SetQuiet added in v3.22.0

func (conf *Config) SetQuiet(v bool, saveLocal bool) error

func (*Config) SetTokenForOrg

func (conf *Config) SetTokenForOrg(org, token string) error

SetTokenForOrg sets the token for the given org in the user configuration file. Tokens are not stored in the local configuration file to reduce the likelihood of tokens being committed to VCS

Jump to

Keyboard shortcuts

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