mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
- Migrate module path to github.com/hanzoai/pack across all Go packages - Remove legacy upstream docs and competitor brand references - Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
31 lines
653 B
Go
31 lines
653 B
Go
package cli
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"os"
|
|
|
|
"github.com/hanzoai/pack/core/config"
|
|
"github.com/urfave/cli/v3"
|
|
)
|
|
|
|
var SchemaCommand = &cli.Command{
|
|
Name: "schema",
|
|
Usage: "outputs the JSON schema for the Railpack config",
|
|
EnableShellCompletion: true,
|
|
Flags: []cli.Flag{},
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
schema := config.GetJsonSchema()
|
|
|
|
schemaJson, err := json.MarshalIndent(schema, "", " ")
|
|
if err != nil {
|
|
return cli.Exit(err, ExitCodeFailure)
|
|
}
|
|
|
|
_, _ = os.Stdout.Write(schemaJson)
|
|
_, _ = os.Stdout.Write([]byte("\n"))
|
|
|
|
return nil
|
|
},
|
|
}
|