Documentation
¶
Overview ¶
Package claudeaccount stores local Claude Code profile selections. Claude Code itself owns authentication, credentials, and token refresh.
Index ¶
- func CheckArgs(args []string) error
- func CheckSettings(profile, cwd string) error
- func Environment(inherited []string, profile string) []string
- func OptionsError(name string) error
- func ProtectedEnvKey(key string) bool
- func RoutingEnv(profile string) map[string]string
- func ValidateProvider(p provider.Provider) error
- type Candidate
- type Store
- func (s *Store) Activate(ctx context.Context, c Candidate) error
- func (s *Store) ImportLegacy(ctx context.Context, importAccounts func(map[string]string, string) error) error
- func (s *Store) List() ([]string, string, error)
- func (s *Store) PreferName(c Candidate, name string) Candidate
- func (s *Store) Prepare(name string) (Candidate, error)
- func (s *Store) PrepareExisting(name, id string) (Candidate, error)
- func (s *Store) PrepareNew(name string) (Candidate, error)
- func (s *Store) Profile(id string) (string, error)
- func (s *Store) Resolve(name string) (string, string, error)
- func (s *Store) Select(ctx context.Context, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckArgs ¶
CheckArgs inspects extra --settings inputs without changing the arguments sent to Claude. Preferences remain native; conflicting auth is refused.
func CheckSettings ¶
CheckSettings refuses conflicting authentication instead of silently replacing an account or a gateway the user configured. Errors name the source and key, never its value.
func Environment ¶
Environment keeps the user's normal environment while selecting an isolated Claude profile. Gateway credentials and platform selectors must not take precedence over that profile's Claude subscription.
func OptionsError ¶
func ProtectedEnvKey ¶
ProtectedEnvKey identifies settings that can replace a subscription's identity or send its bearer token to a different service.
func RoutingEnv ¶
RoutingEnv is also written at the final settings layer. Removing inherited variables alone is insufficient: project settings can introduce them again.
func ValidateProvider ¶
Native accounts use their own Claude configuration. Reject CCL proxy/model options instead of accepting settings that this launch deliberately ignores.
Types ¶
type Candidate ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ImportLegacy ¶
func (s *Store) ImportLegacy(ctx context.Context, importAccounts func(map[string]string, string) error) error
ImportLegacy transfers the previous local account selector once. The registry and credentials remain untouched; the marker prevents a removed or renamed provider from being recreated on subsequent launches.
func (*Store) PreferName ¶
PreferName uses an account's reported email as the generated alias when it is available. Existing aliases are never replaced by a new login.
func (*Store) Prepare ¶
Prepare reserves a private directory for a new login, or returns an existing profile for re-authentication. A new profile is registered only on success.
func (*Store) PrepareExisting ¶
PrepareExisting keeps the stable profile id across provider renames and copies, including accounts that need to be signed in again on this device.
func (*Store) PrepareNew ¶
PrepareNew creates a distinct profile without consulting legacy aliases.
func (*Store) Profile ¶
Profile resolves only an existing locally managed profile, never an arbitrary filesystem path from a synced provider configuration.