go scratch code for atproto
at main 45 lines 1.0 kB view raw
1package main 2 3import ( 4 "context" 5 "fmt" 6 "os" 7 8 _ "github.com/joho/godotenv/autoload" 9 10 "github.com/earthboundkid/versioninfo/v2" 11 "github.com/urfave/cli/v3" 12) 13 14func main() { 15 err := run(os.Args) 16 if err == ErrLintFailures { 17 os.Exit(1) 18 } else if err != nil { 19 fmt.Fprintf(os.Stderr, "error: %v\n", err) 20 os.Exit(-1) 21 } 22} 23 24func run(args []string) error { 25 26 app := cli.Command{ 27 Name: "glot", 28 Usage: "ATProto Lexicon Schema Tool", 29 Description: "Generic utility for working AT Lexicon schema files: fetching and updating existing public schemas; development and maintenance of new schemas; synchronization with the live network.\nFor more about AT Lexicon language see: https://atproto.com/specs/lexicon", 30 Version: versioninfo.Short(), 31 } 32 app.Commands = []*cli.Command{ 33 cmdLexLint, 34 cmdLexPull, 35 cmdLexStatus, 36 cmdLexDiff, 37 cmdLexBreaking, 38 cmdLexNew, 39 cmdLexPublish, 40 cmdLexUnpublish, 41 cmdLexCheckDNS, 42 cmdLexCodegen, 43 } 44 return app.Run(context.Background(), args) 45}