Generates comprehensive ad-blocking/privacy filter lists in the command line.









Blockingmachine CLI is a powerful command-line tool that streamlines the process of collecting, analyzing, and exporting ad-blocking and privacy filter lists. It aggregates rules from multiple trusted sources, intelligently deduplicates entries, categorizes blocking rules, and exports to various formats including AdGuard, hosts files, dnsmasq, and more. Designed for flexibility, the tool allows for custom filtering by category, priority, and tags, enabling both automated workflows and personalized filter list creation.
- Blockingmachine Core - Core functionality library
- Blockingmachine Desktop - Desktop application for managing filter lists
---
``bashInstall globally
npm install -g @blockingmachine/cli
Timeline
$3
- ๐ Full integration with @blockingmachine/core
- ๐ช TypeScript support
- ๐ฅ Multiple source list support
- ๐ Rule categorization and filtering
- โก Multi-format export capabilities
- โ
Advanced configuration options
- ๐ Bug fixes and performance improvements
$3
- ๐ Enhanced statistics and reporting
- ๐ Improved pattern matching and rule validation
- ๐ Support for additional export formats
- ๐ Better network resilience and retry logic
- ๐ฏ Rule optimization commands
- ๐ฆ Smaller installation footprint
- ๐งช Extended test coverage
$3
- ๐ Streaming processing for large rule sets
- ๐ Internationalization support
- ๐ Enhanced security features
- ๐ Performance optimizations
- ๐งฉ Plugin system for custom rule processors
- ๐ค Third-party service integrations
- ๐ ๏ธ Advanced debugging and troubleshooting tools
$3
#### 1.0.0-beta.3 (Current)
- Added parallel processing capabilities
- Fixed MongoDB connection handling issues
- Added more comprehensive export formats
- Improved command-line argument parsing
- Enhanced logging and error reporting
- Fixed NPM packaging issues
#### 1.0.0-beta.2
- Added support for multiple export formats
- Enhanced configuration options
- Improved rule categorization
- Fixed dependency resolution issues
- Optimized database operations
#### 1.0.0-beta.1
- Initial public release
- Core commands (import/export) stable
- Basic documentation
- Essential features implemented
#### 0.9.0 (Internal)
- Feature complete CLI
- Internal testing and validation
- Performance optimization
- Documentation drafting
#### 0.5.0 (Development)
- Command structure implementation
- Basic feature development
- Initial testing setup
Features
$3
- Smart Rule Classification: Automatically detects and categorizes rules:
- Domain-based blocking rules
- Regular expression patterns
- Exception rules
- Cosmetic filters
- Mobile-Specific Detection: Identifies mobile-specific rules using patterns:
- App store URLs
- Mobile domains
- App-specific patterns
- Platform-specific rules
$3
- Category-Based Management:
`bash
blockingmachine export --categories privacy,security
blockingmachine export --exclude advertising,gaming
`- Priority System:
`bash
blockingmachine export --min-priority 80
`- Tag-Based Filtering:
`bash
blockingmachine export --tags mobile,trusted
`$3
- DNS-Based Formats:
- Hosts files (
hosts)
- dnsmasq configuration (dnsmasq)
- Unbound configuration (unbound)
- BIND configuration (bind)
- Browser-Based Formats:
- AdGuard (adguard)
- ABP format (abp)
- Application-Specific:
- Privoxy rules (privoxy)
- Shadowrocket configuration (shadowrocket)$3
`bash
Import and process rules
blockingmachine importView database statistics
blockingmachine view
blockingmachine view --sample 10Run database migrations
blockingmachine migrateClean up and maintenance
blockingmachine cleanup
blockingmachine cleanup --drop # Development only
`$3
`json
{
"mongodb": {
"uri": "mongodb://localhost:27017/blockingmachine",
"options": {
"maxPoolSize": 10
}
},
"output": {
"directory": "./filters/output"
},
"sources": [
{
"name": "EasyPrivacy",
"url": "https://easylist.to/easylist/easyprivacy.txt",
"category": "privacy",
"enabled": true,
"priority": 90
}
]
}
`$3
- Detailed Logging:
`bash
blockingmachine --debug import
`- Log Files:
-
logs/error.log: Error-level messages
- logs/combined.log: All log levels$3
`mermaid
graph TD
A[Download Rules] --> B[Parse & Classify]
B --> C[Apply Modifiers]
C --> D[Deduplication]
D --> E[Store in MongoDB]
E --> F[Export Filters]
`$3
- Caching System:
`bash
# Enable caching in .blockingmachinerc.json
{
"caching": {
"enabled": true,
"ttl": 3600,
"maxSize": "100mb"
}
}
`- Batch Processing: Rules are processed in configurable batch sizes
- Parallel Processing: Multi-threaded rule processing for better performance
$3
`bash
View detailed error logs
blockingmachine --debug importCheck rule validation errors
blockingmachine validate --fix
`$3
- Setting up the development environment:
`bash
# Fork and clone the repository
git clone https://github.com/yourusername/blockingmachine-cli.git # Install dependencies
cd blockingmachine
npm install
# Run tests
npm test
# Start in development mode
npm run dev
`- Running Tests:
`bash
# Run all tests
npm test # Run specific test suite
npm test -- --grep "rule processing"
# Run with coverage
npm run test:coverage
`$3
`bash
Development mode
NODE_ENV=developmentMongoDB configuration
MONGODB_URI=mongodb://localhost:27017/blockingmachine
MONGODB_MAX_POOL_SIZE=10Logging
LOG_LEVEL=debug
LOG_FORMAT=prettyFeature flags
ENABLE_CACHING=true
ENABLE_PARALLEL_PROCESSING=true
`$3
#### Common Issues
1. MongoDB Connection Issues
`bash
# Check MongoDB status
brew services list | grep mongodb # Start MongoDB if needed
brew services start mongodb-community
`2. Permission Issues
`bash
# Fix output directory permissions
chmod 755 ./filters/output
`3. Memory Issues
`bash
# Increase Node.js memory limit
export NODE_OPTIONS="--max-old-space-size=4096"
`$3
#### Command Context
`typescript
interface CommandContext {
config: AppConfig;
debug: boolean;
logger: Logger;
}
`#### Export Options
`typescript
interface ExportOptions {
formats?: SupportedFormat[];
categories?: string[];
excludeCategories?: string[];
minPriority?: number;
tags?: string[];
outputPath?: string;
}
`$3
- All downloaded content is validated and sanitized
- HTTPS-only for rule downloads
- Input validation for all command parameters
- Safe file system operations
Please read our Contributing Guide for more details.
$3
We use ESLint and Prettier to maintain code quality. Before submitting a pull request:
`bash
Run linter
npm run lint # Fix linting issues automatically
npm run lint:fix
``- Electron: Cross-platform desktop application framework
- React: UI library for building interactive interfaces
- TypeScript: Type-safe JavaScript
- Recharts: Responsive charting library
- Electron Store: Persistent settings storage
- @blockingmachine/core: Core rule processing functionality
This project is licensed under the BSD-3-Clause License.