VisCommandsvis add

vis add

Add packages with typosquat detection and security scanning

vis add

Add packages using the detected package manager. Before installing, vis runs a typosquat check against a curated blocklist of known malicious package names, followed by an optional Socket.dev security scan.

Usage

vis add <packages...> [options]

Examples

vis add react react-dom              # Add packages
vis add -D typescript @types/react   # Add as dev dependencies
vis add react --filter app           # Add to specific workspace package
vis add -g typescript                # Add globally (uses npm)
vis add lodash -w                    # Add to workspace root
vis add lodash --no-socket-check     # Add without Socket.dev check
vis add lodash --no-typosquat-check  # Skip typosquat name check

Options

OptionAliasDefaultDescription
--save-dev-DfalseAdd as dev dependency
--exact-EfalseSave exact version
--save-peer-PfalseAdd as peer dependency
--save-optional-OfalseAdd as optional dependency
--global-gfalseInstall globally (uses npm)
--workspace-root-wfalseAdd to workspace root
--workspacefalseUse workspace protocol (pnpm)
--filter-FFilter by workspace package name
--no-typosquat-checkfalseSkip typosquat name check before adding
--no-socket-checkfalseSkip Socket.dev security check before adding

How It Works

flowchart TD
    A["vis add &lt;packages&gt;"] --> B{Typosquat check\nenabled?}
    B -- no --> E
    B -- yes --> C["Check names against\nblocklist & heuristics"]
    C --> D{Typosquat\ndetected?}
    D -- no --> E{Socket.dev\ncheck enabled?}
    D -- yes --> P["Show warning:\n'Did you mean X?'"]
    P --> Q{User choice}
    Q -- "S (suggested)" --> R["Replace with correct\npackage name"]
    R --> E
    Q -- "y (keep original)" --> E
    Q -- "N (abort)" --> Z["Exit with code 1"]
    E -- no --> G
    E -- yes --> F["Fetch security\nreports from Socket.dev"]
    F --> H{Score below\nthreshold?}
    H -- no --> G["Detect package manager\n(pnpm, npm, yarn, bun)"]
    H -- yes --> I{User\nconfirms?}
    I -- yes --> G
    I -- no --> Z
    G --> J["Run native\nadd command"]
    J --> K["Done"]

Typosquat Detection

When you run vis add, the package names are checked against a curated blocklist of known typosquats for popular packages (react, express, lodash, axios, etc.). The detection uses two methods:

  1. Blocklist lookup -- Direct match against data/typosquats.json, a curated list of known typosquat names that exist on npm.
  2. Heuristic detection -- Generates variants using common attack patterns (character omission, transposition, duplication, homoglyph substitution, separator swaps) and checks if your input matches any variant of a known package.

Example

$ vis add axois
warn: Possible typosquat detected:
warn: axois did you mean axios? (known typosquat)

Use suggested package instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N)

Choosing S replaces axois with axios and continues the add, preserving any version specifier you provided (e.g., axois@^1.0 becomes axios@^1.0).

In non-interactive mode (CI, piped stdin), typosquat detection always aborts to prevent automated installation of malicious packages.

Socket.dev Security Check

When Socket.dev is configured (via vis.config.ts), each package is scored across multiple dimensions (license, maintenance, quality, supply chain, vulnerability). Packages scoring below the minimum threshold (default: 40%) require explicit confirmation.

See vis init to configure Socket.dev integration.

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues