Skip to content

feat: 8sync clean --envs -- safe manual env cleanup #4

Description

@8syncdev

Problem

8sync clean was silently auto-deleting Python/conda virtual environments based solely on LastWriteTime. An env set up once and never modified (but still actively used) could be deleted without warning.

Changes

8sync clean (default)

Env section is now skipped entirely. Prints a hint:

skipped by default for safety. Use: 8sync clean --envs (list) or --envs --delete (manual select).

8sync clean --envs

List-only mode. No deletion. Output:

  [ 1] tools/deepagents-cli            177.6 MB    14d  2026-03-18 08:39:20Z
  [ 2] projects/.venv                   45.2 MB     3d  2026-03-29 10:11:00Z  ACTIVE
       ^ currently active in this shell (will be skipped)

Fields: index, parent/name, size, age in days, last-write UTC, ACTIVE tag if currently activated.

8sync clean --envs --delete

Prompts for comma-separated index selection. Only deletes what you explicitly pick. Active envs (VIRTUAL_ENV / CONDA_PREFIX) are always skipped even if selected.

8sync clean --envs --delete --all

Deletes all listed stale envs. Still skips: active envs, project-path envs, git-repo envs.

Safety guards

  • Invoke-CleanPath now calls Test-IsProjectPath at entry -- if TEMP/TMP points inside a project it is skipped entirely
  • Test-IsInsideGitRepo now detects .git files (worktrees) in addition to directories
  • Fixed C:\Users\Admin readonly clash (renamed local variable to `` to avoid collision with PS automatic variable)
  • --envs --delete double-checks Test-IsProjectPath and Test-IsInsideGitRepo before every removal

Commit

5dfea7e

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestos:windowsWindows-specific issue or fixsecuritySecurity-related change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions