On this page
01Installation
Homebrew (recommended)
$ brew install greatnessinabox/tap/driftShell script
$ curl -fsSL https://raw.githubusercontent.com/greatnessinabox/drift/main/install.sh | shOn macOS, if you download drift manually from GitHub Releases, you may need to allow it inSystem Settings → Privacy & Securityor run xattr -d com.apple.quarantine $(which drift). The Homebrew and shell script installers handle this automatically.
Go install
$ go install github.com/greatnessinabox/drift/cmd/drift@latestBuild from source
$ git clone https://github.com/greatnessinabox/drift.git
$ cd drift
$ go build ./cmd/drift/Verify it works
$ drift --version
drift v1.0.002Quick Start
# Run the live dashboard in any supported project
$ cd your-project
$ drift
# Generate a report
$ drift report
# Check health (for CI)
$ drift check --fail-under 70
# Interactive fix with GitHub Copilot CLI
$ drift fixdrift auto-detects the language by checking for manifest files (go.mod, package.json, Cargo.toml, pyproject.toml, pom.xml, Gemfile, composer.json, *.csproj). Supports Go, TypeScript/JavaScript, Python, Rust, Java, Ruby, PHP, and C#.
03Configuration
Create a .drift.yaml in your project root. All fields are optional — drift works with zero config.
# Language (empty = auto-detect)
language: ""
# Directories to exclude
exclude:
- vendor
- node_modules
- .git
- __pycache__
- target
# Metric weights (must sum to 1.0)
weights:
complexity: 0.30
deps: 0.20
boundaries: 0.20
dead_code: 0.15
coverage: 0.15
# Architecture boundary rules
boundaries:
- deny: "pkg/api -> internal/db"
- deny: "cmd -> internal/tui"
# AI diagnostics (optional)
ai:
provider: anthropic # or "openai"
model: "" # uses sensible defaults
# Thresholds
thresholds:
max_complexity: 15
max_stale_days: 90
min_score: 7004CLI Reference
driftLaunch the interactive TUI dashboard. Auto-detects language and starts real-time monitoring with file watching.
drift initInitialize a .drift.yaml config file in the current directory with sensible defaults.
drift reportGenerate a one-shot health report to stdout. Useful for quick checks.
drift check --fail-under <score>Exit with code 1 if health score is below the threshold. Designed for CI pipelines.
drift fixInteractive mode — finds issues, asks GitHub Copilot for fixes, and lets you apply them one by one.
drift snapshotOutput full health data as JSON. Useful for scripting and advanced CI workflows.
05Health Metrics
The overall health score is a weighted average of five dimensions. Weights are configurable in .drift.yaml.
Cyclomatic Complexity
Full AST analysis for Go, heuristic pattern matching for TS, Python, Rust, Java, Ruby, PHP, and C#. Finds your most complex functions.
Dependency Freshness
Checks every dependency against its registry — Go proxy, npm, PyPI, crates.io, Maven Central, RubyGems, Packagist, and NuGet.
Architecture Boundaries
Define import deny rules (e.g., "api cannot import db") and detect violations.
Dead Code
Finds exported functions/types with zero callers across the entire codebase.
Test Coverage
Reads coverage data from language-specific tools and factors it into the score.
06AI Diagnostics
Press d in the dashboard to trigger an AI diagnosis. The AI analyzes your worst-scoring metrics and provides specific, actionable recommendations with code snippets.
Supported providers
Anthropic Claude
Sonnet, Opus, Haiku
ANTHROPIC_API_KEYOpenAI GPT-4o
GPT-4o, o1
OPENAI_API_KEY# .drift.yaml
ai:
provider: anthropic # or "openai"
model: "" # uses sensible defaults07GitHub Copilot Integration
Interactive fixing
$ drift fix
Analyzing codebase... (Score: 78/100)
Found 3 issue(s) to fix:
1. [HIGH] model.Update() in app.go:126 (complexity: 25)
Asking GitHub Copilot for suggestions...
Apply this suggestion? [y/N/s(kip rest)]Custom agent
$ copilot --agent drift-dev "analyze internal/tui/app.go"
$ copilot --agent drift-dev "suggest refactoring for Update()"
$ copilot --agent drift-dev "help me add C# analyzer support"Requires brew install copilot-cli. drift also works with any AI coding assistant — see the multi-agent guide.
08CI/CD
Basic GitHub Action
# .github/workflows/drift.yml
name: Code Health
on: [pull_request]
jobs:
drift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: go install github.com/greatnessinabox/drift/cmd/drift@latest
- run: drift check --fail-under 70Advanced: JSON snapshot
$ SCORE=$(drift snapshot | jq '.score.total')
$ LANG=$(drift snapshot | jq -r '.language')
$ echo "Language: $LANG, Score: $SCORE"09Keyboard Shortcuts
| Key | Action |
|---|---|
| tab | Navigate between panels |
| shift+tab | Navigate backwards |
| d | Run AI diagnosis |
| r | Force full re-analysis |
| q / ctrl+c | Quit |
| esc | Close diagnosis overlay |
10Compatibility
Operating Systems
- ✓ macOS (arm64, amd64)
- ✓ Linux (arm64, amd64)
- ✓ Windows (amd64, arm64)
Shells
- ✓ bash / zsh
- ✓ fish / nushell
- ✓ PowerShell / cmd
Languages
- ✓ Go 1.21+
- ✓ TypeScript / JavaScript
- ✓ Python, Rust, Java
- ✓ Ruby, PHP, C#
drift is a single static binary with zero runtime dependencies. No Node.js, no Python runtime, no Docker. Just download and run.