Skip to content

Getting Started

This guide will help you run your first scan with Unreach.

Your First Scan

The simplest way to use Unreach is to scan the current directory:

bash
# Scan current directory (shows interactive menu)
unreach

# Or explicitly run scan
unreach scan

Scan a Specific Directory

To scan a different directory, provide the path:

bash
unreach scan /path/to/directory

Note: If no directory is specified, Unreach scans the current directory (.). You can also explicitly specify the current directory:

bash
unreach scan .

Scan with Custom Entry Point

By default, Unreach automatically detects entry points. You can also specify custom entry points:

bash
unreach scan --entry src/index.ts

You can specify multiple entry points:

bash
unreach scan --entry src/index.ts,src/main.ts

Export Results

Unreach can export results in multiple formats for further analysis or automation:

bash
# Export as JSON (explicit format)
unreach scan --export json

# Export as JSON (default when no format specified)
unreach scan --export

# Export in multiple formats
unreach scan --export json,html,md

# Export to custom directory
unreach scan --export json --export-path ./reports

# Keep history with timestamps
unreach scan --export json --history

Common Options

bash
# Suppress all output except errors
unreach scan --quiet

# Disable progress indicator
unreach scan --no-progress

# Watch mode (continuous monitoring)
unreach scan --watch

# Interactive mode (menu-driven configuration)
unreach scan --interactive

# Verbose mode (detailed output)
unreach scan --verbose

# Debug mode (stack traces and detailed errors)
unreach scan --debug

# Benchmark mode (performance metrics)
unreach scan --benchmark

# Generate dependency graph visualization
unreach scan --visualize

# Group output by file instead of type
unreach scan --group-by file

# Disable incremental analysis (full re-scan)
unreach scan --no-incremental

# Ignore configuration file
unreach scan --no-config

# Show summary statistics
unreach scan --stats

Understanding the Output

After scanning, Unreach will show you:

  • Entry points found - The files that serve as entry points for your application
  • Dependency graph - Progress of building the dependency graph
  • Unused items - Categorized list of unused code:
    • Unused packages
    • Unused imports
    • Unused exports
    • Unused functions
    • Unused variables
    • Unused types
    • Unused files
    • Unused configs
    • Unused scripts
    • Unused CSS classes
    • Unused assets
  • Summary statistics (with --stats flag) - Overview including:
    • Files analyzed
    • Packages analyzed
    • Entry points count
    • Unused items breakdown by category
    • Total unused items count

Each item includes the file path and line number (if applicable) for easy identification.

Next Steps

Released under the MIT License.