Documentation
¶
Overview ¶
Package tui provides a terminal-based management interface for CLIProxyAPI.
Index ¶
- func CurrentLocale() string
- func Run(port int, secretKey string, hook *LogHook, output io.Writer) error
- func SetLocale(locale string)
- func T(key string) string
- func TabNames() []string
- func ToggleLocale()
- type App
- type Client
- func (c *Client) AddAPIKey(key string) error
- func (c *Client) DeleteAPIKey(index int) error
- func (c *Client) DeleteAuthFile(name string) error
- func (c *Client) DeleteField(path string) error
- func (c *Client) EditAPIKey(index int, newValue string) error
- func (c *Client) GetAPIKeys() ([]string, error)
- func (c *Client) GetAuthFiles() ([]map[string]any, error)
- func (c *Client) GetAuthStatus(state string) (string, string, error)
- func (c *Client) GetClaudeKeys() ([]map[string]any, error)
- func (c *Client) GetCodexKeys() ([]map[string]any, error)
- func (c *Client) GetConfig() (map[string]any, error)
- func (c *Client) GetConfigYAML() (string, error)
- func (c *Client) GetDebug() (bool, error)
- func (c *Client) GetGeminiKeys() ([]map[string]any, error)
- func (c *Client) GetLogs(after int64, limit int) ([]string, int64, error)
- func (c *Client) GetOpenAICompat() ([]map[string]any, error)
- func (c *Client) GetUsage() (map[string]any, error)
- func (c *Client) GetVertexKeys() ([]map[string]any, error)
- func (c *Client) PatchAuthFileFields(name string, fields map[string]any) error
- func (c *Client) PutBoolField(path string, value bool) error
- func (c *Client) PutConfigYAML(yamlContent string) error
- func (c *Client) PutIntField(path string, value int) error
- func (c *Client) PutStringField(path string, value string) error
- func (c *Client) SetSecretKey(secretKey string)
- func (c *Client) ToggleAuthFile(name string, disabled bool) error
- type LogHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the root bubbletea model that contains all tab sub-models.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps HTTP calls to the management API.
func (*Client) DeleteAPIKey ¶
DeleteAPIKey deletes an API key by index.
func (*Client) DeleteAuthFile ¶
DeleteAuthFile deletes a single auth file by name.
func (*Client) DeleteField ¶
DeleteField sends a DELETE request for a config field.
func (*Client) EditAPIKey ¶
EditAPIKey replaces an API key at the given index.
func (*Client) GetAPIKeys ¶
GetAPIKeys fetches the list of API keys. API returns {"api-keys": [...]}.
func (*Client) GetAuthFiles ¶
GetAuthFiles lists auth credential files. API returns {"files": [...]}.
func (*Client) GetAuthStatus ¶
GetAuthStatus polls the OAuth session status. Returns status ("wait", "ok", "error") and optional error message.
func (*Client) GetClaudeKeys ¶
GetClaudeKeys fetches Claude API keys.
func (*Client) GetCodexKeys ¶
GetCodexKeys fetches Codex API keys.
func (*Client) GetConfigYAML ¶
GetConfigYAML fetches the raw config.yaml content.
func (*Client) GetGeminiKeys ¶
GetGeminiKeys fetches Gemini API keys. API returns {"gemini-api-key": [...]}.
func (*Client) GetOpenAICompat ¶
GetOpenAICompat fetches OpenAI compatibility entries.
func (*Client) GetVertexKeys ¶
GetVertexKeys fetches Vertex API keys.
func (*Client) PatchAuthFileFields ¶
PatchAuthFileFields updates editable fields on an auth file.
func (*Client) PutBoolField ¶
PutBoolField updates a boolean config field.
func (*Client) PutConfigYAML ¶
PutConfigYAML uploads new config.yaml content.
func (*Client) PutIntField ¶
PutIntField updates an integer config field.
func (*Client) PutStringField ¶
PutStringField updates a string config field.
func (*Client) SetSecretKey ¶
SetSecretKey updates management API bearer token used by this client.
type LogHook ¶
type LogHook struct {
// contains filtered or unexported fields
}
LogHook is a logrus hook that captures log entries and sends them to a channel.
func NewLogHook ¶
NewLogHook creates a new LogHook with a buffered channel of the given size.
func (*LogHook) SetFormatter ¶
SetFormatter sets a custom formatter for the hook.