xenvcmd

package
v0.0.0-...-f626111 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var XEnvCmd = &gcli.Command{
	Name: "xenv",

	Desc: "Manage local development environments and tools, similar to mise and vfox",
	Help: `
Quick commands:
  <info>set</>    Quick exec the 'env set' subcommand
  <info>unset</>  Quick exec the 'env unset' subcommand
`,
	Subs: []*gcli.Command{
		subcmd.ToolsCmd,
		subcmd.NewUseCmd(),
		subcmd.NewUnuseCmd(),
		subcmd.EnvCmd,
		subcmd.PathCmd,
		subcmd.ConfigCmd,
		subcmd.ListCmd,
		subcmd.InitCmd,
		subcmd.NewShellCmd(),
		subcmd.ShellHookInitCmd(),
		subcmd.ShellDirenvCmd(),
	},

	Config: func(c *gcli.Command) {

		c.BoolOpt(&subcmd.GlobalFlag, "global", "g", false, "Operate for global config")
		c.BoolOpt(&xenvcom.DebugMode, "debug", "d", xenvcom.DebugMode, "Enable debug mode. can be XENV_DEBUG_MODE=true")

		c.On(events.OnCmdNotFound, func(ctx *gcli.HookCtx) (stop bool) {
			name := ctx.Str("name")

			if name == "set" || name == "unset" {
				newArgs := []string{"env", name}
				newArgs = append(newArgs, ctx.Strings("args")...)
				err := app.Cli.RunCmd("xenv", newArgs)
				if err != nil {
					fmt.Println(err)
				}
				return true
			}
			return false
		})
	},
}

XEnvCmd the main xenv command

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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