Advanced Usage
Master Merlin CLI's advanced features: concurrent processing, custom configurations, CI/CD integration, and enterprise security patterns.
Advanced Command Patterns
# Enable concurrent analysis with custom worker count merlin analyze . --concurrent --workers 8 # Combine with caching for maximum speed merlin analyze . --concurrent --cache --show-metrics # Watch mode with concurrent processing merlin analyze . --watch --concurrent --tools ruff,pylint
Performance Tip
Combine --concurrent with --cachefor optimal performance. The first run builds the cache, subsequent runs are dramatically faster.
Enterprise Features
Performance Optimization
Maximize analysis speed with intelligent caching and concurrent processing
- Concurrent processing with configurable workers
- Intelligent content-hash based caching
- File watching for continuous analysis
- Selective tool execution
Configuration Management
Fine-tune analysis behavior with project-specific configurations
- YAML configuration files
- Environment variable overrides
- Tool-specific settings
- Custom ignore patterns
Enterprise Security
Advanced security features for enterprise deployments
- Baseline comparison for regression detection
- Compliance reporting (PCI-DSS, OWASP)
- Encrypted credential storage
- Audit trail and logging
Configuration & Customization
# Project-specific Merlin configuration
analysis:
tools:
- pylint
- ruff
- bandit
- mypy
concurrent: true
workers: 4
cache: true
exclude:
- __pycache__
- "*.pyc"
- .pytest_cache
- venv
- .venv
security:
severity_threshold: medium
fail_on_critical: true
output:
show_metrics: true
format: summaryConfiguration Priority
Configuration sources in order of priority: CLI flags → Environment variables → .merlin.yml → Defaults
Common Workflow Patterns
Development Workflow
Integrate Merlin into your daily development process
Use case: Continuous feedback during development
Pre-commit Hook
Ensure code quality before commits
Use case: Quality gate before version control
CI/CD Pipeline
Automated quality checks in deployment pipeline
Use case: Deployment readiness validation
Security Audit
Comprehensive security analysis for compliance
Use case: Regulatory compliance and security audits
CI/CD Integration Example
GitHub Actions Workflow
name: Merlin Code Quality
on: [push, pull_request]
jobs:
quality-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Merlin CLI
run: pipx install merlin-cli
- name: System Check
run: merlin doctor check --fix
- name: Code Analysis
run: |
merlin analyze . --concurrent --show-metrics --format json --output analysis.json
env:
MERLIN_JWT: ${{ secrets.MERLIN_JWT }}
- name: Security Scan
run: |
merlin scan . --ci --fail-on critical --format sarif --output security.sarif
- name: Upload Results
uses: actions/upload-artifact@v3
with:
name: merlin-reports
path: |
analysis.json
security.sarifRelated Documentation
Explore specific command documentation for detailed options and examples.