devbox icon indicating copy to clipboard operation
devbox copied to clipboard

Add a clean command to inverse `devbox init`

Open trya2l opened this issue 1 year ago • 4 comments

What problem are you trying to solve?

Sometimes, I start using devbox in a folder, but I later on decide to migrate to another one, for different considerations.

In this case, I'd like to rapidly clean up the folder, but then I need to do that manually, even if this is not a complex task.

What solution would you like?

I'd love something like devbox clean to remove devbox from the current folder (including direnv when the devbox generate direnv has been invoked)

Alternatives you've considered

Currently, I remove everything manually

rm -rf .devbox devbox.* .envrc

trya2l avatar Oct 08 '24 17:10 trya2l

@DerArkeN @trya2l -- are you sure that you'd want to delete the devbox.json as well? I worry people might run this to clear their .devbox and devbox.lock state and lose their devbox.json unexpectedly.

Lagoja avatar Oct 10 '24 18:10 Lagoja

I am with you on this one. Maybe add a "--hard" or similar if you want to delete the config as well?

truearken avatar Oct 10 '24 19:10 truearken

@DerArkeN thanks for the PR, that was fast!

@Lagoja You're right, I didn't consider the potential side effects.

I'm unfamiliar with devbox under the hood, but as @DerArkeN mentionned, a flag --hard, --all, --force, ... could be a good way to go, I guess.

Now that I regard this more seriously, even if a lot of software doesn't provide the ability to clean/revert the changes applied, as a user, this still looks like a desirable feature, even more so if it doesn't conflict with future enhancements.

trya2l avatar Oct 10 '24 20:10 trya2l

can we link the right pr to this?

truearken avatar Oct 22 '24 08:10 truearken