feat(init): print success message and next steps after devbox init by Lagoja · Pull Request #2800 · jetify-com/devbox

Conversation

@Lagoja

Summary

Add a success message to devbox init with next steps

How was it tested?

Run devbox init in a test folder, confirm the message is displayed
Rerun the command, confirm the error message still displays

mikeland73

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds post-devbox init user feedback so users immediately see that initialization succeeded and what to do next.

Changes:

  • Print a success line after devbox init completes.
  • Print “next steps” guidance (e.g., devbox add, devbox shell) after initialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}
if err != nil {
return err
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runInitCmd can return nil in --auto --dry-run mode after only printing the config, but this handler will still print "Created devbox.json..." and next steps. That output is misleading for dry-run; consider skipping the success message when flags.dryRun is true (or have runInitCmd return whether a file was actually created).

}
}
if flags.dryRun {
return nil
}

Copilot uses AI. Check for mistakes.

err := runInitCmd(cmd, args, flags)
path := pathArg(args)
if path == "" || path == "." {
path, _ = os.Getwd()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

os.Getwd() error is ignored here. If it fails, path may become empty and the warning/success messages will be confusing (and it also hides the underlying failure). Please handle the error (e.g., return it or fall back to a safe placeholder).

path, _ = os.Getwd()
if wd, werr := os.Getwd(); werr != nil {
ux.Fwarningf(cmd.ErrOrStderr(), "could not determine working directory: %v", werr)
path = "<unknown working directory>"
} else {
path = wd
}

Copilot uses AI. Check for mistakes.

Comment on lines 33 to +34

err := runInitCmd(cmd, args, flags)
path := pathArg(args)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathArg(args) is computed here but runInitCmd also computes pathArg(args) internally. Consider computing the path once in initCmd and passing it down (or returning it from runInitCmd) to avoid duplicated path-resolution logic.

Copilot uses AI. Check for mistakes.

@Lagoja Lagoja deleted the jl/devbox-init-output branch

March 25, 2026 15:50

3 participants

@Lagoja @mikeland73