railpack

Configure and troubleshoot Railpack builds, with emphasis on RAILPACK_* environment variables, railpack.json overlays, build-plan inspection, local CLI installation and usage, and local BuildKit containers. Use for Railpack provider configuration, custom install/build/start commands, Mise or Apt packages, build or runtime variables and secrets, generated-plan debugging, BUILDKIT_HOST errors, or running Railpack from a release or source checkout.

Install
npx skills add 'https://github.com/railwayapp/railpack/tree/main/.'
Incomplete bundle · no download
main · 21a254fScanned 2026-09-17

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗

cmd/cli/main.go

cmd/cli/main.goBrowse 1970 files
View on GitHub
← Back to SKILL.md
package main import (	"context"	"os" 	"github.com/charmbracelet/lipgloss"	"github.com/charmbracelet/log"	"github.com/muesli/termenv"	"github.com/railwayapp/railpack/cli"	urfave "github.com/urfave/cli/v3") var (	verbose bool	version = "dev" // This will be overwritten by goreleaser) func main() {	cli.Version = version 	logger := log.Default()	logger.SetTimeFormat("")	urfaveLogWriter := logger.StandardLog(log.StandardLogOptions{		ForceLevel: log.ErrorLevel,	}).Writer()	urfave.ErrWriter = urfaveLogWriter 	if os.Getenv("FORCE_COLOR") != "" {		lipgloss.SetColorProfile(termenv.TrueColor)	} 	// https://no-color.org	if os.Getenv("NO_COLOR") != "" {		lipgloss.SetColorProfile(termenv.Ascii)	} 	commands := []*urfave.Command{		cli.BuildCommand,		cli.PrepareCommand,		cli.InfoCommand,		cli.PlanCommand,		cli.SchemaCommand,		cli.FrontendCommand,	} 	// Disable the slice flag separator for all commands	for _, command := range commands {		command.DisableSliceFlagSeparator = true	} 	cmd := &urfave.Command{		Name:                  "railpack",		Usage:                 "Automatically analyze and generate build plans for applications",		EnableShellCompletion: true,		ConfigureShellCompletionCommand: func(c *urfave.Command) {			c.Hidden = false		},		Version: cli.Version,		Flags: []urfave.Flag{			&urfave.BoolFlag{				Name:        "verbose",				Usage:       "Enable verbose logging",				Sources:     urfave.EnvVars("RAILPACK_VERBOSE"),				Value:       false,				Destination: &verbose,			},		},		Before: func(ctx context.Context, cmd *urfave.Command) (context.Context, error) {			configureLogging(verbose) 			return ctx, nil		},		Commands: commands,	} 	if err := cmd.Run(context.Background(), os.Args); err != nil {		log.Fatal(err)	}} func configureLogging(verbose bool) {	log.SetTimeFormat("") 	if verbose {		log.SetLevel(log.DebugLevel)	} else {		log.SetLevel(log.InfoLevel)	}}