Documentation
¶
Index ¶
Constants ¶
const ( EnvHome = "BRAINJAR_HOME" ConfigFile = "config.yaml" DBFile = "brainjar.db" )
const ConfigSchemaVersion = 1
ConfigSchemaVersion is bumped when the on-disk YAML schema changes in a way older binaries can't read.
const DefaultContextName = "default"
DefaultContextName is the name assigned to the context that holds the bootstrap workspace.
const DefaultPlatform = "claude"
DefaultPlatform is the adapter used when a context is initialized without an explicit choice.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath returns the absolute path to the config file inside home.
func IsNotExist ¶
IsNotExist reports whether err indicates the config file is missing.
func ResolveHome ¶
ResolveHome returns the brainjar home directory.
Precedence, highest wins:
- homeFlag (the --home flag value, empty if unset)
- $BRAINJAR_HOME
- $HOME/.brainjar
Types ¶
type Config ¶
type Config struct {
SchemaVersion int `yaml:"schema_version" koanf:"schema_version"`
ActiveContext string `yaml:"active_context" koanf:"active_context"`
Contexts map[string]*Context `yaml:"contexts" koanf:"contexts"`
}
Config is the on-disk CLI configuration. Holds every known context and tracks which one is active.
type Context ¶
type Context struct {
WorkspaceID string `yaml:"workspace_id" koanf:"workspace_id"`
Platform string `yaml:"platform" koanf:"platform"`
// URL, when set, marks this context as remote — the CLI talks to
// the server at this URL instead of opening the embedded SQLite.
URL string `yaml:"url,omitempty" koanf:"url,omitempty"`
// APIKeyRef names a secret (resolved by the caller at send time)
// that holds the bearer token for the remote URL. Never the
// plaintext.
APIKeyRef string `yaml:"api_key_ref,omitempty" koanf:"api_key_ref,omitempty"`
}
Context is one entry in the contexts map — a named profile that binds a workspace, platform, and (when remote) an HTTP endpoint plus an API-key reference.