Skip to content

feat(init): print success message and next steps after devbox init#2800

Merged
Lagoja merged 1 commit intomainfrom
jl/devbox-init-output
Mar 25, 2026
Merged

feat(init): print success message and next steps after devbox init#2800
Lagoja merged 1 commit intomainfrom
jl/devbox-init-output

Conversation

@Lagoja
Copy link
Collaborator

@Lagoja Lagoja commented Mar 24, 2026

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

Copy link
Contributor

Copilot AI left a comment

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
}
Copy link

Copilot AI Mar 24, 2026

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).

Suggested change
}
}
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()
Copy link

Copilot AI Mar 24, 2026

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).

Suggested change
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)
Copy link

Copilot AI Mar 24, 2026

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 force-pushed the jl/devbox-init-output branch from a2fa226 to 86fc12e Compare March 24, 2026 22:04
@Lagoja Lagoja merged commit bbe7a31 into main Mar 25, 2026
42 of 48 checks passed
@Lagoja Lagoja deleted the jl/devbox-init-output branch March 25, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants