Skip to content

CLI Commands Overview

React Scanner Studio provides a command-line interface (CLI) for scanning, visualizing, and building component usage dashboards.

Available Commands

CommandDescription
initInitialize react-scanner configuration in your project
scanScan your codebase for component usage
startStart the interactive dashboard development server
buildBuild a portable, static version of the dashboard

Scan Report Handling

Both start and build commands automatically check for an existing scan report:

  • If a report exists — You'll be prompted to use it or generate a new one
  • If no report exists — You'll be prompted to generate one before proceeding
  • In CI mode (--ci) — Uses existing report automatically, or fails if none exists

Global Options

These options are available for all commands:

bash
react-scanner-studio --version    # Display version number
react-scanner-studio --help       # Display help information
react-scanner-studio <command> --help  # Display help for a specific command

Basic Usage

bash
# Show help
npx react-scanner-studio --help

# Initialize configuration
npx react-scanner-studio init

# Scan your codebase
npx react-scanner-studio scan

# Start the dashboard server
npx react-scanner-studio start

# Build static files
npx react-scanner-studio build

Command Flow

The typical workflow follows this order:

┌──────────────────┐
│                  │
│   1. init        │  Set up configuration (one-time)
│                  │
└────────┬─────────┘


┌──────────────────┐
│                  │
│   2. scan        │  Generate scan data (run periodically)
│                  │
└────────┬─────────┘


┌──────────────────┐
│                  │
│   3. start       │  View interactive dashboard (development)
│      - or -      │
│   4. build       │  Generate static files (production/sharing)
│                  │
└──────────────────┘

Exit Codes

All commands follow standard exit code conventions:

CodeDescription
0Success
1Error (configuration not found, invalid options, etc.)

Environment Detection

React Scanner Studio automatically detects your project environment:

  • Package Manager — Detects yarn.lock to determine whether to use Yarn or npm for installing dependencies
  • Workspaces — Detects monorepo workspace configurations and adjusts install commands accordingly

What's Next?

Learn about each command in detail:

  • init — Set up your project
  • scan — Scan your codebase for component usage
  • start — Run the development server
  • build — Generate static files

Released under the MIT License.