Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Auto-Fix

ghostdep can generate package manager commands to fix detected findings.

Dry run (default)

Preview what would be run:

ghostdep fix --dry-run
npm install axios
npm uninstall lodash
pip install pandas
pip uninstall numpy

Nothing is executed. Commands are printed to stdout.

Apply fixes

Run the commands directly:

ghostdep fix --apply

ghostdep will ask for confirmation before executing anything:

Execute 4 command(s)? [y/N]

Each command’s result is reported:

running: npm install axios
  ok
running: npm uninstall lodash
  ok

Commands by language

ManifestPhantom (install)Unused (remove)
package.jsonnpm install <pkg>npm uninstall <pkg>
package.json + yarn.lockyarn add <pkg>yarn remove <pkg>
requirements.txtpip install <pkg>pip uninstall <pkg>
go.modgo get <module>go mod tidy
Cargo.tomlcargo add <crate>cargo remove <crate>
pom.xmlprints XML snippetprints removal note
build.gradleprints dependency lineprints removal note

ghostdep detects yarn.lock to choose yarn over npm automatically.

For Maven and Gradle, there’s no clean CLI command to add/remove deps, so ghostdep prints the snippets you need to paste manually.