Cleanup Command
The aetheris cleanup command removes development artifacts and prepares your codebase for packaging and distribution.
Usage
Options
| Option | Description | Default |
|---|---|---|
--dry-run | Preview files to be deleted without deleting | false |
--deep | Include build directories (dist/, build/, *.egg-info/) | false |
--patterns | Additional patterns to exclude (comma-separated) | "" |
--directory, -d | Directory to clean | Current directory |
What Gets Cleaned
Standard Cleanup (Default)
| Category | Patterns |
|---|---|
| Security | .env, .env.*, secrets.json, *.pem, *.key, id_rsa* |
| OS Artifacts | .DS_Store, Thumbs.db, desktop.ini, ._* |
| Dev Tooling | .eslintrc*, .prettierrc*, mypy.ini, .ruff.toml |
| Test Files | *_test.py, test_*.py, conftest.py, tests/ |
| IDE Files | .vscode/, .idea/, *.swp, *.swo |
Deep Cleanup (--deep)
In addition to standard cleanup:
| Category | Patterns |
|---|---|
| Build Directories | build/, dist/, *.egg-info/ |
| Cache Directories | __pycache__/, .pytest_cache/, .mypy_cache/ |
| Compiled Files | *.pyc, *.pyo, *.so, *.pyd |
| Logs | *.log, logs/ |
| Backups | *.bak, *.backup, *.orig |
Examples
Preview Cleanup (Recommended First)
Standard Cleanup
Deep Cleanup
Custom Patterns
Specific Directory
Output Example
Cleanup: /path/to/project
Mode: Dry run (preview)
Deep clean: No
Files/directories that would be deleted:
Directories:
/path/to/project/.git/ (5.0 MB)
/path/to/project/tests/ (1.2 MB)
Files:
/path/to/project/.env (363 B)
/path/to/project/mypy.ini (1.2 KB)
Total: 6.5 MB would be freed
Best Practices
- Always use
--dry-runfirst — Review what will be deleted before actual cleanup - Use version control — Ensure changes are committed before cleanup
- Consider CI integration — Run cleanup as part of your release workflow
- Combine with validate-package — Run
aetheris validate-packageafter cleanup
Use Cases
Pre-Release Packaging
CI/CD Pipeline
# In GitHub Actions
- name: Clean artifacts
run: aetheris cleanup --deep
- name: Build package
run: python -m build
Development Reset
Security Considerations
The cleanup command removes security-sensitive files like:
.envfiles (API keys, secrets)- Private keys (
*.pem,*.key) - SSH keys (
id_rsa*,id_ed25519*) - Credential files (
credentials.json,secrets.yaml)
This helps prevent accidental publication of secrets to package registries.
Related Commands
aetheris validate-package— Validate package before publicationaetheris analysis— Full codebase analysis