Skip to main content

Overview

The cactus clean command removes all build artifacts, intermediate files, and caches to free up disk space or ensure a fresh build.

Usage

cactus clean
This command removes:
  • Build directory (build/)
  • Compiled libraries (.so, .a, .dylib)
  • Object files (.o)
  • CMake cache files
  • Python build artifacts
  • Temporary files

What Gets Preserved

The following are NOT removed:
  • Downloaded model weights in weights/
  • Your source code
  • Configuration files
  • The cactus CLI itself

When to Use

Run cactus clean when:
  • Switching between build targets (iOS ↔ Android)
  • Encountering build errors
  • Freeing up disk space
  • Starting a fresh build after code changes
  • Resolving CMake configuration issues

Example Workflow

# Clean all artifacts
cactus clean

# Rebuild for iOS
cactus build --apple

# Or rebuild for Android
cactus build --android

Disk Space Recovered

Typical space freed by cactus clean:
  • Debug build: ~500MB - 1GB
  • Release build: ~200MB - 400MB
  • Multiple targets: ~1GB - 2GB

Cleaning Weights

To also remove downloaded models:
rm -rf weights/
This permanently deletes all downloaded models. You’ll need to re-download them with cactus download.

Cleaning Python Cache

To clean Python-specific caches:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete

See Also

cactus build

Build native libraries

Installation

Initial setup and installation