initapp

package
v0.22.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCmd = &cobra.Command{
	Use:   "init-app <app name>",
	Short: "Initialize a new Hyphen application in the current directory",
	Long: `
The init command sets up a new Hyphen application in your current directory.

This command will:
- Create a new application in Hyphen
- Generate a local configuration file
- Set up environment files for each project environment
- Update .gitignore to exclude sensitive files
- Create hyphen-entrypoint.sh (intended for Dockerfile usage)

If no app name is provided, it will prompt to use the current directory name.

The command will guide you through:
- Confirming or entering an application name
- Generating or providing an app ID
- Creating necessary local files

After initialization, you'll receive a summary of the new application, including its name,
ID, and associated organization.

Examples:
  hyphen init
  hyphen init "My New App"
  hyphen init "My New App" --id my-custom-app-id
`,
	Args: cobra.MaximumNArgs(1),
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		return user.ErrorIfNotAuthenticated()
	},
	Run: func(cmd *cobra.Command, args []string) {
		RunInitApp(cmd, args)
	},
}

Functions

func CreateAndPushEmptyEnvFile

func CreateAndPushEmptyEnvFile(cmd *cobra.Command, envService *env.EnvService, c config.Config, s models.Secret, orgID, appID, envID, envName string) error

func CreateGitignoredFile

func CreateGitignoredFile(cmd *cobra.Command, fileName string) error

func GenerateDefaultAppId

func GenerateDefaultAppId(appName string) string

func GetAppID

func GetAppID(cmd *cobra.Command, appName string) string

func GetAppName

func GetAppName(cmd *cobra.Command, args []string) (string, bool, error)

func HandleExistingApp

func HandleExistingApp(cmd *cobra.Command, appService app.AppService, orgID, appAlternateId string) (*models.App, error)

func PrintInitializationSummary

func PrintInitializationSummary(appName, appAlternateId, appID, orgID, projectAlternateId string)

func RunInitApp

func RunInitApp(cmd *cobra.Command, args []string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL