config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config resolves the CLI's configuration directory and settings. Resolution is layered — flag > environment > config file > default — and every layer is validated, never silently skipped.

Index

Constants

View Source
const DefaultBaseURL = "https://positronick.com"

DefaultBaseURL is the production API used when nothing overrides it.

Variables

This section is empty.

Functions

func Dir

func Dir() (string, error)

Dir returns the CLI's configuration directory: $POSITRONICK_CONFIG_DIR > $XDG_CONFIG_HOME/positronick > ~/.config/positronick. The directory is not created.

func ResolveBaseURL

func ResolveBaseURL(flagValue string) (string, error)

ResolveBaseURL resolves the API base URL with precedence flag > $POSITRONICK_BASE_URL > config.json base_url > DefaultBaseURL. Whichever layer wins is validated (scheme must be http or https) and normalized (trailing slash stripped). A missing config file is fine; a malformed one is an error — fail loud, never guess.

Types

This section is empty.

Jump to

Keyboard shortcuts

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