Documentation
¶
Overview ¶
Package tui provides a terminal-based management interface for CLIProxyAPI.
Index ¶
- func Run(port int, secretKey string, hook *LogHook, output io.Writer) error
- type Client
- func (c *Client) DeleteAuthFile(name string) error
- func (c *Client) DeleteField(path string) error
- func (c *Client) GetAPIKeys() ([]string, 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) PatchAuthFileFields(name string, fields map[string]any) error
- func (c *Client) PutConfigYAML(yamlContent string) error
- type LogHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps HTTP calls to the management API.
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) GetAPIKeys ¶
GetAPIKeys fetches the list of API keys. API returns {"api-keys": [...]}.
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) PatchAuthFileFields ¶
PatchAuthFileFields updates editable fields on an auth file.
func (*Client) PutConfigYAML ¶
PutConfigYAML uploads new config.yaml content.
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.