Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromContext ¶
NewFromContext creates an SDK client from CLI context.
Credential resolution order (first match wins):
- --public-key + --secret-key flags (both required together)
- --api-key pk_…:sk_… flag (deprecated; emits stderr warning)
- PROMPTVM_PUBLIC_KEY + PROMPTVM_SECRET_KEY env vars (silent)
- PROMPTVM_API_KEY=pk_…:sk_… env var (silent backward-compat)
- Active profile (api-key)
- Active profile (OAuth)
For OAuth profiles the access token is loaded from the keychain and auto-refreshed if it has expired.
Types ¶
type Credentials ¶
Credentials holds a resolved api-key credential pair, or — for OAuth profiles — a single bearer token. Exactly one of (PublicKey, SecretKey) or BearerToken is set.
func ResolveCredentials ¶
func ResolveCredentials(cmd *cobra.Command) (Credentials, error)
ResolveCredentials walks the precedence table and returns either a (publicKey, secretKey) pair or a bearer token. Exposed for testing.
func (Credentials) IsAPIKey ¶
func (c Credentials) IsAPIKey() bool
IsAPIKey reports whether the credential is a dual-header api-key pair.
Click to show internal directories.
Click to hide internal directories.