package main import ( "context" "log/slog" "os" _ "github.com/joho/godotenv/autoload" "github.com/earthboundkid/versioninfo/v2" "github.com/urfave/cli/v3" ) func main() { if err := run(os.Args); err != nil { slog.Error("fatal", "err", err) os.Exit(-1) } } func run(args []string) error { app := cli.Command{ Name: "athome", Usage: "public web interface to bluesky account content", Version: versioninfo.Short(), } app.Commands = []*cli.Command{ &cli.Command{ Name: "serve", Usage: "run the server", Action: serve, Flags: []cli.Flag{ &cli.StringFlag{ Name: "appview-host", Usage: "method, hostname, and port of AppView instance", Value: "https://api.bsky.app", Sources: cli.EnvVars("ATP_APPVIEW_HOST"), }, &cli.StringFlag{ Name: "bind", Usage: "Specify the local IP/port to bind to", Required: false, Value: ":8200", Sources: cli.EnvVars("ATHOME_BIND"), }, &cli.BoolFlag{ Name: "debug", Usage: "Enable debug mode", Value: false, Required: false, Sources: cli.EnvVars("DEBUG"), }, }, }, } return app.Run(context.Background(), args) }