Expand description
Login support tooling for Muse Code (feature async-client).
Muse’s auth surface is automation-friendly — no TUI to drive:
auth_setwrapsmuse auth set --api-key-stdin(the key travels over stdin; Muse refuses to take secrets as arguments).DeviceLoginFlowwrapsmuse login, a plain-stdout OAuth device-code flow: the CLI prints a verification URL and a short code, then polls until the user approves in a browser.logoutwrapsmuse logout(removes the saved credential;META_API_KEYin the environment is never touched).credentials_presentreports whether a run could authenticate right now (env key or saved credential file).
Credential resolution order (per the CLI): META_API_KEY env always
wins, then the saved credential at ~/.config/muse/auth.json.
Structs§
- Auth
File - Shape of
~/.config/muse/auth.json(observed schema_version 1). - Device
Code - The verification details a
DeviceLoginFlowpresents to the user. Serde-serializable for relay to remote UIs. - Device
Login Flow - An in-flight
muse loginOAuth device-code flow. - Provider
Credential - One saved provider credential.
Constants§
- META_
API_ KEY_ VAR - Environment variable that overrides any saved credential.
Functions§
- auth_
set - Save a provider API key:
muse auth set --provider <p> --api-key-stdin. - auth_
set_ with_ binary auth_setagainst a specific CLI binary.- credentials_
path - Path of the saved credential file (
~/.config/muse/auth.json), honoringXDG_CONFIG_HOME.Nonewhen no home directory resolves. - credentials_
present - True when a headless run could authenticate right now:
META_API_KEYis set (non-empty) or the saved credential file carries at least one provider. (muse logoutempties the providers map but keeps the file, so bare existence is not enough.) - logout
- Remove the saved credential:
muse logout. - logout_
with_ binary logoutagainst a specific CLI binary.