Documentation
¶
Index ¶
- func ActiveOrgID(env string) string
- func ConfigPath(env, orgID string) (string, error)
- func SetActiveOrgID(env, orgID string) error
- type CLIConfig
- type Config
- func (c *Config) BaseDir() (string, error)
- func (c *Config) Clear() error
- func (c *Config) Get(key string) string
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetList(key string) []string
- func (c *Config) Save() error
- func (c *Config) Set(key string, value string)
- func (c *Config) SetBool(key string, value bool)
- func (c *Config) SetList(key string, values []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveOrgID ¶
ActiveOrgID reads the active org ID for the given environment. Returns "" if no active org is set (first run or after reset).
func ConfigPath ¶
ConfigPath returns the config file path for the given env and orgID.
func SetActiveOrgID ¶
SetActiveOrgID writes the active org ID for the given environment.
Types ¶
type CLIConfig ¶
type CLIConfig struct {
// APIEndpoint is the Tero control plane GraphQL endpoint
APIEndpoint string
// PowerSyncEndpoint is the PowerSync service endpoint for local-first sync
PowerSyncEndpoint string
// ChatEndpoint is the Chat API endpoint for message streaming
ChatEndpoint string
// WorkOSClientID is the WorkOS OAuth client ID for authentication
WorkOSClientID string
// Debug enables debug logging
Debug bool
}
CLIConfig holds configuration for the Tero CLI.
func LoadCLIConfig ¶
func LoadCLIConfig() *CLIConfig
LoadCLIConfig loads CLI configuration from environment variables and defaults.
func (*CLIConfig) Environment ¶
Environment returns the environment name for data isolation. Resolution order:
- TERO_ENV env var (explicit: "local", "dev", "prd", or any custom value)
- Production API endpoint → "prd"
- Non-production → derive from URL host (fallback for custom setups)
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the Tero CLI configuration stored as YAML. It implements the app.Store interface using a map-based structure for flexibility. Each org gets its own config file at ~/.tero/environments/{env}/orgs/{orgID}/config.yaml.