claude

package
v2026.1121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessToken added in v2026.1023.0

func AccessToken(ctx context.Context) (string, error)

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 Ensure

func Ensure(ctx context.Context, cwd string) (baseURL, token string, err error)

func Login

func Login(ctx context.Context, in io.Reader, out io.Writer) error

func Models added in v2026.1023.0

func Models(ctx context.Context, cwd string) ([]string, error)

Models lists the model IDs the official SDK offers to the logged-in subscription.

func RuntimeDirForTest added in v2026.1023.0

func RuntimeDirForTest(ctx context.Context) (string, error)

RuntimeDirForTest exposes runtime extraction to the external test package.

func SetKeychainForTest added in v2026.1023.0

func SetKeychainForTest(read func(ctx context.Context) ([]byte, error)) (restore func())

SetKeychainForTest replaces the keychain reader and returns a function that restores it.

Types

type AuthStatus added in v2026.1023.0

type AuthStatus struct {
	LoggedIn   bool   `json:"loggedIn"`
	AuthMethod string `json:"authMethod"`
	Email      string `json:"email"`
}

func Status added in v2026.1023.0

func Status(ctx context.Context) (AuthStatus, error)

func (AuthStatus) Subscription added in v2026.1023.0

func (s AuthStatus) Subscription() bool

Subscription reports whether the login can serve Claude Sub chats.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL