cmds

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package cmds provides CLI commands for llmcli.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthCmd

func NewAuthCmd() *cobra.Command

NewAuthCmd returns the auth command group.

func NewAuthInfoCmd added in v0.29.0

func NewAuthInfoCmd() *cobra.Command

NewAuthInfoCmd returns the auth-info command for Claude OAuth profile.

func NewClaudeCmd added in v0.29.0

func NewClaudeCmd() *cobra.Command

NewClaudeCmd returns the claude command group.

func NewInferCmd

func NewInferCmd(root *RootFlags) *cobra.Command

NewInferCmd returns the infer command.

func NewSettingsCmd added in v0.29.0

func NewSettingsCmd() *cobra.Command

NewSettingsCmd returns the settings command for Claude local settings.

Types

type AccountInfo added in v0.29.0

type AccountInfo struct {
	UUID         string `json:"uuid"`
	FullName     string `json:"full_name"`
	DisplayName  string `json:"display_name"`
	Email        string `json:"email"`
	HasClaudeMax bool   `json:"has_claude_max"`
	HasClaudePro bool   `json:"has_claude_pro"`
	CreatedAt    string `json:"created_at"`
}

type ApplicationInfo added in v0.29.0

type ApplicationInfo struct {
	UUID string `json:"uuid"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type ClaudeSettings added in v0.29.0

type ClaudeSettings struct {
	OAuthAccount                  *OAuthAccountInfo `json:"oauthAccount,omitempty"`
	UserID                        string            `json:"userID,omitempty"`
	AnonymousID                   string            `json:"anonymousId,omitempty"`
	HasCompletedOnboarding        bool              `json:"hasCompletedOnboarding"`
	FirstStartTime                string            `json:"firstStartTime,omitempty"`
	InstallMethod                 string            `json:"installMethod,omitempty"`
	AutoUpdates                   bool              `json:"autoUpdates,omitempty"`
	AutoUpdatesProtectedForNative bool              `json:"autoUpdatesProtectedForNative,omitempty"`
	ClaudeCodeFirstTokenDate      string            `json:"claudeCodeFirstTokenDate,omitempty"`
	NumStartups                   int               `json:"numStartups"`
	LastReleaseNotesSeen          string            `json:"lastReleaseNotesSeen,omitempty"`
	MCPServers                    json.RawMessage   `json:"mcpServers,omitempty"`
	MetricsStatusCache            json.RawMessage   `json:"metricsStatusCache,omitempty"`
	AdditionalModelOptionsCache   json.RawMessage   `json:"additionalModelOptionsCache,omitempty"`
	ChangelogLastFetched          int64             `json:"changelogLastFetched,omitempty"`
	CachedGrowthBookFeatures      json.RawMessage   `json:"cachedGrowthBookFeatures,omitempty"`
	PassesLastSeenRemaining       int               `json:"passesLastSeenRemaining"`
	HasAvailableSubscription      bool              `json:"hasAvailableSubscription"`
	EffortCalloutDismissed        bool              `json:"effortCalloutDismissed"`
	EffortCalloutV2Dismissed      bool              `json:"effortCalloutV2Dismissed"`
	LastPlanModeUse               int64             `json:"lastPlanModeUse,omitempty"`
}

ClaudeSettings represents the non-project settings from ~/.claude.json.

type OAuthAccountInfo added in v0.29.0

type OAuthAccountInfo struct {
	AccountUUID           string `json:"accountUuid"`
	DisplayName           string `json:"displayName"`
	EmailAddress          string `json:"emailAddress"`
	OrganizationUUID      string `json:"organizationUuid"`
	OrganizationName      string `json:"organizationName"`
	OrganizationRole      string `json:"organizationRole"`
	WorkspaceRole         any    `json:"workspaceRole,omitempty"`
	HasExtraUsageEnabled  bool   `json:"hasExtraUsageEnabled"`
	BillingType           string `json:"billingType"`
	AccountCreatedAt      string `json:"accountCreatedAt"`
	SubscriptionCreatedAt string `json:"subscriptionCreatedAt"`
}

OAuthAccountInfo represents the oauthAccount field from settings.

type OAuthProfileResponse added in v0.29.0

type OAuthProfileResponse struct {
	Account      AccountInfo      `json:"account"`
	Organization OrganizationInfo `json:"organization"`
	Application  ApplicationInfo  `json:"application"`
}

OAuthProfileResponse represents the response from /api/oauth/profile.

type OAuthRolesResponse added in v0.29.0

type OAuthRolesResponse struct {
	OrganizationUUID string `json:"organization_uuid"`
	OrganizationName string `json:"organization_name"`
	OrganizationRole string `json:"organization_role"`
	WorkspaceUUID    string `json:"workspace_uuid,omitempty"`
	WorkspaceName    string `json:"workspace_name,omitempty"`
	WorkspaceRole    string `json:"workspace_role,omitempty"`
}

OAuthRolesResponse represents the response from /api/oauth/claude_cli/roles.

type OrganizationInfo added in v0.29.0

type OrganizationInfo struct {
	UUID                 string `json:"uuid"`
	Name                 string `json:"name"`
	OrganizationType     string `json:"organization_type"`
	BillingType          string `json:"billing_type"`
	RateLimitTier        string `json:"rate_limit_tier"`
	HasExtraUsageEnabled bool   `json:"has_extra_usage_enabled"`
	SubscriptionStatus   string `json:"subscription_status"`
}

type RootFlags added in v0.23.0

type RootFlags struct {
	// Debug enables provider-level debug logging.
	Debug bool
	// LogHTTP enables HTTP request/response logging at Debug level.
	LogHTTP bool
	// LogHTTPDebug additionally logs request/response headers and bodies.
	// Has no effect unless LogHTTP is also true.
	LogHTTPDebug bool
	// LogHTTPAllHeaders disables the response header allowlist and prints all headers.
	// Has no effect unless LogHTTPDebug is also true.
	LogHTTPAllHeaders bool
	// LogEvents prints each StreamEvent as JSON to stderr as it is consumed
	// from the channel, before any other handling. Useful for debugging the
	// provider event stream at the application layer.
	LogEvents bool
}

RootFlags holds flags defined on the root command that are shared across all subcommands.

func (*RootFlags) BuildHTTPClient added in v0.23.0

func (f *RootFlags) BuildHTTPClient() (*http.Client, *httpLogHandler)

BuildHTTPClient constructs an *http.Client from the root flags. Returns nil when no HTTP logging is requested, causing providers to fall back to llm.DefaultHttpClient(). The returned handler may be non-nil even when the client is nil — callers should check the client first.

func (*RootFlags) BuildLLMOptions added in v0.23.0

func (f *RootFlags) BuildLLMOptions(handler *httpLogHandler) []llm.Option

BuildLLMOptions returns llm.Option values for the root flags to be passed to providers, including ones that don't use the HTTP transport for logging (e.g. Bedrock).

Jump to

Keyboard shortcuts

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