Skip to content

CLI Reference Guide

Overview

Complete reference for NetIntel-OCR v0.1.18.1 CLI commands with full multi-model support and 30+ processing options.

Command Structure

netintel-ocr [global-options] <capability> <command> [options]

Global Options

--config PATH        # Use specific configuration file
--profile NAME       # Use configuration profile
--debug, -d         # Enable debug output
--verbose, -v       # Enable verbose output
--quiet, -q         # Suppress output
--log-level LEVEL   # Set log level (DEBUG|INFO|WARNING|ERROR)
--log-file PATH     # Log to file
--log-format FORMAT # Log format (text|json)
--no-color         # Disable colored output
--dry-run          # Simulate without executing
--help, -h         # Show help
--version          # Show version

1. Process Capability

Document processing and ingestion operations.

process file

Process a single PDF document with complete multi-model support (v0.1.18.1).

netintel-ocr process file <file_path> [options]

Multi-Model Options (NEW in v0.1.18.1):
  --model, -m MODEL              # Primary OCR/text extraction model
  --network-model MODEL          # Network diagram processing model
  --flow-model MODEL             # Flow diagram processing model

Processing Modes:
  --text-only, -t                # Extract text only, skip diagrams
  --network-only                 # Extract network diagrams only

Page Selection:
  --pages RANGE                  # Page range (e.g., 1-10 or 1,3,5)
  --start, -s INT                # Start page number
  --end, -e INT                  # End page number

Diagram Processing:
  --confidence, -c FLOAT         # Detection confidence (0.0-1.0)
  --no-icons                     # Disable Mermaid icons
  --diagram-only                 # Extract only diagrams
  --fast-extraction              # Optimized fast extraction
  --multi-diagram                # Force multi-diagram mode
  --no-auto-detect               # Disable auto-detection

Table Extraction:
  --extract-tables               # Extract tables (enabled by default)
  --no-tables                    # Disable table extraction
  --table-confidence FLOAT       # Table detection threshold
  --table-method METHOD          # Table method (llm|hybrid)
  --save-table-json              # Save tables as JSON

Processing Control:
  --resume                       # Resume from checkpoint
  --timeout SECONDS              # Operation timeout
  --keep-images, -k              # Keep intermediate files
  --width, -w INT                # Image processing width

Output Control:
  --output, -o PATH              # Output file path
  --debug, -d                    # Enable debug output
  --verbose, -v                  # Verbose output
  --quiet, -q                    # Minimal output

Vector Generation (Milvus default):
  --no-vector                    # Disable vector generation
  --vector-format FORMAT         # Vector DB format (milvus|lancedb)
  --chunk-size INT               # Chunk size (default: 1000)
  --chunk-overlap INT            # Chunk overlap (default: 100)
  --chunk-strategy STRATEGY      # Chunking strategy (semantic|fixed|sentence)

Knowledge Graph:
  --with-kg                      # Enable KG extraction
  --kg-model MODEL               # KG embedding model

Examples:
  # Basic processing
  netintel-ocr process file document.pdf

  # Multi-model processing (NEW!)
  netintel-ocr process file doc.pdf \
    --model nanonets-ocr-s \
    --network-model qwen2.5vl \
    --flow-model custom-flow

  # Advanced options
  netintel-ocr process file doc.pdf \
    --pages 1-50 \
    --confidence 0.8 \
    --fast-extraction \
    --table-method hybrid \
    --with-kg \
    --vector-format milvus

process batch

Process multiple documents.

netintel-ocr process batch <directory|pattern> [options]

Options:
  --files LIST               # File list (one per line)
  --pattern GLOB             # File pattern (e.g., *.pdf)
  --recursive, -r            # Process subdirectories
  --parallel INT             # Parallel workers
  --batch-size INT           # Documents per batch
  --output-dir DIR           # Output directory
  --output-structure TYPE    # Output structure (flat|tree|type)
  --checkpoint PATH          # Checkpoint file
  --resume                   # Resume from checkpoint
  --skip-errors              # Continue on errors
  --dedup                    # Deduplicate documents
  --ingest                   # Ingest to vector store
  --collection NAME          # Target collection

Examples:
  netintel-ocr process batch /path/to/pdfs/
  netintel-ocr process batch --pattern "*.pdf" --parallel 4
  netintel-ocr process batch --files list.txt --ingest

process watch

Watch directory for new documents.

netintel-ocr process watch <directory> [options]

Options:
  --pattern GLOB         # File pattern to watch
  --interval SECONDS     # Check interval
  --process-existing     # Process existing files
  --move-processed DIR   # Move processed files
  --move-failed DIR      # Move failed files

Examples:
  netintel-ocr process watch /input --pattern "*.pdf"
  netintel-ocr process watch /scan --interval 30

process dedup

Find and remove duplicate documents.

netintel-ocr process dedup <directory> [options]
netintel-ocr process find-duplicates <directory> [options]
netintel-ocr process dedup-stats [options]

Options:
  --threshold FLOAT      # Similarity threshold
  --mode MODE           # Dedup mode (hash|content|hybrid)
  --action ACTION       # Action (report|remove|move)
  --move-to DIR         # Move duplicates to directory

Examples:
  netintel-ocr process find-duplicates /docs
  netintel-ocr process dedup /docs --threshold 0.95
  netintel-ocr process dedup-stats

2. Server Capability

API and server management.

server api

Start REST API server.

netintel-ocr server api [options]

Options:
  --host HOST           # Bind host (default: 0.0.0.0)
  --port PORT           # Bind port (default: 8000)
  --workers INT         # Worker processes
  --timeout SECONDS     # Request timeout
  --max-requests INT    # Max requests per worker
  --auth-key KEY        # API authentication key
  --cors-origins LIST   # CORS allowed origins
  --tls-cert PATH       # TLS certificate
  --tls-key PATH        # TLS key

Examples:
  netintel-ocr server api
  netintel-ocr server api --port 8080 --workers 4
  netintel-ocr server api --auth-key secret --tls-cert cert.pem

server mcp

Start Model Context Protocol server.

netintel-ocr server mcp [options]

Options:
  --host HOST          # Bind host
  --port PORT          # Bind port (default: 8001)
  --stdio              # Use stdio mode
  --transport TYPE     # Transport (stdio|http|websocket)

Examples:
  netintel-ocr server mcp
  netintel-ocr server mcp --port 8001
  netintel-ocr server mcp --stdio

server all

Start all services.

netintel-ocr server all [options]

Options:
  --api-port PORT      # API port
  --mcp-port PORT      # MCP port
  --workers INT        # Worker processes

Examples:
  netintel-ocr server all
  netintel-ocr server all --api-port 8000 --mcp-port 8001

server worker

Start background worker.

netintel-ocr server worker [options]

Options:
  --count INT          # Number of workers
  --queue NAME         # Queue name
  --embedded           # Run in API process

Examples:
  netintel-ocr server worker --count 4
  netintel-ocr server worker --embedded

server status/health

Check server status.

netintel-ocr server status
netintel-ocr server health
netintel-ocr server metrics

Examples:
  netintel-ocr server status
  netintel-ocr server health --detailed
  netintel-ocr server metrics --format json

3. Database Capability

Database and vector store operations.

db query

Query documents.

netintel-ocr db query <query> [options]

Options:
  --collection NAME      # Collection to query
  --limit INT           # Result limit
  --threshold FLOAT     # Similarity threshold
  --filters JSON        # Query filters
  --fields LIST         # Fields to return
  --vector              # Vector search mode
  --hybrid              # Hybrid search mode

Examples:
  netintel-ocr db query "firewall configuration"
  netintel-ocr db query "network topology" --limit 10
  netintel-ocr db query "security" --collection docs --vector

Advanced search operations.

netintel-ocr db search <query> [options]

Options:
  --date-range RANGE    # Date range
  --document-type TYPE  # Document type filter
  --author NAME         # Author filter
  --tags LIST          # Tag filters

Examples:
  netintel-ocr db search "compliance" --date-range 2024-01-01:2024-12-31
  netintel-ocr db search "firewall" --document-type network

db stats

Database statistics.

netintel-ocr db stats [options]
netintel-ocr db info

Options:
  --collection NAME     # Specific collection
  --detailed           # Detailed statistics

Examples:
  netintel-ocr db stats
  netintel-ocr db stats --collection network_docs --detailed
  netintel-ocr db info

db manage

Database management.

netintel-ocr db optimize [options]
netintel-ocr db compact [collection]
netintel-ocr db rebuild-index [collection]
netintel-ocr db verify-index [collection]
netintel-ocr db export <output_file>
netintel-ocr db import <input_file>
netintel-ocr db backup [output_dir]
netintel-ocr db restore <backup_dir>
netintel-ocr db merge [sources...]
netintel-ocr db drop-collection <name>

Examples:
  netintel-ocr db optimize
  netintel-ocr db compact network_docs
  netintel-ocr db export backup.db
  netintel-ocr db rebuild-index --optimize

4. Knowledge Graph Capability

Knowledge Graph operations (passthrough to KG CLI).

kg init

Initialize Knowledge Graph.

netintel-ocr kg init [options]

Options:
  --reset              # Reset existing KG
  --import PATH        # Import from file

Examples:
  netintel-ocr kg init
  netintel-ocr kg init --reset

kg query

Query Knowledge Graph.

netintel-ocr kg query <cypher_query> [options]

Options:
  --limit INT          # Result limit
  --format FORMAT      # Output format (json|table|csv)

Examples:
  netintel-ocr kg query "MATCH (n) RETURN n LIMIT 10"
  netintel-ocr kg query "MATCH (n:Server) RETURN n.name"

kg rag-query

RAG-enhanced query.

netintel-ocr kg rag-query <natural_language_query> [options]

Options:
  --strategy TYPE       # Query strategy
  --llm-model MODEL    # LLM model
  --embedding-model MODEL # Embedding model
  --limit INT          # Result limit

Examples:
  netintel-ocr kg rag-query "Show all firewall rules"
  netintel-ocr kg rag-query "Find security vulnerabilities" --llm-model llama2

kg manage

KG management operations.

netintel-ocr kg stats
netintel-ocr kg export <output_file>
netintel-ocr kg import <input_file>
netintel-ocr kg clear
netintel-ocr kg optimize

Examples:
  netintel-ocr kg stats
  netintel-ocr kg export knowledge-graph.json
  netintel-ocr kg optimize

5. Configuration Capability

Configuration management.

config init

Initialize configuration.

netintel-ocr config init [options]

Options:
  --template NAME      # Configuration template
  --output PATH        # Output path
  --force             # Overwrite existing

Examples:
  netintel-ocr config init
  netintel-ocr config init --template production
  netintel-ocr config init --output /etc/netintel/config.json

config get/set

Get and set configuration values.

netintel-ocr config get <key>
netintel-ocr config set <key> <value>
netintel-ocr config unset <key>

Examples:
  netintel-ocr config get server.api.port
  netintel-ocr config set server.api.port 8080
  netintel-ocr config set models.default qwen2.5vl:7b
  netintel-ocr config unset server.api.auth.key

config profile

Manage configuration profiles.

netintel-ocr config profile list
netintel-ocr config profile create <name>
netintel-ocr config profile use <name>
netintel-ocr config profile delete <name>
netintel-ocr config profile copy <source> <dest>
netintel-ocr config profile export <name>
netintel-ocr config profile import <name> <file>
netintel-ocr config profile diff <profile1> <profile2>

Examples:
  netintel-ocr config profile create production
  netintel-ocr config profile use production
  netintel-ocr config profile export production > prod.json

config env

Environment variable management.

netintel-ocr config env export [options]
netintel-ocr config env load <file>
netintel-ocr config env show

Examples:
  netintel-ocr config env export > .env
  netintel-ocr config env load production.env
  netintel-ocr config env show

config manage

Configuration management.

netintel-ocr config show [section]
netintel-ocr config validate
netintel-ocr config fix
netintel-ocr config backup [file]
netintel-ocr config restore <file>
netintel-ocr config reset
netintel-ocr config migrate <old_config>

Examples:
  netintel-ocr config show
  netintel-ocr config validate --strict
  netintel-ocr config backup config-backup.json
  netintel-ocr config migrate old-config.ini

6. Project Capability

Project initialization and management.

project init

Initialize project structure.

netintel-ocr project init [options]

Options:
  --template NAME       # Project template
  --output DIR         # Output directory
  --force             # Overwrite existing

Templates:
  - small: Development/test environment
  - medium: Staging environment
  - large: Production environment
  - enterprise: High-availability setup

Examples:
  netintel-ocr project init
  netintel-ocr project init --template production
  netintel-ocr project init --template enterprise --output /opt/netintel

project generate

Generate deployment files.

netintel-ocr project generate docker
netintel-ocr project generate kubernetes
netintel-ocr project generate helm
netintel-ocr project generate systemd

Examples:
  netintel-ocr project generate docker > docker-compose.yml
  netintel-ocr project generate kubernetes --output k8s/
  netintel-ocr project generate helm --name netintel-ocr

7. Model Capability

Model management operations.

model list

List available models.

netintel-ocr model list [options]

Options:
  --sort-by FIELD      # Sort by (name|size|speed|accuracy)
  --filter TYPE        # Filter by type

Examples:
  netintel-ocr model list
  netintel-ocr model list --sort-by speed
  netintel-ocr model list --filter vision

model ollama

OLLAMA model management.

netintel-ocr model ollama list
netintel-ocr model ollama pull <model>
netintel-ocr model ollama remove <model>
netintel-ocr model ollama set-host <host>
netintel-ocr model ollama verify

Examples:
  netintel-ocr model ollama list
  netintel-ocr model ollama pull qwen2.5vl:7b
  netintel-ocr model ollama set-host http://ollama:11434

model config

Configure models.

netintel-ocr model set-default <type> <model>
netintel-ocr model config <model> [options]
netintel-ocr model preload <model>
netintel-ocr model unload <model>
netintel-ocr model keep-loaded

Examples:
  netintel-ocr model set-default network qwen2.5vl:7b
  netintel-ocr model config qwen2.5vl:7b --max-context 2048
  netintel-ocr model preload qwen2.5vl:7b

model benchmark

Benchmark models.

netintel-ocr model benchmark [model]
netintel-ocr model compare <models...>
netintel-ocr model recommend [options]

Examples:
  netintel-ocr model benchmark qwen2.5vl:7b
  netintel-ocr model compare qwen2.5vl:7b llava:13b
  netintel-ocr model recommend --priority speed

8. System Capability

System utilities and diagnostics.

system check

System checks and requirements.

netintel-ocr system check [options]
netintel-ocr system version [options]
netintel-ocr system info

Options:
  --verbose           # Detailed output
  --json             # JSON output

Examples:
  netintel-ocr system check
  netintel-ocr system version --json
  netintel-ocr system info

system health

Health monitoring.

netintel-ocr system health [options]

Options:
  --detailed          # Detailed health info
  --component NAME    # Check specific component
  --json             # JSON output

Examples:
  netintel-ocr system health
  netintel-ocr system health --detailed
  netintel-ocr system health --component api

system metrics

System metrics and performance.

netintel-ocr system metrics [options]
netintel-ocr system performance
netintel-ocr system resources

Options:
  --watch            # Continuous monitoring
  --interval SEC     # Update interval
  --category TYPE    # Metric category

Examples:
  netintel-ocr system metrics
  netintel-ocr system metrics --watch --interval 1
  netintel-ocr system performance

system diagnose

Diagnostic tools.

netintel-ocr system diagnose [options]
netintel-ocr system test-connection <service>
netintel-ocr system benchmark [options]
netintel-ocr system profile [options]

Options:
  --output FILE      # Save diagnostic report
  --performance      # Include performance data
  --detailed        # Detailed diagnostics

Examples:
  netintel-ocr system diagnose --output report.txt
  netintel-ocr system test-connection ollama
  netintel-ocr system benchmark
  netintel-ocr system profile --duration 60

system cache

Cache management.

netintel-ocr system cache stats
netintel-ocr system cache clear [type]
netintel-ocr system cache warmup
netintel-ocr system clear-cache

Examples:
  netintel-ocr system cache stats
  netintel-ocr system cache clear models
  netintel-ocr system clear-cache

system gpu

GPU management.

netintel-ocr system gpu status
netintel-ocr system gpu monitor
netintel-ocr system gpu optimize

Examples:
  netintel-ocr system gpu status
  netintel-ocr system gpu monitor --interval 1
  netintel-ocr system gpu optimize --auto

Shell Completion

Enable tab completion for your shell.

Bash

# Generate completion script
netintel-ocr completion bash > /etc/bash_completion.d/netintel-ocr

# Or add to .bashrc
eval "$(netintel-ocr completion bash)"

Zsh

# Generate completion script
netintel-ocr completion zsh > ~/.zsh/completions/_netintel-ocr

# Or add to .zshrc
eval "$(netintel-ocr completion zsh)"

Fish

# Generate completion script
netintel-ocr completion fish > ~/.config/fish/completions/netintel-ocr.fish

Environment Variables

# Configuration
NETINTEL_CONFIG         # Configuration file path
NETINTEL_PROFILE        # Active profile name

# Server settings
NETINTEL_SERVER_API_PORT      # API server port
NETINTEL_SERVER_API_HOST      # API server host
NETINTEL_SERVER_MCP_PORT      # MCP server port

# Model settings
NETINTEL_MODELS_DEFAULT       # Default model
NETINTEL_MODELS_OLLAMA_HOST   # OLLAMA host

# Database settings
NETINTEL_DB_MILVUS_HOST      # Milvus host
NETINTEL_DB_MILVUS_PORT      # Milvus port
NETINTEL_DB_COLLECTION        # Default collection

# Performance
NETINTEL_PERFORMANCE_GPU_ENABLED    # Enable GPU
NETINTEL_PERFORMANCE_MAX_PARALLEL   # Max parallel workers

# Logging
NETINTEL_LOGGING_LEVEL       # Log level
NETINTEL_LOGGING_FILE        # Log file path
NETINTEL_DEBUG               # Enable debug mode

Exit Codes

  • 0: Success
  • 1: General error
  • 2: Configuration error
  • 3: Connection error
  • 4: Processing error
  • 5: Authentication error
  • 6: Invalid input
  • 7: Resource error
  • 130: Interrupted (Ctrl+C)

Next Steps