feat: add persistent proxy profile management

This commit is contained in:
proxyctl coordinator
2026-07-17 02:08:51 +08:00
parent 73b027b85b
commit f9469cf6a2
13 changed files with 1390 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
package main
import (
"fmt"
"io"
"os"
tea "github.com/charmbracelet/bubbletea"
"proxyctl/internal/app"
"proxyctl/internal/profile"
"proxyctl/internal/tui"
)
func main() {
if err := run(os.Args[1:], os.Stdin, os.Stdout); err != nil {
fmt.Fprintln(os.Stderr, "proxyctl:", err)
os.Exit(1)
}
}
func run(args []string, input io.Reader, output io.Writer) error {
if len(args) != 0 {
return fmt.Errorf("this build supports no command-line arguments")
}
path, err := profile.ConfigPath()
if err != nil {
return err
}
application, err := app.New(profile.NewFileStore(path))
if err != nil {
return err
}
program := tea.NewProgram(tui.NewModel(application), tea.WithInput(input), tea.WithOutput(output))
_, err = program.Run()
return err
}