TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/moonrepo/moon/llms.txt
Use this file to discover all available pages before exploring further.
moon teardown command, as its name infers, will teardown and clean the current environment,
opposite the setup command. It achieves this by doing the following:
- Uninstalling all configured toolchains
- Removing any download or temporary files/folders
How It Works
The teardown command:- Identifies toolchains - Reads configured toolchains from
.moon/toolchains.* - Calls teardown hooks - Executes teardown logic for each toolchain plugin
- Uninstalls versions - Removes installed toolchain versions via proto
- Cleans artifacts - Removes temporary files and downloads
What Gets Removed
Toolchain Installations
Removes installed versions from~/.proto/tools/:
- Node.js installations and npm/yarn/pnpm
- Rust installations and cargo
- Go installations
- Python installations
- Deno installations
- Bun installations
- Custom toolchains
Temporary Files
Cleans up:- Download caches
- Temporary build files
- Installation artifacts
- Shim/wrapper scripts
What Gets Kept
Workspace Cache
The teardown command does NOT remove:.moon/cache/directory- Task outputs and artifacts
- Hash manifests
- Workspace state
moon clean to remove cache.
Configuration
All configuration files remain:.moon/toolchains.yml.moon/workspace.yml- Project
moon.ymlfiles
Source Code
Your source code and dependencies are untouched:node_modules/Cargo.lock/target/- Project files
When to Use
Usemoon teardown when you want to:
Clean Development Environment
Switch Toolchain Versions
Troubleshoot Installation Issues
Free Disk Space
CI/CD Usage
In CI environments, teardown is rarely needed since:- Runners are typically ephemeral
- Toolchains are installed fresh each run
- Cleanup happens automatically
Comparison with Other Commands
moon teardown vs moon clean
moon teardown- Uninstalls toolchains, removes binariesmoon clean- Removes workspace cache, task outputs
moon teardown vs moon setup
moon teardown- Removes toolchainsmoon setup- Installs toolchains
System vs Managed Toolchains
If you use system-installed toolchains:moon teardown:
- Will NOT uninstall system toolchains
- Only cleans moon-managed installations
- System Node.js, Rust, etc. remain untouched
Examples
Basic teardown
Complete cleanup
Reset and reinstall
CI cleanup job
Safety
The teardown command is safe to run:- Does not affect system installations
- Does not remove configuration
- Does not delete source code
- Does not remove dependencies (node_modules, etc.)
moon setup.
Troubleshooting
Teardown Fails
If teardown fails:- Check if processes are using the toolchains
- Close editors, terminals, running tasks
- Try manual cleanup:
- Check file permissions
Partial Teardown
If some toolchains fail to uninstall:- Other toolchains are still removed
- Check error messages
- May need manual intervention
- System toolchains require manual removal
Configuration
*in.moon/toolchains.*- Toolchains guide - Configure toolchains
- proto documentation - Toolchain manager
See Also
moon setup- Install toolchainsmoon clean- Clean workspace cachemoon upgrade- Upgrade moon itself