Expand description
Persistent credential store for the memstead CLI.
Layout: <config_dir>/memstead/credentials — TOML, keyed on registry
host so the same CLI can talk to staging + production without
juggling files. Hostnames are lowercased so Memstead.io and
memstead.io resolve to the same entry.
Example on disk:
[registries."memstead.io"]
token = "gho_..."
user_login = "you"
scopes = ["read:user"]
obtained_at = "2026-04-16T08:12:34Z"File mode is locked to 0600 on Unix. Windows inherits default
user ACL — tightening that is out of scope for Session E.
Structs§
- Entry
- One credentials block.
Functions§
- credentials_
path - Absolute path to the credentials file. Caller is free to dereference this even when the file itself is missing; the read functions handle ENOENT.
- load_
for - Retrieve the credentials entry for a registry host, or
Noneif nothing is stored. Missing file is treated as “no credentials”. - remove_
for - Remove a credentials entry. Returns true if something was removed. Non-existent host is a silent no-op (returns false).
- save_
for - Persist a credentials entry for a registry host. Overwrites any existing entry for that host.