Documentation
¶
Overview ¶
Package cmds provides CLI commands for llmcli.
Index ¶
- func NewAuthCmd() *cobra.Command
- func NewAuthInfoCmd() *cobra.Command
- func NewClaudeCmd() *cobra.Command
- func NewInferCmd(root *RootFlags) *cobra.Command
- func NewSettingsCmd() *cobra.Command
- type AccountInfo
- type ApplicationInfo
- type ClaudeSettings
- type OAuthAccountInfo
- type OAuthProfileResponse
- type OAuthRolesResponse
- type OrganizationInfo
- type RootFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuthInfoCmd ¶ added in v0.29.0
NewAuthInfoCmd returns the auth-info command for Claude OAuth profile.
func NewClaudeCmd ¶ added in v0.29.0
NewClaudeCmd returns the claude command group.
func NewInferCmd ¶
NewInferCmd returns the infer command.
func NewSettingsCmd ¶ added in v0.29.0
NewSettingsCmd returns the settings command for Claude local settings.
Types ¶
type AccountInfo ¶ added in v0.29.0
type ApplicationInfo ¶ added in v0.29.0
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
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
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).