config

package
v0.19.821 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugEnvVar string = "NUON_DEBUG"
)
View Source
const NoTTYEnvVar string = "NUON_NO_TTY"
View Source
const PreviewEnvVar string = "NUON_PREVIEW"

Variables

This section is empty.

Functions

func Debug

func Debug() bool

func IsInteractive added in v0.19.807

func IsInteractive() bool

IsInteractive returns true if the CLI should use interactive TUI mode. It checks (in priority order):

  1. NUON_NO_TTY=true → non-interactive (explicit user override)
  2. CI env var is set → non-interactive (standard CI convention)
  3. stdout is not a terminal → non-interactive (pipe, redirect, cron)
  4. Otherwise → interactive

func NoTTY added in v0.19.807

func NoTTY() bool

func Preview

func Preview() bool

Types

type Config

type Config struct {
	*viper.Viper

	APIToken   string `mapstructure:"api_token"`
	APIURL     string `mapstructure:"api_url"`
	OrgID      string `mapstructure:"org_id"`
	InstallID  string `mapstructure:"install_id"`
	AppID      string `mapstructure:"app_id"`
	WorkflowID string `mapstructure:"workflow_id"`

	DisableTelemetry bool `mapstructure:"disable_telemetry"`
	Debug            bool `mapstructure:"debug"`
	Preview          bool `mapstructure:"preview"`

	Interactive bool `mapstructure:"-"`

	// internal configuration, not designed to be used by users
	GitHubAppName   string        `mapstructure:"github_app_name"`
	Env             string        `mapstructure:"-"`
	CleanupTimeout  time.Duration `mapstructure:"-"`
	SegmentWriteKey string        `mapstructure:"-"`
	SentryDSN       string        `mapstructure:"-"`
	UserID          string        `mapstructure:"-"`
}

config holds config values, read from the `~/.nuon` config file and env vars.

func NewConfig

func NewConfig(customFilepath string) (*Config, error)

NewConfig creates a new config instance.

func (*Config) BindCobraFlags

func (c *Config) BindCobraFlags(cmd *cobra.Command)

BindCobraFlags binds config values to the flags of the provided cobra command.

Jump to

Keyboard shortcuts

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