Documentation
¶
Overview ¶
Package localconfig knows where AgentGuard keeps its files for the current user: the config folder (starter policy, API key, what `agentguard setup` set up) and the data folder setup creates for the audit log and state database. The config folder is the one the installers write the starter policy to (scripts/install.sh, scripts/install.ps1), so every piece agrees on it.
Functions take the OS as a parameter so tests can check every layout from any machine.
Index ¶
Constants ¶
const ( PolicyFile = "default.yaml" APIKeyFile = "api-key" SetupFile = "setup.json" )
Names of the files in the config folder.
Variables ¶
This section is empty.
Functions ¶
func APIKeyPath ¶
APIKeyPath is the file `agentguard setup` saves the server's API key in.
func ConfigDir ¶
ConfigDir is the user's AgentGuard config folder: $XDG_CONFIG_HOME/agentguard (else ~/.config/agentguard, on macOS too, like the installer), or %APPDATA%\agentguard on Windows. Empty when the home folder is unknown.
func DataDir ¶
DataDir is where `agentguard setup` keeps the audit log, the state database and the server log: $XDG_DATA_HOME/agentguard (else ~/.local/share/agentguard), or %LOCALAPPDATA%\AgentGuard\data on Windows.
func FirstLine ¶
FirstLine is the first line of b without surrounding whitespace: how a key file is read, so a trailing newline from an editor doesn't count.
func ReadAPIKey ¶
ReadAPIKey returns the key saved by `agentguard setup`, or "" when there is none. Client commands fall back to it when neither --api-key nor AGENTGUARD_API_KEY is set; the server never reads it implicitly (a key changes which interfaces it listens on), only through --api-key-file.
Types ¶
This section is empty.