jetify-com / devbox

Instant, easy, and predictable development environments
https://www.jetify.com/devbox/
Apache License 2.0
8.78k stars 204 forks source link

Add a clean command to inverse `devbox init` #2335

Open trya2l opened 1 month ago

trya2l commented 1 month ago

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

Lagoja commented 1 month ago

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

DerArkeN commented 1 month ago

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

trya2l commented 1 month ago

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

DerArkeN commented 3 weeks ago

can we link the right pr to this?