   (if (not builds)
       (progn (print! (info "No builds to purge"))
              0)
-    (length
-     (delq nil (mapcar #'doom--cli-packages-purge-build builds)))))
+    (print! (start "Purging straight builds..." (length builds)))
+    (print-group!
+     (length
+      (delq nil (mapcar #'doom--cli-packages-purge-build builds))))))
 
 (defun doom--cli-packages-regraft-repo (repo)
   (let ((default-directory (straight--repos-dir repo)))

              (setq success t)))
       (if (not regraft-repos-p)
           (print! (info "Skipping regrafting"))
         (print! (start "Regrafting %d repos..." (length repos-to-regraft)))
         (and (doom--cli-packages-regraft-repos repos-to-regraft)
              (setq success t)))
       success))))

  (if (not repos)
      (progn (print! (info "No repos to purge"))
             0)
    (print! (start "Purging straight repositories..."))
    (print-group!
     (length
      (delq nil (mapcar #'doom--cli-packages-purge-repo repos))))))

(defun doom--cli-packages-purge-elpa ()
  (require 'core-packages)
  (let ((dirs (doom-files-in package-user-dir :type t :depth 0)))
    (if (not dirs)
        (progn (print! (info "No ELPA packages to purge"))
               0)
      (print! (start "Purging ELPA packages..."))
      (dolist (path dirs (length dirs))
        (condition-case e
            (print-group!
             (if (file-directory-p path)
                 (delete-directory path 'recursive)
               (delete-file path))
             (print! (success "Deleted %s") (relpath path)))
          (error
           (print! (error "Failed to delete %s because: %s")
                   (relpath path) e)))))))

(defun doom-cli-packages-purge (&optional elpa-p builds-p repos-p regraft-repos-p)
  "Auto-removes orphaned packages and repos.
