cli/schema.go
cli/schema.goBrowse 1970 files
175 tokens
660 bytes
Token encoding: o200k_base
Snapshot 21a254f
← Back to SKILL.md
1package cli2 3import (4 "context"5 "encoding/json"6 "os"7 8 "github.com/railwayapp/railpack/core/config"9 "github.com/urfave/cli/v3"10)11 12var SchemaCommand = &cli.Command{13 Name: "schema",14 Usage: "outputs the JSON schema for the Railpack config",15 EnableShellCompletion: true,16 Flags: []cli.Flag{},17 Action: func(ctx context.Context, cmd *cli.Command) error {18 schema := config.GetJsonSchema()19 20 schemaJson, err := json.MarshalIndent(schema, "", " ")21 if err != nil {22 return cli.Exit(err, ExitCodeFailure)23 }24 25 _, _ = os.Stdout.Write(schemaJson)26 _, _ = os.Stdout.Write([]byte("\n"))27 28 return nil29 },30}31