Skip to content

Latest commit

 

History

History
139 lines (112 loc) · 5.44 KB

quickstart.mdx

File metadata and controls

139 lines (112 loc) · 5.44 KB
title Quick start
description Get your first list of unused code, duplication, and complexity hotspots in under a minute. Then add fallow to VS Code, CI, MCP, or Fallow Cloud.
keywords
quickstart
fallow
typescript
javascript
dead code
duplication
complexity
npx fallow
icon rocket

In under a minute, you get a list of unused code, duplication, and complexity hotspots in your project. Everyone starts with the same command. At the end, pick the integration that fits your work.

1. Run fallow

From your project root, run:

npx fallow

This command runs these analyses in one pass:

  • Dead code: unused files, exports, dependencies, and more
  • Architecture: import cycles, boundary violations, and rule-pack policy violations
  • Duplication: repeated logic across files
  • Health: complexity hotspots and refactor targets
Built-in plugins cover Next.js, Vite, Ember, Wuchale, Jest, Tailwind, PandaCSS, Contentlayer, tap, tsd, and more. The first run needs no configuration.

2. Run the focused commands you'll use most

npx fallow dead-code          # Cleanup candidates
npx fallow architecture       # Import cycles, boundaries, and policy rules
npx fallow dupes              # Repeated logic
npx fallow health             # Complexity and refactor targets
npx fallow review             # Advisory review brief over changed files (always exits 0)
npx fallow fix --dry-run      # Preview automatic cleanup
  • dead-code reports unused files, exports, types, and dependencies. See the dead code guide.
  • architecture reports circular dependencies, re-export cycles, package cycles, boundary violations, and rule-pack policy violations. See fallow architecture.
  • dupes finds AST-based duplicates in the default mild mode. To also find clones with renamed variables, add --mode semantic. See the duplication guide.
  • health reports complexity findings, maintainability per file, hotspots, and ranked refactor targets. See the health explanation.
  • fix --dry-run shows the automatic cleanup without changing files. To apply it, remove --dry-run. See the auto-fix guide.
To clean up or refactor TypeScript, add `--type-aware` when aliases, re-exports, class contracts, packages, or exact consumers affect the decision. This optional semantic pass is slower. See [Type-aware TypeScript analysis](/analysis/type-aware).

3. Pick your next step

Does your existing repo have a backlog of findings? Follow [Adopt Fallow in an existing repo](/adoption) for a step-by-step cleanup. Then come back here to set up CI or VS Code. Get real-time diagnostics, Code Lens above exports, and one-click fixes. Use fallow as a PR and merge gate, with SARIF or MR annotations. Add MCP to give Claude Code, Cursor, and other agents structured tool calls. Add production execution data to `fallow health`.

Optional: create a config

Fallow works without a config file. To customize it, run:

fallow init

fallow init detects your project structure and writes a config for it. It also adds .fallow/ to your .gitignore.

```jsonc .fallowrc.json { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "entry": ["src/workers/*.ts", "scripts/*.ts"], "ignorePatterns": ["**/*.generated.ts"], "rules": { "unused-files": "error", "unused-exports": "warn", "unused-types": "off" } } ``` ```toml fallow.toml entry = ["src/workers/*.ts", "scripts/*.ts"] ignorePatterns = ["**/*.generated.ts"]

[rules] unused-files = "error" unused-exports = "warn" unused-types = "off"

</CodeGroup>

<Info>
  To migrate from knip or jscpd, run `fallow migrate`, or read the [knip](/migration/from-knip) or [jscpd](/migration/from-jscpd) guide.
</Info>

## Optional: Fallow Cloud

The static layer of fallow is free and open source (MIT). To learn which code actually executed in production, add Fallow Cloud, the paid product. A single local capture is free. The trial below turns on continuous and multi-capture monitoring for 30 days:

```bash
npx fallow license activate --trial --email you@company.com
npx fallow coverage setup
npx fallow health --runtime-coverage ./coverage

Before you start, read Static analysis vs production data to learn how the two layers differ. Then follow the runtime coverage guide for the setup.

See also {#next-steps}

See what fallow analyzes. Customize entry points, rules, and ignore patterns. Learn how fallow works. Look up every command and flag.