Documentation
¶
Index ¶
- func AccessToken(ctx context.Context) (string, error)
- func Ensure(ctx context.Context, cwd string) (baseURL, token string, err error)
- func Login(ctx context.Context, in io.Reader, out io.Writer) error
- func Models(ctx context.Context, cwd string) ([]string, error)
- func RuntimeDirForTest(ctx context.Context) (string, error)
- func SetKeychainForTest(read func(ctx context.Context) ([]byte, error)) (restore func())
- type AuthStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶ added in v2026.1023.0
AccessToken reads the CLI's current subscription token without refreshing it; refresh tokens rotate, so only the CLI may spend them. On macOS the CLI usually keeps credentials in the login keychain rather than in the credentials file.
func Models ¶ added in v2026.1023.0
Models lists the model IDs the official SDK offers to the logged-in subscription.
func RuntimeDirForTest ¶ added in v2026.1023.0
RuntimeDirForTest exposes runtime extraction to the external test package.
Types ¶
type AuthStatus ¶ added in v2026.1023.0
type AuthStatus struct {
LoggedIn bool `json:"loggedIn"`
AuthMethod string `json:"authMethod"`
Email string `json:"email"`
}
func (AuthStatus) Subscription ¶ added in v2026.1023.0
func (s AuthStatus) Subscription() bool
Subscription reports whether the login can serve Claude Sub chats.