A powerful CI/CD cleanup tool maintained by CICube
Keep your CI/CD pipelines clean and efficient! Automatically remove temporary files, logs, and artifacts with intelligent pattern matching.
CICube's AI agents monitor your GitHub Actions workflows, detect anomalies, and provide actionable fixes - saving you hours of debugging time.
Visit cicube.io to learn more about our other developer tools and solutions.
- 🎯 Smart Pattern Matching: Advanced glob pattern support for precise file targeting
- 🚫 Selective Exclusion: Protect important files with exclude patterns
- 🔍 Safe Dry-Run Mode: Preview changes before execution
- 🤖 CI Platform Detection: Automatic detection and optimization for:
- GitHub Actions
- GitLab CI
- CircleCI
- Generic CI environments
- ⚙️ Flexible Configuration: Support for both JSON and YAML config files
- 🎨 Beautiful Output: Clear, colorized console output for better visibility
# Global installation
npm install -g ci-cleaner
# Or use directly with npx
npx ci-cleaner
# Basic cleanup with default patterns
ci-cleaner
# Specify custom patterns
ci-cleaner --patterns="dist/ *.log build/"
# Exclude specific patterns
ci-cleaner --exclude="important.log critical-data/"
# Preview changes with dry-run
ci-cleaner --dry-run
Create a .cicleanerrc.json
or .cicleanerrc.yaml
in your project root:
{
"patterns": [
"dist/",
"*.log",
".cache",
"node_modules/",
"coverage/",
"build/",
"tmp/"
],
"exclude": [
"important.log",
"critical-data/"
]
}
Or in YAML format:
patterns:
- dist/
- "*.log"
- .cache
- node_modules/
- coverage/
- build/
- tmp/
exclude:
- important.log
- critical-data/
- name: Cleanup Build Artifacts
run: npx ci-cleaner --patterns="dist/ coverage/"
cleanup:
stage: cleanup
script:
- npx ci-cleaner --patterns="dist/ *.tmp"
- run:
name: Cleanup Workspace
command: npx ci-cleaner
Option | Description | Default |
---|---|---|
--patterns , -p |
File patterns to clean | **/tmp, **/*.log, .cache |
--exclude , -e |
Patterns to exclude | [] |
--dry-run , -d |
Preview without deleting | false |
--config , -c |
Path to config file | - |
--help , -h |
Show help | - |
--version |
Show version | - |
- Always use dry-run first: Preview changes with
--dry-run
before actual cleanup - Be specific with patterns: Use precise patterns to avoid accidental deletions
- Exclude critical files: Always exclude important files using the
--exclude
option - Use config files: Store your cleanup patterns in a config file for consistency
- 🐛 Issue Tracker: GitHub Issues
- 💬 Community: Join us on Slack
We welcome contributions! Please see our Contributing Guide for details.
MIT © CICube