Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/boxcli/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type addCmdFlags struct {
config configFlags
}

func AddCmd() *cobra.Command {
func addCmd() *cobra.Command {
flags := addCmdFlags{}

command := &cobra.Command{
Expand Down
10 changes: 5 additions & 5 deletions internal/boxcli/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type cloudShellCmdFlags struct {
githubUsername string
}

func CloudCmd() *cobra.Command {
func cloudCmd() *cobra.Command {
command := &cobra.Command{
Use: "cloud",
Short: "[Preview] Remote development environments on the cloud",
Expand Down Expand Up @@ -74,8 +74,8 @@ func cloudShellCmd() *cobra.Command {
func cloudPortForwardCmd() *cobra.Command {
command := &cobra.Command{
Use: "forward <local-port>:<remote-port> | :<remote-port> | stop | list",
Short: "[Preview] Port forwards a local port to a remote devbox cloud port",
Long: "Port forwards a local port to a remote devbox cloud port. If 0 or " +
Short: "[Preview] Port forward a local port to a remote devbox cloud port",
Long: "Port forward a local port to a remote devbox cloud port. If 0 or " +
"no local port is specified, we find a suitable local port. Use 'stop' " +
"to stop all port forwards.",
Args: cobra.ExactArgs(1),
Expand Down Expand Up @@ -105,7 +105,7 @@ func cloudPortForwardCmd() *cobra.Command {
func cloudPortForwardStopCmd() *cobra.Command {
return &cobra.Command{
Use: "stop",
Short: "Stops all port forwards managed by devbox",
Short: "Stop all port forwards managed by devbox",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
return cloud.PortForwardTerminateAll()
Expand All @@ -117,7 +117,7 @@ func cloudPortForwardList() *cobra.Command {
return &cobra.Command{
Use: "list",
Aliases: []string{"ls"},
Short: "Lists all port forwards managed by devbox",
Short: "List all port forwards managed by devbox",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
l, err := cloud.PortForwardList()
Expand Down
4 changes: 2 additions & 2 deletions internal/boxcli/gen-docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
func genDocsCmd() *cobra.Command {
var genDocsCmd = &cobra.Command{
Use: "gen-docs <path>",
Short: "[internal] generate documentation for the CLI",
Long: "[internal] generates the documentation for the CLI's Cobra commands. " +
Short: "[Internal] Generate documentation for the CLI",
Long: "[Internal] Generates the documentation for the CLI's Cobra commands. " +
"Docs are placed in the directory specified by <path>.",
Hidden: true,
Args: cobra.ExactArgs(1),
Expand Down
11 changes: 6 additions & 5 deletions internal/boxcli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ type generateCmdFlags struct {
githubUsername string
}

func GenerateCmd() *cobra.Command {
func generateCmd() *cobra.Command {
flags := &generateCmdFlags{}

command := &cobra.Command{
Use: "generate",
Args: cobra.MaximumNArgs(0),
Use: "generate",
Short: "Generate supporting files for your project",
Args: cobra.MaximumNArgs(0),
}
command.AddCommand(devcontainerCmd())
command.AddCommand(dockerfileCmd())
Expand Down Expand Up @@ -104,8 +105,8 @@ func sshConfigCmd() *cobra.Command {
command := &cobra.Command{
Use: "ssh-config",
Hidden: true,
Short: "Generates ssh config to connect to devbox cloud",
Long: "Checks ssh config and if they don't exist, it generates the configs necessary to connect to devbox cloud VMs.",
Short: "Generate ssh config to connect to devbox cloud",
Long: "Check ssh config and if they don't exist, it generates the configs necessary to connect to devbox cloud VMs.",
Args: cobra.MaximumNArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
return runGenerateCmd(cmd, args, flags)
Expand Down
4 changes: 2 additions & 2 deletions internal/boxcli/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func globalListCmd() *cobra.Command {
func globalPullCmd() *cobra.Command {
return &cobra.Command{
Use: "pull <file> | <url>",
Short: "Pulls a global config from a file or URL",
Long: "Pulls a global config from a file or URL. URLs must be prefixed with 'http://' or 'https://'.",
Short: "Pull a global config from a file or URL",
Long: "Pull a global config from a file or URL. URLs must be prefixed with 'http://' or 'https://'.",
PreRunE: ensureNixInstalled,
RunE: pullGlobalCmdFunc,
Args: cobra.ExactArgs(1),
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type infoCmdFlags struct {
markdown bool
}

func InfoCmd() *cobra.Command {
func infoCmd() *cobra.Command {
flags := infoCmdFlags{}
command := &cobra.Command{
Use: "info <pkg>",
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"go.jetpack.io/devbox"
)

func InitCmd() *cobra.Command {
func initCmd() *cobra.Command {
command := &cobra.Command{
Use: "init [<dir>]",
Short: "Initialize a directory as a devbox project",
Expand Down
6 changes: 3 additions & 3 deletions internal/boxcli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"github.com/spf13/cobra"
)

func InstallCmd() *cobra.Command {
func installCmd() *cobra.Command {
flags := runCmdFlags{}
command := &cobra.Command{
Use: "install",
Short: "Installs all packages mentioned in devbox.json",
Long: "Starts a new devbox shell and installs all packages mentioned in devbox.json in current directory or" +
Short: "Install all packages mentioned in devbox.json",
Long: "Start a new devbox shell and installs all packages mentioned in devbox.json in current directory or" +
"a directory specified via --config. \n\n Then exits the shell when packages are done installing.\n\n ",
Args: cobra.MaximumNArgs(0),
PreRunE: ensureNixInstalled,
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"go.jetpack.io/devbox/internal/telemetry"
)

func LogCmd() *cobra.Command {
func logCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "log <event-name> [<event-specific-args>]",
Hidden: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type planCmdFlags struct {
config configFlags
}

func PlanCmd() *cobra.Command {
func planCmd() *cobra.Command {
flags := planCmdFlags{}

command := &cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/rm.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type removeCmdFlags struct {
config configFlags
}

func RemoveCmd() *cobra.Command {
func removeCmd() *cobra.Command {
flags := removeCmdFlags{}
command := &cobra.Command{
Use: "rm <pkg>...",
Expand Down
31 changes: 17 additions & 14 deletions internal/boxcli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,25 @@ func RootCmd() *cobra.Command {
SilenceErrors: true,
SilenceUsage: true,
}
command.AddCommand(AddCmd())
command.AddCommand(CloudCmd())
command.AddCommand(GenerateCmd())
// Stable commands
command.AddCommand(addCmd())
command.AddCommand(generateCmd())
command.AddCommand(globalCmd())
command.AddCommand(InfoCmd())
command.AddCommand(InitCmd())
command.AddCommand(InstallCmd())
command.AddCommand(LogCmd())
command.AddCommand(PlanCmd())
command.AddCommand(RemoveCmd())
command.AddCommand(RunCmd())
command.AddCommand(ServicesCmd())
command.AddCommand(SetupCmd())
command.AddCommand(ShellCmd())
command.AddCommand(infoCmd())
command.AddCommand(initCmd())
command.AddCommand(installCmd())
command.AddCommand(logCmd())
command.AddCommand(planCmd())
command.AddCommand(removeCmd())
command.AddCommand(runCmd())
command.AddCommand(servicesCmd())
command.AddCommand(setupCmd())
command.AddCommand(shellCmd())
command.AddCommand(shellEnvCmd())
command.AddCommand(VersionCmd())
command.AddCommand(versionCmd())
// Preview commands
command.AddCommand(cloudCmd())
// Internal commands
command.AddCommand(genDocsCmd())

command.PersistentFlags().BoolVarP(
Expand Down
6 changes: 3 additions & 3 deletions internal/boxcli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ type runCmdFlags struct {
config configFlags
}

func RunCmd() *cobra.Command {
func runCmd() *cobra.Command {
flags := runCmdFlags{}
command := &cobra.Command{
Use: "run [<script> | <cmd>]",
Short: "Runs a script or command in a shell with access to your packages",
Long: "Starts a new shell and runs your script or command in it, exiting when done.\n\n" +
Short: "Run a script or command in a shell with access to your packages",
Long: "Start a new shell and runs your script or command in it, exiting when done.\n\n" +
"The script must be defined in `devbox.json`, or else it will be interpreted as an " +
"arbitrary command. You can pass arguments to your script or command. Everything " +
"after `--` will be passed verbatim into your command (see examples).\n\n",
Expand Down
10 changes: 5 additions & 5 deletions internal/boxcli/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (flags *serviceManagerCmdFlag) register(cmd *cobra.Command) {
)
}

func ServicesCmd() *cobra.Command {
func servicesCmd() *cobra.Command {
flags := servicesCmdFlags{}
managerFlags := serviceManagerCmdFlag{}
servicesCommand := &cobra.Command{
Expand All @@ -48,31 +48,31 @@ func ServicesCmd() *cobra.Command {

startCommand := &cobra.Command{
Use: "start [service]...",
Short: "Starts service. If no service is specified, starts all services",
Short: "Start service. If no service is specified, starts all services",
RunE: func(cmd *cobra.Command, args []string) error {
return startServices(cmd, args, flags)
},
}

stopCommand := &cobra.Command{
Use: "stop [service]...",
Short: "Stops service. If no service is specified, stops all services",
Short: "Stop service. If no service is specified, stops all services",
RunE: func(cmd *cobra.Command, args []string) error {
return stopServices(cmd, args, flags)
},
}

restartCommand := &cobra.Command{
Use: "restart [service]...",
Short: "Restarts service. If no service is specified, restarts all services",
Short: "Restart service. If no service is specified, restarts all services",
RunE: func(cmd *cobra.Command, args []string) error {
return restartServices(cmd, args, flags)
},
}

processManagerCommand := &cobra.Command{
Use: "manager",
Short: "Starts process manager with all supported services",
Short: "Start process manager with all supported services",
RunE: func(cmd *cobra.Command, args []string) error {
return startProcessManager(cmd, managerFlags)
},
Expand Down
4 changes: 2 additions & 2 deletions internal/boxcli/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const nixDaemonFlag = "daemon"

func SetupCmd() *cobra.Command {
func setupCmd() *cobra.Command {
setupCommand := &cobra.Command{
Use: "setup",
Short: "Setup devbox dependencies",
Expand All @@ -27,7 +27,7 @@ func SetupCmd() *cobra.Command {

installNixCommand := &cobra.Command{
Use: "nix",
Short: "Installs Nix",
Short: "Install Nix",
RunE: func(cmd *cobra.Command, args []string) error {
return runInstallNixCmd(cmd)
},
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type shellCmdFlags struct {
PrintEnv bool
}

func ShellCmd() *cobra.Command {
func shellCmd() *cobra.Command {
flags := shellCmdFlags{}
command := &cobra.Command{
Use: "shell",
Expand Down
2 changes: 1 addition & 1 deletion internal/boxcli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type versionFlags struct {
verbose bool
}

func VersionCmd() *cobra.Command {
func versionCmd() *cobra.Command {
flags := versionFlags{}
command := &cobra.Command{
Use: "version",
Expand Down