Documentation
¶
Index ¶
- func AddDomainToAllContainers(domain string) error
- func AddDomainToContainer(containerName, domain string) error
- func CheckBellStatus(containerName string) bool
- func DeleteContainer(containerName string) error
- func FormatExpiration(creds *Credentials) string
- func GetAuthStatus(containerName string) string
- func GetBranchName(containerName string) string
- func GetGitStatus(containerName string) string
- func GetLastActivity(containerName string) string
- func GetShortName(containerName, prefix string) string
- func IsClaudeRunning(containerName string) bool
- func IsTokenExpired(creds *Credentials) bool
- func RefreshTokens(containerName string) error
- func RestartContainer(containerName string) error
- func StopContainer(containerName string) error
- func TimeUntilExpiration(creds *Credentials) time.Duration
- type ContainerDetails
- type Credentials
- type DisplayOptions
- type Info
- type OperationType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDomainToAllContainers ¶
AddDomainToAllContainers adds a domain to all running containers' firewall
func AddDomainToContainer ¶
AddDomainToContainer adds a domain to a specific container's firewall
func CheckBellStatus ¶
CheckBellStatus checks if a container needs attention (bell or silence flags)
func DeleteContainer ¶
DeleteContainer removes a container and its volumes
func FormatExpiration ¶
func FormatExpiration(creds *Credentials) string
FormatExpiration returns human-readable expiration status
func GetAuthStatus ¶
GetAuthStatus retrieves the authentication status for a container
func GetBranchName ¶
GetBranchName retrieves the current git branch from a container
func GetGitStatus ¶
GetGitStatus gets git status indicators for a container Returns a fixed-width string for proper column alignment
func GetLastActivity ¶
GetLastActivity gets the last activity time for a container
func GetShortName ¶
GetShortName removes the prefix from a container name
func IsClaudeRunning ¶
IsClaudeRunning checks if Claude process is running in a container Excludes zombie/defunct processes
func IsTokenExpired ¶
func IsTokenExpired(creds *Credentials) bool
IsTokenExpired checks if token is expired (true) or valid (false)
func RefreshTokens ¶
RefreshTokens finds the freshest token and syncs it to a specific container
func RestartContainer ¶
RestartContainer performs a full container restart (docker stop + start)
func StopContainer ¶
StopContainer stops a running container
func TimeUntilExpiration ¶
func TimeUntilExpiration(creds *Credentials) time.Duration
TimeUntilExpiration returns duration until token expires (negative if expired)
Types ¶
type ContainerDetails ¶
type ContainerDetails struct {
Name string
ShortName string
Status string
StatusDetails string
Branch string
GitStatus string
AuthStatus string
LastActivity string
Uptime string
CPUs string
Memory string
IPAddress string
Ports []string
Volumes []string
Environment []string
RecentLogs string
}
ContainerDetails holds comprehensive information about a container for the details view
func GetContainerDetails ¶
func GetContainerDetails(containerName, prefix string) (*ContainerDetails, error)
GetContainerDetails fetches comprehensive information about a container
type Credentials ¶
type Credentials struct {
ClaudeAiOauth struct {
AccessToken string `json:"accessToken"`
RefreshToken string `json:"refreshToken"`
ExpiresAt int64 `json:"expiresAt"` // milliseconds
Scopes []string `json:"scopes"`
SubscriptionType string `json:"subscriptionType"`
} `json:"claudeAiOauth"`
}
Credentials represents the Claude OAuth credentials structure
func ReadCredentials ¶
func ReadCredentials(path string) (*Credentials, error)
ReadCredentials loads and parses credentials from a file path
type DisplayOptions ¶
type DisplayOptions struct {
ShowNumbers bool // Show selection numbers (for interactive selection)
ShowTable bool // Show full table format with all columns
}
DisplayOptions configures how containers are displayed
type Info ¶
type Info struct {
Name string
ShortName string
Status string
StatusDetails string
Branch string
NeedsAttention bool
IsDormant bool // Claude process not running
AuthStatus string // Token expiration status
LastActivity string // Time since last activity
GitStatus string // Git status indicators
CreatedAt time.Time // Container creation time
}
Info holds information about a container
func Display ¶
func Display(containers []Info, opts DisplayOptions) []Info
Display shows containers in a consistent format Returns the sorted list for use in selection
func GetAllContainers ¶
GetAllContainers returns a list of all containers (including stopped) with the given prefix
func GetRunningContainers ¶
GetRunningContainers returns a list of all running containers with the given prefix
func SortByPriority ¶
SortByPriority sorts containers by logical priority groups, then by creation date within each group Priority order: 1. Needs Attention (running with bell/silence flag) 2. Running (normal) 3. Dormant (running but Claude not active) 4. Stopped Within each group, sorts by creation date (newest first)
type OperationType ¶
type OperationType string
OperationType defines Docker operations that can be performed on containers
const ( OperationStop OperationType = "stop" OperationRestart OperationType = "restart" OperationDelete OperationType = "delete" OperationRefreshTokens OperationType = "refresh-tokens" )