Structs§
- Chave
Armazenada - Represents a stored API key entry in the XDG configuration file.
- Config
Arquivo - Represents the structured TOML configuration file.
Functions§
- aplicar_
permissoes_ 600 - Sets 600 permissions (owner read/write only) on Unix systems.
- carregar_
chaves_ api - Loads API keys using the four-layer precedence hierarchy:
- cmd_
keys_ add - Adds a new key to the XDG storage.
- cmd_
keys_ clear - Removes all stored keys. Asks for confirmation unless
--yesis passed. - cmd_
keys_ export - Exports all keys to stdout in
CONTEXT7_API=<value>format, one per line. - cmd_
keys_ import - Imports keys from a
.envfile, readingCONTEXT7_API=entries. - cmd_
keys_ list - Lists all stored keys with their 1-based indices and masked values.
- cmd_
keys_ path - Displays the path of the XDG configuration file.
- cmd_
keys_ remove - Removes a key by its 1-based index.
- descobrir_
caminho_ config - Discovers the XDG configuration path for the
config.tomlfile. - descobrir_
caminho_ logs_ xdg - Discovers the XDG path for storing log files.
- escrever_
config_ arquivo - Writes a complete
ConfigArquivoto the XDG configuration file. - escrever_
config_ xdg - Writes (or updates) the XDG configuration file with the provided key.
- extrair_
chaves_ env - Extracts
CONTEXT7_API=keys from.envfile content in memory. - ler_
config_ xdg - Layer 2: reads keys from the XDG configuration file (
config.toml). - ler_
config_ xdg_ raw - Reads the XDG configuration file and returns the full
ConfigArquivo. - ler_
env_ compile_ time - Layer 4: reads keys embedded at compile time via
option_env!("CONTEXT7_API_KEYS"). - ler_
env_ cwd - Layer 3: reads keys from the
.envfile in the current working directory. - ler_
env_ var_ chave - Layer 1: reads keys from the
CONTEXT7_API_KEYSruntime environment variable. - mascarar_
chave - Masks an API key showing only the first 12 and last 4 characters.