config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config handles loading, saving, and defaulting of NeuronCLI configuration. Configuration is stored as TOML at ~/.config/neuron/config.toml and is created automatically with sensible defaults on first run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

ConfigDir returns the path to the NeuronCLI configuration directory (~/.config/neuron). The directory is not guaranteed to exist.

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the full path to the TOML configuration file (~/.config/neuron/config.toml).

func Save

func Save(cfg *Config) error

Save writes cfg to disk as TOML, creating the config directory if needed.

Types

type AIConfig

type AIConfig struct {
	Enabled   bool   `toml:"enabled"`
	Provider  string `toml:"provider"` // "ollama", "openai", or "none"
	Model     string `toml:"model"`
	OpenAIKey string `toml:"openai_key"` // leave empty when using Ollama
	OllamaURL string `toml:"ollama_url"`
}

AIConfig holds AI/embedding provider settings.

type Config

type Config struct {
	VaultPath string   `toml:"vault_path"`
	Editor    string   `toml:"editor"` // command used to open notes (e.g. "nvim", "code")
	Theme     string   `toml:"theme"`  // "dark" or "light"
	GitRemote string   `toml:"git_remote"`
	AI        AIConfig `toml:"ai"`
}

Config is the top-level NeuronCLI configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config populated with sensible out-of-the-box values. The editor is taken from the $EDITOR environment variable, falling back to "vi".

func Load

func Load() (*Config, error)

Load reads the configuration from disk. If the file does not yet exist the config directory is created, defaults are written, and the defaults are returned. Any ~ in VaultPath is expanded to the user home directory.

Jump to

Keyboard shortcuts

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