cmd

package
v1.108.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 75 Imported by: 0

Documentation

Index

Constants

View Source
const NotSet = "[NOT SET]"
View Source
const UserWithNoOrganizationMsg = "you are not part of any organization, please run \"chainloop organization create --name ORG_NAME\" to create one"

Variables

View Source
var (
	Version = devVersion
	Edition = ossEdition
)
View Source
var (
	ActionOpts *action.ActionsOpts
)
View Source
var ErrAttestationAlreadyExist = errors.New("attestation already initialized, to override it use the --replace flag`")
View Source
var ErrAttestationNotInitialized = errors.New("attestation not yet initialized, execute the init command first")
View Source
var ErrAttestationTokenRequired = errors.New("chainloop Token required, please provide it via --token flag or CHAINLOOP_TOKEN environment variable")
View Source
var ErrKeylessNotSupported = errors.New("keyless signing not supported, please provide a private key reference with --key instead")
View Source
var (
	GracefulExit bool
)

Functions

func CalculateEnvVarName added in v1.45.4

func CalculateEnvVarName(key string) string

this could have been done using automatic + prefix but we want to have control and know the values

viper.AutomaticEnv()
viper.SetEnvPrefix(envPrefix)
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_", ".", "_"))

func Execute added in v0.144.0

func Execute(rootCmd *cobra.Command) error

func InitHookLogger added in v1.108.0

func InitHookLogger() func()

InitHookLogger reconfigures the root logger for git/agent hook commands: colorless output, all levels written to the trace state's log.txt, and Warn+ (or Debug, with --debug) written to stderr. Colorless matters because the hook's output is interleaved with git's during a commit or push, and main reads the same logger for its final error line.

If trace state cannot be located or the file cannot be opened, the logger falls back to colorless stderr-only output so the rest of the hook still runs with consistent formatting. Returns a cleanup function that closes the log file — callers should defer it at the top of a hook's RunE.

func LogColorDisabled added in v1.101.0

func LogColorDisabled() bool

LogColorDisabled reports whether colorized log output should be disabled. It follows the same approach as the supports-color/chalk family: honor the NO_COLOR / FORCE_COLOR conventions, then enable color on an interactive terminal or in a CI system known to render ANSI escape codes.

func Logger added in v1.108.0

func Logger() zerolog.Logger

Logger returns the root logger. Hook commands swap it in place (see InitHookLogger), and main reads it for its final error line so that line shares the hook's colorless formatting during a git commit or push.

func NewGateError added in v1.64.0

func NewGateError(policyName string) error

func NewRootCmd

func NewRootCmd(l zerolog.Logger) *cobra.Command

func NewVersionCmd

func NewVersionCmd() *cobra.Command

func ParseAndValidateOpts added in v1.76.0

func ParseAndValidateOpts(opts []string, schema *action.JSONSchema) (map[string]any, error)

func ParseKeyValOpts added in v1.76.0

func ParseKeyValOpts(opts []string, propertiesMap sdk.SchemaPropertiesMap) (map[string]any, error)

ParseKeyValOpts performs two steps 1 - Split the options into key/value pairs 2 - Cast the values to the expected type defined in the schema

func RenderSchemaRaw added in v1.76.0

func RenderSchemaRaw(tableTitle string, s string) error

render raw JSON schema document

func RenderSchemaTable added in v1.76.0

func RenderSchemaTable(tableTitle string, properties sdk.SchemaPropertiesMap) error

render de-normalized schema format

func WorkflowListTableOutput

func WorkflowListTableOutput(workflowListResult *action.WorkflowListResult) error

Types

type DotChainloopConfig added in v0.97.7

type DotChainloopConfig struct {
	ProjectVersion string `yaml:"projectVersion"`
}

type GateError added in v1.64.0

type GateError struct {
	PolicyName string
}

func (*GateError) Error added in v1.64.0

func (e *GateError) Error() string

type GracefulError

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

GracefulError represents an error that has been marked as gracefully handled In some parts of our code, we want to raise errors but we don't want the CLI to fail because of the flakiness or active development of the tool

func (GracefulError) Error

func (e GracefulError) Error() string

func (GracefulError) Unwrap added in v0.96.5

func (e GracefulError) Unwrap() error

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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