Command Line Interface¶
NoteParser provides a comprehensive command-line interface for all document processing operations.
Global Options¶
Global Options: - --verbose, -v: Enable verbose logging - --config, -c PATH: Path to configuration file - --help, -h: Show help message
Commands Overview¶
| Command | Description |
|---|---|
parse | Parse a single document |
batch | Process multiple documents |
sync | Sync notes to repositories |
web | Start web dashboard |
init | Initialize configuration |
index | Generate organization index |
plugins | Manage plugins |
config | Configuration management |
Core Commands¶
parse - Parse Single Document¶
Convert a single document to your desired format:
Options: - --output, -o PATH: Output file path - --format, -f FORMAT: Output format (markdown or latex) - --metadata/--no-metadata: Extract metadata (default: true) - --preserve-formatting/--no-preserve-formatting: Preserve formatting (default: true)
batch - Process Multiple Documents¶
Process entire directories of documents:
Options: - --output-dir, -o PATH: Output directory - --format, -f FORMAT: Output format (markdown or latex) - --recursive/--no-recursive: Search recursively (default: true) - --pattern, -p PATTERN: File pattern to match - --parallel/--no-parallel: Enable parallel processing (default: true)
sync - Synchronize Notes¶
Sync processed notes to target repositories:
Options: - --target-repo, -t REPO: Target repository name - --course, -c COURSE: Course identifier - --branch, -b BRANCH: Target branch - --commit-message, -m MESSAGE: Custom commit message
Utility Commands¶
web - Web Dashboard¶
Start the interactive web interface:
Options: - --host, -h HOST: Host to bind to (default: 127.0.0.1) - --port, -p PORT: Port to bind to (default: 5000) - --debug/--no-debug: Enable debug mode - --open/--no-open: Open browser automatically
# Start on default port
noteparser web
# Start on custom host/port
noteparser web -h 0.0.0.0 -p 8080
# Start with debug mode
noteparser web --debug
init - Initialize Configuration¶
Set up NoteParser in your project:
Options: - --config-path, -c PATH: Configuration file path - --interactive/--no-interactive: Interactive setup - --template TEMPLATE: Configuration template
# Basic initialization
noteparser init
# Interactive setup
noteparser init --interactive
# Custom config path
noteparser init -c custom-config.yml
index - Generate Index¶
Create searchable indexes of your notes:
Options: - --format, -f FORMAT: Output format (json, yaml, or html) - --output, -o PATH: Output file path - --include-content/--no-include-content: Include full content
# Generate JSON index
noteparser index -f json
# Generate HTML index with content
noteparser index -f html --include-content -o index.html
Management Commands¶
plugins - Plugin Management¶
List and manage available plugins:
Subcommands: - list: List all plugins - enable PLUGIN: Enable a plugin - disable PLUGIN: Disable a plugin - info PLUGIN: Show plugin information
# List all plugins
noteparser plugins list
# Enable math processor
noteparser plugins enable math_processor
# Get plugin information
noteparser plugins info cs_processor
config - Configuration Management¶
Manage configuration settings:
Subcommands: - show: Display current configuration - validate: Validate configuration file - test SETTING: Test specific setting - migrate: Migrate configuration format
# Show current configuration
noteparser config show
# Validate configuration
noteparser config validate
# Test specific setting
noteparser config test plugins.math_processor.enabled
Advanced Usage¶
Environment Variables¶
Set configuration via environment variables:
Configuration Files¶
Use custom configuration files:
Piping and Automation¶
Chain commands together:
# Parse and immediately sync
noteparser parse lecture.pdf && noteparser sync output/*.md
# Batch process and generate index
noteparser batch docs/ && noteparser index -f json > course-index.json
Error Handling and Debugging¶
Verbose Output¶
Enable detailed logging:
Common Issues¶
File Not Found¶
Permission Errors¶
Configuration Issues¶
Exit Codes¶
0: Success1: General error2: Invalid arguments3: File not found4: Unsupported format5: Configuration error
Automation Examples¶
Shell Scripts¶
Create automation scripts:
#!/bin/bash
# daily-processing.sh
# Process today's lecture materials
noteparser batch daily-notes/ -p "*.pdf"
# Sync to study repository
noteparser sync output/*.md -t study-notes -c CS101
# Generate updated index
noteparser index -f json > daily-index.json
Cron Jobs¶
Schedule regular processing:
# Add to crontab
0 18 * * * cd /path/to/notes && noteparser batch input/ && noteparser sync output/*.md
Git Hooks¶
Integrate with Git workflows:
#!/bin/bash
# .git/hooks/pre-commit
# Process any new documents before commit
if [ -d "input" ]; then
noteparser batch input/ -o processed/
git add processed/
fi
Performance Tips¶
Parallel Processing¶
Enable parallel processing for large batches:
Memory Usage¶
For large files, process individually:
Caching¶
Use caching for repeated operations:
What's Next?¶
- API Reference - Complete API documentation
- Configuration - Customize your setup
- Quick Start - Get up and running quickly